lumis.portal.website
Class WebsiteUtil

Package class diagram package WebsiteUtil
java.lang.Object
  extended by lumis.portal.website.WebsiteUtil

public class WebsiteUtil
extends Object

Website utility class.

Since:
6.2.0

Constructor Summary
WebsiteUtil()
           
 
Method Summary
static boolean compareURLs(IWebsiteBaseURL firstURL, IWebsiteBaseURL secondURL)
          Compares if the URLs are equals
static String getDefaultPageWebSiteURL(HttpServletRequest request, int portalMode)
          Returns the URL to the current website with page id to the defined portal mode.
static String getId(IWebsiteBaseURL url)
          Returns the identifier of the given website base URL.
static IWebsiteBaseURL getWebsiteBaseURLById(String id)
          Returns the website base URL based on its identification.
static String getWebsiteURL(HttpServletRequest request)
          Returns the current WebsiteURL.
static IWebsiteBaseURL resolveWebsiteBaseURLByString(String websiteStr)
          Resolves the given website string in a website base URL.
The given string will be parsed as new URI(String), so that it must adhere with URI syntax.
static IWebsite resolveWebsiteByString(String websiteStr)
          Resolves the given website string in a website.
The given string will be parsed as new URI(String), so that it must adhere with URI syntax.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebsiteUtil

public WebsiteUtil()
Method Detail

resolveWebsiteByString

public static IWebsite resolveWebsiteByString(String websiteStr)
                                       throws PortalException
Resolves the given website string in a website.
The given string will be parsed as new URI(String), so that it must adhere with URI syntax.

Parameters:
websiteStr - the website string to be parsed.
Returns:
the resolved website.
Throws:
IllegalArgumentException - if the given string is a malformed URL.
IllegalArgumentException - if the protocol isn't neither HTTP nor HTTPS.
PortalException
Since:
6.2.0
See Also:
resolveWebsiteBaseURLByString(String)

compareURLs

public static boolean compareURLs(IWebsiteBaseURL firstURL,
                                  IWebsiteBaseURL secondURL)
Compares if the URLs are equals

Parameters:
firstURL - IWebsiteBaseURL to be compared
secondURL - IWebsiteBaseURL to be compared
Returns:
boolean true if the urls are equals
Since:
7.0.0

resolveWebsiteBaseURLByString

public static IWebsiteBaseURL resolveWebsiteBaseURLByString(String websiteStr)
                                                     throws PortalException
Resolves the given website string in a website base URL.
The given string will be parsed as new URI(String), so that it must adhere with URI syntax.

Parameters:
websiteStr - the website string to be parsed.
Returns:
the resolved website base URL.
Throws:
IllegalArgumentException - if the given string is a malformed URL.
IllegalArgumentException - if the protocol isn't neither HTTP nor HTTPS.
PortalException
Since:
6.2.0

getId

public static String getId(IWebsiteBaseURL url)
Returns the identifier of the given website base URL.

Parameters:
url - the website base URL.
Returns:
the identifier of the given website base URL.
Throws:
IllegalArgumentException - if the given object is null.
IllegalArgumentException - if the given object's class is unknown.
Since:
6.2.0

getWebsiteBaseURLById

public static IWebsiteBaseURL getWebsiteBaseURLById(String id)
Returns the website base URL based on its identification.

Parameters:
id - the website base URL identification.
Returns:
the website base URL based on its identification.
Since:
6.2.0

getWebsiteURL

public static String getWebsiteURL(HttpServletRequest request)
Returns the current WebsiteURL.

Parameters:
request - request in which the website is situated.
Returns:
string containing protocol://hostname : port / context. Port may be omitted if it's 80.
Since:
7.0.0

getDefaultPageWebSiteURL

public static String getDefaultPageWebSiteURL(HttpServletRequest request,
                                              int portalMode)
                                       throws PortalException
Returns the URL to the current website with page id to the defined portal mode.

Parameters:
request - from where to find website.
portalMode - value of the portal mode for the url to be generated to.
Returns:
string containing website url.
Throws:
PortalException
Since:
7.0.0


Lumisportal  7.0.0.121130 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.