Class PortalUtil

Object
com.liferay.portal.kernel.util.PortalUtil

public class PortalUtil extends Object
Author:
Brian Wing Shun Chan, Eduardo Lundgren, Juan Fernández
  • Constructor Details

    • PortalUtil

      public PortalUtil()
  • Method Details

    • addPageDescription

      public static void addPageDescription(String description, javax.servlet.http.HttpServletRequest httpServletRequest)
      Appends the description to the current meta description of the page in the request.
      Parameters:
      description - the description to append to the current meta description
      httpServletRequest - the servlet request for the page
    • addPageKeywords

      public static void addPageKeywords(String keywords, javax.servlet.http.HttpServletRequest httpServletRequest)
      Appends the keywords to the current meta keywords of the page in the request.
      Parameters:
      keywords - the keywords to add to the current meta keywords (comma-separated)
      httpServletRequest - the servlet request for the page
    • addPageSubtitle

      public static void addPageSubtitle(String subtitle, javax.servlet.http.HttpServletRequest httpServletRequest)
      Appends the subtitle to the current subtitle of the page in the request.
      Parameters:
      subtitle - the subtitle to append to the current subtitle
      httpServletRequest - the servlet request for the page
    • addPageTitle

      public static void addPageTitle(String title, javax.servlet.http.HttpServletRequest httpServletRequest)
      Appends the title to the current title of the page in the request.
      Parameters:
      title - the title to append to the current title
      httpServletRequest - the servlet request for the page
    • addPortletBreadcrumbEntry

      public static void addPortletBreadcrumbEntry(javax.servlet.http.HttpServletRequest httpServletRequest, String title, String url)
      Adds an entry to the portlet breadcrumbs for the page in the request.
      Parameters:
      httpServletRequest - the servlet request for the page
      title - the title of the new breadcrumb entry
      url - the URL of the new breadcrumb entry
    • addPortletBreadcrumbEntry

      public static void addPortletBreadcrumbEntry(javax.servlet.http.HttpServletRequest httpServletRequest, String title, String url, Map<String,Object> data)
      Adds an entry to the portlet breadcrumbs for the page in the request.
      Parameters:
      httpServletRequest - the servlet request for the page
      title - the title of the new breadcrumb entry
      url - the URL of the new breadcrumb entry
      data - the HTML5 data parameters of the new breadcrumb entry
    • addPortletBreadcrumbEntry

      public static void addPortletBreadcrumbEntry(javax.servlet.http.HttpServletRequest httpServletRequest, String title, String url, Map<String,Object> data, boolean portletBreadcrumbEntry)
      Adds an entry to the portlet breadcrumbs for the page in the request.
      Parameters:
      httpServletRequest - the servlet request for the page
      title - the title of the new breadcrumb entry
      url - the URL of the new breadcrumb entry
      data - the HTML5 data parameters of the new breadcrumb entry
      portletBreadcrumbEntry - whether the entry is a portlet breadcrumb entry
    • addPortletDefaultResource

      public static void addPortletDefaultResource(javax.servlet.http.HttpServletRequest httpServletRequest, Portlet portlet) throws PortalException
      Adds the default resource permissions for the portlet to the page in the request.
      Parameters:
      httpServletRequest - the servlet request for the page
      portlet - the portlet
      Throws:
      PortalException - if a portal exception occurred
    • addPortletDefaultResource

      public static void addPortletDefaultResource(long companyId, Layout layout, Portlet portlet) throws PortalException
      Throws:
      PortalException
    • addPreservedParameters

      public static String addPreservedParameters(ThemeDisplay themeDisplay, Layout layout, String url, boolean doAsUser)
      Adds the preserved parameters doAsGroupId and refererPlid to the URL, optionally adding doAsUserId and doAsUserLanguageId as well.

      Preserved parameters are parameters that should be sent with every request as the user navigates the portal.

      Parameters:
      themeDisplay - the current theme display
      layout - the current page
      url - the URL
      doAsUser - whether to include doAsUserId and doAsLanguageId in the URL if they are available. If false, doAsUserId and doAsUserLanguageId will never be added.
      Returns:
      the URL with the preserved parameters added
    • addPreservedParameters

      public static String addPreservedParameters(ThemeDisplay themeDisplay, String url)
      Adds the preserved parameters doAsUserId, doAsUserLanguageId, doAsGroupId, and refererPlid to the URL.
      Parameters:
      themeDisplay - the current theme display
      url - the URL
      Returns:
      the URL with the preserved parameters added
    • addPreservedParameters

      public static String addPreservedParameters(ThemeDisplay themeDisplay, String url, boolean typeControlPanel, boolean doAsUser)
    • copyRequestParameters

      public static void copyRequestParameters(ActionRequest actionRequest, ActionResponse actionResponse)
      Copies the request parameters to the render parameters, unless a parameter with that name already exists in the render parameters.
      Parameters:
      actionRequest - the request from which to get the request parameters
      actionResponse - the response to receive the render parameters
    • escapeRedirect

      public static String escapeRedirect(String url)
      Escapes the URL for use in a redirect and checks that security settings allow the URL is allowed for redirects.
      Parameters:
      url - the URL to escape
      Returns:
      the escaped URL, or null if the URL is not allowed for redirects
    • generateRandomKey

      public static String generateRandomKey(javax.servlet.http.HttpServletRequest httpServletRequest, String input)
      Generates a random key to identify the request based on the input string.
      Parameters:
      httpServletRequest - the servlet request for the page
      input - the input string
      Returns:
      the generated key
    • getAbsoluteURL

      public static String getAbsoluteURL(javax.servlet.http.HttpServletRequest httpServletRequest, String url)
    • getActualLayoutQueryStringComposite

      public static LayoutQueryStringComposite getActualLayoutQueryStringComposite(long groupId, boolean privateLayout, String friendlyURL, Map<String,String[]> params, Map<String,Object> requestContext) throws PortalException
      Throws:
      PortalException
    • getActualURL

      public static String getActualURL(long groupId, boolean privateLayout, String mainPath, String friendlyURL, Map<String,String[]> params, Map<String,Object> requestContext) throws PortalException
      Throws:
      PortalException
    • getAlternateURL

      public static String getAlternateURL(String canonicalURL, ThemeDisplay themeDisplay, Locale locale, Layout layout) throws PortalException
      Returns the alternate URL for the requested canonical URL in the given locale.

      The alternate URL lets search engines know that an equivalent page is available for the given locale. For more information, see https://support.google.com/webmasters/answer/189077?hl=en.

      Parameters:
      canonicalURL - the canonical URL being requested. For more information, see getCanonicalURL(java.lang.String, com.liferay.portal.kernel.theme.ThemeDisplay, com.liferay.portal.kernel.model.Layout).
      themeDisplay - the theme display
      locale - the locale of the alternate URL being generated
      layout - the page being requested
      Returns:
      the alternate URL for the requested canonical URL in the given locale
      Throws:
      PortalException - if a portal exception occurred
    • getAlternateURLs

      public static Map<Locale,String> getAlternateURLs(String canonicalURL, ThemeDisplay themeDisplay, Layout layout) throws PortalException
      Throws:
      PortalException
    • getAlternateURLs

      public static Map<Locale,String> getAlternateURLs(String canonicalURL, ThemeDisplay themeDisplay, Layout layout, Set<Locale> availableLocales) throws PortalException
      Throws:
      PortalException
    • getAncestorSiteGroupIds

      public static long[] getAncestorSiteGroupIds(long groupId)
    • getCanonicalURL

      public static String getCanonicalURL(String completeURL, ThemeDisplay themeDisplay, Layout layout) throws PortalException
      Returns the canonical URL for the page. The canonical URL is often used to distinguish a preferred page from its translations.

      A canonical URL for the page is the preferred URL to specify for a set of pages with similar or identical content. The canonical URL is used to inform search engines that several URLs point to the same page. It is also used to generate the URLs for site maps, the URLs that social bookmarks publish (Twitter, Facebook links, etc.), and the URLs in sent email. For more information, see https://support.google.com/webmasters/answer/139394?hl=en.

      Parameters:
      completeURL - the complete URL of the page
      themeDisplay - the theme display
      layout - the page being requested (optionally null). If null is specified, the current page is used.
      Returns:
      the canonical URL for the page
      Throws:
      PortalException - if a portal exception occurred
    • getCanonicalURL

      public static String getCanonicalURL(String completeURL, ThemeDisplay themeDisplay, Layout layout, boolean forceLayoutFriendlyURL) throws PortalException
      Returns the canonical URL of the page, optionally including the page's friendly URL. The canonical URL is often used to distinguish a preferred page from its translations.

      A canonical URL for the page is the preferred URL to specify for a set of pages with similar or identical content. The canonical URL is used to inform search engines that several URLs point to the same page. It is also used to generate the URLs for site maps, the URLs that social bookmarks publish (Twitter, Facebook links, etc.), and the URLs in sent email. For more information, see https://support.google.com/webmasters/answer/139394?hl=en.

      Parameters:
      completeURL - the complete URL of the page
      themeDisplay - the current theme display
      layout - the page. If it is null, then it is generated for the current page.
      forceLayoutFriendlyURL - whether to add the page's friendly URL to the canonical URL
      Returns:
      the canonical URL of the page
      Throws:
      PortalException - if a portal exception occurred
    • getCanonicalURL

      public static String getCanonicalURL(String completeURL, ThemeDisplay themeDisplay, Layout layout, boolean forceLayoutFriendlyURL, boolean includeQueryString) throws PortalException
      Returns the canonical URL of the page. The canonical URL is often used to distinguish a preferred page from its translations.

      A page's canonical URL is the preferred URL to specify for a set of pages with similar or identical content. The canonical URL is used to inform search engines that several URLs point to the same page. It is also used to generate the URLs for site maps, the URLs that social bookmarks publish (Twitter, Facebook links, etc.), and the URLs in sent email. For more information, see https://support.google.com/webmasters/answer/139394?hl=en.

      Parameters:
      completeURL - the complete URL of the page
      themeDisplay - the theme display
      layout - the page being requested (optionally null). If null is specified, the current page is used.
      forceLayoutFriendlyURL - whether to add the page's friendly URL to the canonical URL
      includeQueryString - whether to add the URL query string to the canonical URL
      Returns:
      the canonical URL
      Throws:
      PortalException - if a portal exception occurred
    • getCDNHost

      public static String getCDNHost(boolean secure)
      Returns the secure (HTTPS) or insecure (HTTP) content distribution network (CDN) host address for this portal.
      Parameters:
      secure - whether to get the secure CDN host address
      Returns:
      the CDN host address
    • getCDNHost

      public static String getCDNHost(javax.servlet.http.HttpServletRequest httpServletRequest) throws PortalException
      Throws:
      PortalException
    • getCDNHostHttp

      public static String getCDNHostHttp(long companyId)
      Returns the insecure (HTTP) content distribution network (CDN) host address
      Parameters:
      companyId - the company ID of a site
      Returns:
      the CDN host address
    • getCDNHostHttps

      public static String getCDNHostHttps(long companyId)
      Returns the secure (HTTPS) content distribution network (CDN) host address
      Parameters:
      companyId - the company ID of a site
      Returns:
      the CDN host address
    • getClassName

      public static String getClassName(long classNameId)
      Returns the fully qualified name of the class from its ID.
      Parameters:
      classNameId - the ID of the class
      Returns:
      the fully qualified name of the class
    • getClassNameId

      public static long getClassNameId(Class<?> clazz)
      Returns the ID of the class from its class object.
      Parameters:
      clazz - the class object
      Returns:
      the ID of the class
    • getClassNameId

      public static long getClassNameId(String value)
      Returns the ID of the class from its fully qualified name.
      Parameters:
      value - the fully qualified name of the class
      Returns:
      the ID of the class
    • getCompany

      public static Company getCompany(javax.servlet.http.HttpServletRequest httpServletRequest) throws PortalException
      Throws:
      PortalException
    • getCompany

      public static Company getCompany(PortletRequest portletRequest) throws PortalException
      Throws:
      PortalException
    • getCompanyId

      public static long getCompanyId(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getCompanyId

      public static long getCompanyId(PortletRequest portletRequest)
    • getCompanyIds

      public static long[] getCompanyIds()
    • getComputerAddresses

      public static Set<String> getComputerAddresses()
    • getComputerName

      public static String getComputerName()
    • getControlPanelFullURL

      public static String getControlPanelFullURL(long scopeGroupId, String ppid, Map<String,String[]> params) throws PortalException
      Throws:
      PortalException
    • getControlPanelPlid

      public static long getControlPanelPlid(long companyId) throws PortalException
      Throws:
      PortalException
    • getControlPanelPlid

      public static long getControlPanelPlid(PortletRequest portletRequest) throws PortalException
      Throws:
      PortalException
    • getControlPanelPortletURL

      public static PortletURL getControlPanelPortletURL(javax.servlet.http.HttpServletRequest httpServletRequest, Group group, String portletId, long refererGroupId, long refererPlid, String lifecycle)
    • getControlPanelPortletURL

      public static PortletURL getControlPanelPortletURL(javax.servlet.http.HttpServletRequest httpServletRequest, String portletId, String lifecycle)
    • getControlPanelPortletURL

      public static PortletURL getControlPanelPortletURL(PortletRequest portletRequest, Group group, String portletId, long refererGroupId, long refererPlid, String lifecycle)
    • getControlPanelPortletURL

      public static PortletURL getControlPanelPortletURL(PortletRequest portletRequest, String portletId, String lifecycle)
    • getCreateAccountURL

      public static String getCreateAccountURL(javax.servlet.http.HttpServletRequest httpServletRequest, ThemeDisplay themeDisplay) throws Exception
      Throws:
      Exception
    • getCurrentAndAncestorSiteGroupIds

      public static long[] getCurrentAndAncestorSiteGroupIds(long groupId)
    • getCurrentAndAncestorSiteGroupIds

      public static long[] getCurrentAndAncestorSiteGroupIds(long groupId, boolean checkContentSharingWithChildrenEnabled)
    • getCurrentAndAncestorSiteGroupIds

      public static long[] getCurrentAndAncestorSiteGroupIds(long[] groupIds)
    • getCurrentAndAncestorSiteGroupIds

      public static long[] getCurrentAndAncestorSiteGroupIds(long[] groupIds, boolean checkContentSharingWithChildrenEnabled)
    • getCurrentAndAncestorSiteGroups

      public static List<Group> getCurrentAndAncestorSiteGroups(long groupId, boolean checkContentSharingWithChildrenEnabled)
    • getCurrentAndAncestorSiteGroups

      public static List<Group> getCurrentAndAncestorSiteGroups(long[] groupIds, boolean checkContentSharingWithChildrenEnabled)
    • getCurrentCompleteURL

      public static String getCurrentCompleteURL(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getCurrentURL

      public static String getCurrentURL(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getCurrentURL

      public static String getCurrentURL(PortletRequest portletRequest)
    • getCustomSQLFunctionIsNotNull

      public static String getCustomSQLFunctionIsNotNull()
    • getCustomSQLFunctionIsNull

      public static String getCustomSQLFunctionIsNull()
    • getDate

      public static Date getDate(int month, int day, int year)
      Returns the date object for the specified month, day, and year, or null if the date is invalid.
      Parameters:
      month - the month (0-based, meaning 0 for January)
      day - the day of the month
      year - the year
      Returns:
      the date object, or null if the date is invalid
    • getDate

      public static Date getDate(int month, int day, int year, Class<? extends PortalException> clazz) throws PortalException
      Returns the date object for the specified month, day, and year, optionally throwing an exception if the date is invalid.
      Parameters:
      month - the month (0-based, meaning 0 for January)
      day - the day of the month
      year - the year
      clazz - the exception class to throw if the date is invalid. If null, no exception will be thrown for an invalid date.
      Returns:
      the date object, or null if the date is invalid and no exception to throw was provided
      Throws:
      PortalException - if a portal exception occurred
    • getDate

      public static Date getDate(int month, int day, int year, int hour, int min, Class<? extends PortalException> clazz) throws PortalException
      Returns the date object for the specified month, day, year, hour, and minute, optionally throwing an exception if the date is invalid.
      Parameters:
      month - the month (0-based, meaning 0 for January)
      day - the day of the month
      year - the year
      hour - the hour (0-24)
      min - the minute of the hour
      clazz - the exception class to throw if the date is invalid. If null, no exception will be thrown for an invalid date.
      Returns:
      the date object, or null if the date is invalid and no exception to throw was provided
      Throws:
      PortalException - if a portal exception occurred
    • getDate

      public static Date getDate(int month, int day, int year, int hour, int min, TimeZone timeZone, Class<? extends PortalException> clazz) throws PortalException
      Returns the date object for the specified month, day, year, hour, minute, and time zone, optionally throwing an exception if the date is invalid.
      Parameters:
      month - the month (0-based, meaning 0 for January)
      day - the day of the month
      year - the year
      hour - the hour (0-24)
      min - the minute of the hour
      timeZone - the time zone of the date
      clazz - the exception class to throw if the date is invalid. If null, no exception will be thrown for an invalid date.
      Returns:
      the date object, or null if the date is invalid and no exception to throw was provided
      Throws:
      PortalException - if a portal exception occurred
    • getDate

      public static Date getDate(int month, int day, int year, TimeZone timeZone, Class<? extends PortalException> clazz) throws PortalException
      Returns the date object for the specified month, day, year, and time zone, optionally throwing an exception if the date is invalid.
      Parameters:
      month - the month (0-based, meaning 0 for January)
      day - the day of the month
      year - the year
      timeZone - the time zone of the date
      clazz - the exception class to throw if the date is invalid. If null, no exception will be thrown for an invalid date.
      Returns:
      the date object, or null if the date is invalid and no exception to throw was provided
      Throws:
      PortalException - if a portal exception occurred
    • getDefaultCompanyId

      public static long getDefaultCompanyId()
    • getEmailFromAddress

      public static String getEmailFromAddress(PortletPreferences portletPreferences, long companyId, String defaultValue)
    • getEmailFromName

      public static String getEmailFromName(PortletPreferences portletPreferences, long companyId, String defaultValue)
    • getForwardedHost

      public static String getForwardedHost(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getForwardedPort

      public static int getForwardedPort(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getFullName

      public static String getFullName(String firstName, String middleName, String lastName)
    • getGoogleGadgetURL

      public static String getGoogleGadgetURL(Portlet portlet, ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getGroupFriendlyURL

      public static String getGroupFriendlyURL(LayoutSet layoutSet, ThemeDisplay themeDisplay, boolean canonicalURL, boolean controlPanel) throws PortalException
      Throws:
      PortalException
    • getGroupFriendlyURL

      public static String getGroupFriendlyURL(LayoutSet layoutSet, ThemeDisplay themeDisplay, Locale locale) throws PortalException
      Throws:
      PortalException
    • getGroupFriendlyURLIndex

      public static int[] getGroupFriendlyURLIndex(String requestURI)
    • getHomeURL

      public static String getHomeURL(javax.servlet.http.HttpServletRequest httpServletRequest) throws PortalException
      Throws:
      PortalException
    • getHost

      public static String getHost(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getHost

      public static String getHost(PortletRequest portletRequest)
    • getHttpServletRequest

      public static javax.servlet.http.HttpServletRequest getHttpServletRequest(PortletRequest portletRequest)
    • getHttpServletResponse

      public static javax.servlet.http.HttpServletResponse getHttpServletResponse(PortletResponse portletResponse)
    • getI18nPathLanguageId

      public static String getI18nPathLanguageId(Locale locale, String defaultI18nPathLanguageId)
    • getJsSafePortletId

      public static String getJsSafePortletId(String portletId)
    • getLayoutActualURL

      public static String getLayoutActualURL(Layout layout)
    • getLayoutActualURL

      public static String getLayoutActualURL(Layout layout, String mainPath)
    • getLayoutActualURL

      public static String getLayoutActualURL(long groupId, boolean privateLayout, String mainPath, String friendlyURL, Map<String,String[]> params, Map<String,Object> requestContext) throws PortalException
      Throws:
      PortalException
    • getLayoutFriendlyURL

      public static String getLayoutFriendlyURL(Layout layout, ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getLayoutFriendlyURL

      public static String getLayoutFriendlyURL(Layout layout, ThemeDisplay themeDisplay, Locale locale) throws PortalException
      Throws:
      PortalException
    • getLayoutFriendlyURL

      public static String getLayoutFriendlyURL(ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getLayoutFriendlyURLSeparatorComposite

      public static LayoutFriendlyURLSeparatorComposite getLayoutFriendlyURLSeparatorComposite(long groupId, boolean privateLayout, String friendlyURL, Map<String,String[]> params, Map<String,Object> requestContext) throws PortalException
      Throws:
      PortalException
    • getLayoutFullURL

      public static String getLayoutFullURL(Layout layout, ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getLayoutFullURL

      public static String getLayoutFullURL(Layout layout, ThemeDisplay themeDisplay, boolean doAsUser) throws PortalException
      Throws:
      PortalException
    • getLayoutFullURL

      public static String getLayoutFullURL(long groupId, String portletId) throws PortalException
      Throws:
      PortalException
    • getLayoutFullURL

      public static String getLayoutFullURL(long groupId, String portletId, boolean secure) throws PortalException
      Throws:
      PortalException
    • getLayoutFullURL

      public static String getLayoutFullURL(ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getLayoutRelativeURL

      public static String getLayoutRelativeURL(Layout layout, ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getLayoutRelativeURL

      public static String getLayoutRelativeURL(Layout layout, ThemeDisplay themeDisplay, boolean doAsUser) throws PortalException
      Throws:
      PortalException
    • getLayoutSetDisplayURL

      public static String getLayoutSetDisplayURL(LayoutSet layoutSet, boolean secureConnection) throws PortalException
      Throws:
      PortalException
    • getLayoutSetFriendlyURL

      public static String getLayoutSetFriendlyURL(LayoutSet layoutSet, ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getLayoutTarget

      public static String getLayoutTarget(Layout layout)
    • getLayoutURL

      public static String getLayoutURL(Layout layout, ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getLayoutURL

      public static String getLayoutURL(Layout layout, ThemeDisplay themeDisplay, boolean doAsUser) throws PortalException
      Throws:
      PortalException
    • getLayoutURL

      public static String getLayoutURL(Layout layout, ThemeDisplay themeDisplay, Locale locale) throws PortalException
      Throws:
      PortalException
    • getLayoutURL

      public static String getLayoutURL(ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getLiferayPortletRequest

      public static LiferayPortletRequest getLiferayPortletRequest(PortletRequest portletRequest)
    • getLiferayPortletResponse

      public static LiferayPortletResponse getLiferayPortletResponse(PortletResponse portletResponse)
    • getLocale

      public static Locale getLocale(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getLocale

      public static Locale getLocale(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, boolean initialize)
    • getLocale

      public static Locale getLocale(PortletRequest portletRequest)
    • getMailId

      public static String getMailId(String mx, String popPortletPrefix, Object... ids)
    • getNetvibesURL

      public static String getNetvibesURL(Portlet portlet, ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getNewPortletTitle

      public static String getNewPortletTitle(String portletTitle, String oldScopeName, String newScopeName)
    • getOriginalServletRequest

      public static javax.servlet.http.HttpServletRequest getOriginalServletRequest(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getPathContext

      public static String getPathContext()
    • getPathContext

      public static String getPathContext(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getPathContext

      public static String getPathContext(PortletRequest portletRequest)
    • getPathContext

      public static String getPathContext(String contextPath)
    • getPathFriendlyURLPrivateGroup

      public static String getPathFriendlyURLPrivateGroup()
    • getPathFriendlyURLPrivateUser

      public static String getPathFriendlyURLPrivateUser()
    • getPathFriendlyURLPublic

      public static String getPathFriendlyURLPublic()
    • getPathImage

      public static String getPathImage()
    • getPathMain

      public static String getPathMain()
    • getPathModule

      public static String getPathModule()
    • getPathProxy

      public static String getPathProxy()
    • getPlidFromFriendlyURL

      public static long getPlidFromFriendlyURL(long companyId, String friendlyURL)
    • getPlidFromPortletId

      public static long getPlidFromPortletId(long groupId, boolean privateLayout, String portletId) throws PortalException
      Throws:
      PortalException
    • getPlidFromPortletId

      public static long getPlidFromPortletId(long groupId, String portletId) throws PortalException
      Throws:
      PortalException
    • getPortal

      public static Portal getPortal()
    • getPortalLocalPort

      public static int getPortalLocalPort(boolean secure)
    • getPortalProperties

      public static Properties getPortalProperties()
    • getPortalServerPort

      public static int getPortalServerPort(boolean secure)
    • getPortalURL

      public static String getPortalURL(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getPortalURL

      public static String getPortalURL(javax.servlet.http.HttpServletRequest httpServletRequest, boolean secure)
    • getPortalURL

      public static String getPortalURL(Layout layout, ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getPortalURL

      public static String getPortalURL(LayoutSet layoutSet, ThemeDisplay themeDisplay)
    • getPortalURL

      public static String getPortalURL(PortletRequest portletRequest)
    • getPortalURL

      public static String getPortalURL(PortletRequest portletRequest, boolean secure)
    • getPortalURL

      public static String getPortalURL(String serverName, int serverPort, boolean secure)
    • getPortalURL

      public static String getPortalURL(ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getPortletConfig

      public static PortletConfig getPortletConfig(long companyId, String portletId, javax.servlet.ServletContext servletContext) throws PortletException
      Throws:
      PortletException
    • getPortletDescription

      public static String getPortletDescription(Portlet portlet, javax.servlet.ServletContext servletContext, Locale locale)
    • getPortletDescription

      public static String getPortletDescription(Portlet portlet, User user)
    • getPortletDescription

      public static String getPortletDescription(String portletId, Locale locale)
    • getPortletDescription

      public static String getPortletDescription(String portletId, String languageId)
    • getPortletDescription

      public static String getPortletDescription(String portletId, User user)
    • getPortletId

      public static String getPortletId(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getPortletId

      public static String getPortletId(PortletRequest portletRequest)
    • getPortletLongTitle

      public static String getPortletLongTitle(Portlet portlet, javax.servlet.ServletContext servletContext, Locale locale)
    • getPortletLongTitle

      public static String getPortletLongTitle(String portletId, Locale locale)
    • getPortletNamespace

      public static String getPortletNamespace(String portletId)
    • getPortletTitle

      public static String getPortletTitle(Portlet portlet, Locale locale)
    • getPortletTitle

      public static String getPortletTitle(Portlet portlet, javax.servlet.ServletContext servletContext, Locale locale)
    • getPortletTitle

      public static String getPortletTitle(Portlet portlet, String languageId)
    • getPortletTitle

      public static String getPortletTitle(Portlet portlet, User user)
    • getPortletTitle

      public static String getPortletTitle(PortletRequest portletRequest)
    • getPortletTitle

      public static String getPortletTitle(PortletResponse portletResponse)
    • getPortletTitle

      public static String getPortletTitle(String portletId, Locale locale)
    • getPortletTitle

      public static String getPortletTitle(String portletId, ResourceBundle resourceBundle)
    • getPortletTitle

      public static String getPortletTitle(String portletId, String languageId)
    • getPortletTitle

      public static String getPortletTitle(String portletId, User user)
    • getPreferences

      public static PortletPreferences getPreferences(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getPreferencesValidator

      public static PreferencesValidator getPreferencesValidator(Portlet portlet)
    • getRelativeHomeURL

      public static String getRelativeHomeURL(javax.servlet.http.HttpServletRequest httpServletRequest) throws PortalException
      Throws:
      PortalException
    • getResourceBundle

      public static ResourceBundle getResourceBundle(Locale locale)
    • getScopeGroupId

      public static long getScopeGroupId(javax.servlet.http.HttpServletRequest httpServletRequest) throws PortalException
      Throws:
      PortalException
    • getScopeGroupId

      public static long getScopeGroupId(javax.servlet.http.HttpServletRequest httpServletRequest, String portletId) throws PortalException
      Throws:
      PortalException
    • getScopeGroupId

      public static long getScopeGroupId(javax.servlet.http.HttpServletRequest httpServletRequest, String portletId, boolean checkStagingGroup) throws PortalException
      Throws:
      PortalException
    • getScopeGroupId

      public static long getScopeGroupId(Layout layout)
    • getScopeGroupId

      public static long getScopeGroupId(Layout layout, String portletId)
    • getScopeGroupId

      public static long getScopeGroupId(long plid)
    • getScopeGroupId

      public static long getScopeGroupId(PortletRequest portletRequest) throws PortalException
      Throws:
      PortalException
    • getSelectedUser

      public static User getSelectedUser(javax.servlet.http.HttpServletRequest httpServletRequest) throws PortalException
      Throws:
      PortalException
    • getSelectedUser

      public static User getSelectedUser(javax.servlet.http.HttpServletRequest httpServletRequest, boolean checkPermission) throws PortalException
      Throws:
      PortalException
    • getSelectedUser

      public static User getSelectedUser(PortletRequest portletRequest) throws PortalException
      Throws:
      PortalException
    • getSelectedUser

      public static User getSelectedUser(PortletRequest portletRequest, boolean checkPermission) throws PortalException
      Throws:
      PortalException
    • getServletContextName

      public static String getServletContextName()
    • getSharedContentSiteGroupIds

      public static long[] getSharedContentSiteGroupIds(long companyId, long groupId, long userId) throws PortalException
      Throws:
      PortalException
    • getSiteAdminURL

      public static String getSiteAdminURL(ThemeDisplay themeDisplay, String ppid, Map<String,String[]> params) throws PortalException
      Throws:
      PortalException
    • getSiteDefaultLocale

      public static Locale getSiteDefaultLocale(Group group) throws PortalException
      Throws:
      PortalException
    • getSiteDefaultLocale

      public static Locale getSiteDefaultLocale(long groupId) throws PortalException
      Throws:
      PortalException
    • getSiteGroupId

      public static long getSiteGroupId(long scopeGroupId)
    • getSiteLoginURL

      public static String getSiteLoginURL(ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • getStaticResourceURL

      public static String getStaticResourceURL(javax.servlet.http.HttpServletRequest httpServletRequest, String uri)
    • getStaticResourceURL

      public static String getStaticResourceURL(javax.servlet.http.HttpServletRequest httpServletRequest, String uri, long timestamp)
    • getStaticResourceURL

      public static String getStaticResourceURL(javax.servlet.http.HttpServletRequest httpServletRequest, String uri, String queryString)
    • getStaticResourceURL

      public static String getStaticResourceURL(javax.servlet.http.HttpServletRequest httpServletRequest, String uri, String queryString, long timestamp)
    • getStrutsAction

      public static String getStrutsAction(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getSystemGroups

      public static String[] getSystemGroups()
    • getSystemOrganizationRoles

      public static String[] getSystemOrganizationRoles()
    • getSystemRoles

      public static String[] getSystemRoles()
    • getSystemSiteRoles

      public static String[] getSystemSiteRoles()
    • getUniqueElementId

      public static String getUniqueElementId(javax.servlet.http.HttpServletRequest httpServletRequest, String namespace, String id)
    • getUniqueElementId

      public static String getUniqueElementId(PortletRequest request, String namespace, String id)
    • getUploadPortletRequest

      public static UploadPortletRequest getUploadPortletRequest(PortletRequest portletRequest)
    • getUploadServletRequest

      public static UploadServletRequest getUploadServletRequest(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getUploadServletRequest

      public static UploadServletRequest getUploadServletRequest(javax.servlet.http.HttpServletRequest httpServletRequest, int fileSizeThreshold, String location)
    • getUptime

      public static Date getUptime()
    • getURLWithSessionId

      public static String getURLWithSessionId(String url, String sessionId)
    • getUser

      public static User getUser(javax.servlet.http.HttpServletRequest httpServletRequest) throws PortalException
      Throws:
      PortalException
    • getUser

      public static User getUser(PortletRequest portletRequest) throws PortalException
      Throws:
      PortalException
    • getUserEmailAddress

      public static String getUserEmailAddress(long userId)
    • getUserId

      public static long getUserId(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getUserId

      public static long getUserId(PortletRequest portletRequest)
    • getUserName

      public static String getUserName(BaseModel<?> baseModel)
    • getUserName

      public static String getUserName(long userId, String defaultUserName)
    • getUserName

      public static String getUserName(long userId, String defaultUserName, javax.servlet.http.HttpServletRequest httpServletRequest)
    • getUserName

      public static String getUserName(long userId, String defaultUserName, String userAttribute)
    • getUserName

      public static String getUserName(long userId, String defaultUserName, String userAttribute, javax.servlet.http.HttpServletRequest httpServletRequest)
    • getUserPassword

      public static String getUserPassword(javax.servlet.http.HttpServletRequest httpServletRequest)
    • getUserPassword

      public static String getUserPassword(javax.servlet.http.HttpSession httpSession)
    • getUserPassword

      public static String getUserPassword(PortletRequest portletRequest)
    • getValidPortalDomain

      public static String getValidPortalDomain(long companyId, String domain)
    • getValidUserId

      public static long getValidUserId(long companyId, long userId) throws PortalException
      Throws:
      PortalException
    • getVirtualHostnames

      public static TreeMap<String,String> getVirtualHostnames(LayoutSet layoutSet)
    • getWidgetURL

      public static String getWidgetURL(Portlet portlet, ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • initUser

      public static User initUser(javax.servlet.http.HttpServletRequest httpServletRequest) throws Exception
      Throws:
      Exception
    • isCDNDynamicResourcesEnabled

      public static boolean isCDNDynamicResourcesEnabled(javax.servlet.http.HttpServletRequest httpServletRequest) throws PortalException
      Throws:
      PortalException
    • isCDNDynamicResourcesEnabled

      public static boolean isCDNDynamicResourcesEnabled(long companyId)
    • isCompanyAdmin

      public static boolean isCompanyAdmin(User user) throws Exception
      Throws:
      Exception
    • isCustomPortletMode

      public static boolean isCustomPortletMode(PortletMode portletMode)
    • isForwardedSecure

      public static boolean isForwardedSecure(javax.servlet.http.HttpServletRequest httpServletRequest)
    • isGroupAdmin

      public static boolean isGroupAdmin(User user, long groupId) throws Exception
      Throws:
      Exception
    • isGroupControlPanelPath

      public static boolean isGroupControlPanelPath(String path)
    • isGroupFriendlyURL

      public static boolean isGroupFriendlyURL(String fullURL, String groupFriendlyURL, String layoutFriendlyURL)
    • isGroupOwner

      public static boolean isGroupOwner(User user, long groupId) throws Exception
      Throws:
      Exception
    • isLayoutDescendant

      public static boolean isLayoutDescendant(Layout layout, long layoutId) throws PortalException
      Throws:
      PortalException
    • isLayoutSitemapable

      public static boolean isLayoutSitemapable(Layout layout)
    • isLoginRedirectRequired

      public static boolean isLoginRedirectRequired(javax.servlet.http.HttpServletRequest httpServletRequest)
    • isMultipartRequest

      public static boolean isMultipartRequest(javax.servlet.http.HttpServletRequest httpServletRequest)
    • isOmniadmin

      public static boolean isOmniadmin(long userId)
    • isOmniadmin

      public static boolean isOmniadmin(User user)
    • isReservedParameter

      public static boolean isReservedParameter(String name)
    • isRightToLeft

      public static boolean isRightToLeft(javax.servlet.http.HttpServletRequest httpServletRequest)
    • isRSSFeedsEnabled

      public static boolean isRSSFeedsEnabled()
    • isSecure

      public static boolean isSecure(javax.servlet.http.HttpServletRequest httpServletRequest)
    • isSkipPortletContentRendering

      public static boolean isSkipPortletContentRendering(Group group, LayoutTypePortlet layoutTypePortlet, PortletDisplay portletDisplay, String portletName)
    • isSystemGroup

      public static boolean isSystemGroup(String groupName)
    • isSystemRole

      public static boolean isSystemRole(String roleName)
    • isValidPortalDomain

      public static boolean isValidPortalDomain(long companyId, String domain)
    • isValidResourceId

      public static boolean isValidResourceId(String resourceId)
    • resetCDNHosts

      public static void resetCDNHosts()
    • sendError

      public static void sendError(Exception exception, ActionRequest actionRequest, ActionResponse actionResponse) throws IOException
      Throws:
      IOException
    • sendError

      public static void sendError(Exception exception, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • sendError

      public static void sendError(int status, Exception exception, ActionRequest actionRequest, ActionResponse actionResponse) throws IOException
      Throws:
      IOException
    • sendError

      public static void sendError(int status, Exception exception, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • sendRSSFeedsDisabledError

      public static void sendRSSFeedsDisabledError(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • sendRSSFeedsDisabledError

      public static void sendRSSFeedsDisabledError(PortletRequest portletRequest, PortletResponse portletResponse) throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • setPageDescription

      public static void setPageDescription(String description, javax.servlet.http.HttpServletRequest httpServletRequest)
      Sets the description for a page. This overrides the existing page description.
    • setPageKeywords

      public static void setPageKeywords(String keywords, javax.servlet.http.HttpServletRequest httpServletRequest)
      Sets the keywords for a page. This overrides the existing page keywords.
    • setPageSubtitle

      public static void setPageSubtitle(String subtitle, javax.servlet.http.HttpServletRequest httpServletRequest)
      Sets the subtitle for a page. This overrides the existing page subtitle.
    • setPageTitle

      public static void setPageTitle(String title, javax.servlet.http.HttpServletRequest httpServletRequest)
      Sets the whole title for a page. This overrides the existing page whole title.
    • setPortalInetSocketAddresses

      public static void setPortalInetSocketAddresses(javax.servlet.http.HttpServletRequest httpServletRequest)
    • stripURLAnchor

      public static String[] stripURLAnchor(String url, String separator)
    • transformCustomSQL

      public static String transformCustomSQL(String sql)
    • transformSQL

      public static String transformSQL(String sql)
    • updateImageId

      public static void updateImageId(BaseModel<?> baseModel, boolean hasImage, byte[] bytes, String fieldName, long maxSize, int maxHeight, int maxWidth) throws PortalException
      Throws:
      PortalException
    • updatePortletMode

      public static PortletMode updatePortletMode(String portletId, User user, Layout layout, PortletMode portletMode, javax.servlet.http.HttpServletRequest httpServletRequest) throws PortalException
      Throws:
      PortalException
    • updateRedirect

      public static String updateRedirect(String redirect, String oldPath, String newPath)
    • updateWindowState

      public static WindowState updateWindowState(String portletId, User user, Layout layout, WindowState windowState, javax.servlet.http.HttpServletRequest httpServletRequest)
    • setPortal

      public void setPortal(Portal portal)