lumis.portal.url
Interface IURLManager

Package class diagram package IURLManager
All Known Implementing Classes:
URLManager

public interface IURLManager

Provides URL resolution and mapping management.

Since:
5.0.0

Nested Class Summary
static class IURLManager.CreateStrategy
          Contains creation strategy options.
 
Field Summary
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 URL_RESOLVER_PROPERTY_NAME
          The name of the property where the class name of the IURLResolver implementation is stored.
static java.lang.String WEBSITE_PROPERTY_NAME
           
 
Method Summary
 java.lang.String convertHTMLPathsToDynamicPaths(java.lang.String html)
          Replaces, in an HTML code, paths to web resources by the corresponding dynamic path.
 java.lang.String fixReferencesAccordingToPath(java.lang.String html, java.lang.String path)
          Fixes references within an HTML according to the given path.
 WebResource getWebResourceByDynamicPath(java.lang.String dynamicPath, IURLManager.CreateStrategy createStrategy)
          Returns a web resource for the given dynamic path.
 WebResource getWebResourceByDynamicPath(java.lang.String dynamicPath, IURLManager.CreateStrategy createStrategy, java.util.Locale locale)
          Returns a web resource for the given dynamic path.
 java.lang.String getWebResourcePathByDynamicPath(java.lang.String dynamicPath, java.util.Locale locale)
          Returns the path for accessing the web resource of the given dynamic path.
 java.lang.String processHTMLDynamicPathReferences(java.lang.String html)
          Processes references to dynamic paths in a given HTML code.
 java.lang.String processHTMLDynamicPathReferences(java.lang.String htmlModifiedContent, java.util.Locale locale, boolean convertGuestOnlyCaches)
          Processes references to dynamic paths in a given HTML code.
 void setWebResourcesMissingData(IWebResourceFactory webResourceFactory, java.util.Collection<WebResource> webResources, boolean cacheEnabled, boolean friendlyURLEnabled)
          Sets missing data in the given web resources.
 

Field Detail

URL_RESOLVER_PROPERTY_NAME

static final java.lang.String URL_RESOLVER_PROPERTY_NAME
The name of the property where the class name of the IURLResolver 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 to false.

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 to htmlGeneration/htmlFileExtension specified in lumisportalconfig.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 to htmlGeneration/shtmlFileExtension specified in lumisportalconfig.xml.

Since:
6.0.0
See Also:
EXTENSION_HTML_PROPERTY_NAME, Constant Field Values
Method Detail

getWebResourcePathByDynamicPath

java.lang.String getWebResourcePathByDynamicPath(java.lang.String dynamicPath,
                                                 java.util.Locale locale)
                                                 throws PortalException
Returns the path for accessing the web resource of the given dynamic path. Uses the AUTO 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

getWebResourceByDynamicPath

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:

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, and createStrategy is NEVER.
java.lang.IllegalArgumentException - if the specified dynamic path could not be resolved into a web resource.
PortalException
Since:
5.0.0

getWebResourceByDynamicPath

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:

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, and createStrategy is NEVER.
java.lang.IllegalArgumentException - if the specified dynamic path could not be resolved into a web resource.
PortalException
Since:
5.0.0

processHTMLDynamicPathReferences

java.lang.String processHTMLDynamicPathReferences(java.lang.String html)
                                                  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 paths.

Parameters:
html - the HTML code.
Returns:
the HTML code, with the references replaced.
Throws:
PortalException
Since:
5.0.0

convertHTMLPathsToDynamicPaths

java.lang.String convertHTMLPathsToDynamicPaths(java.lang.String html)
                                                throws PortalException
Replaces, in an HTML code, paths to web resources by the corresponding dynamic path.

Parameters:
htmlContent - the HTML code.
Returns:
the converted HTML code.
Throws:
PortalException
Since:
5.0.0

processHTMLDynamicPathReferences

java.lang.String processHTMLDynamicPathReferences(java.lang.String htmlModifiedContent,
                                                  java.util.Locale locale,
                                                  boolean convertGuestOnlyCaches)
                                                  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 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

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

java.lang.String fixReferencesAccordingToPath(java.lang.String html,
                                              java.lang.String path)
                                              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.
Returns:
the original HTML with adjusted references.
Throws:
PortalException
Since:
5.0.0


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