001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.util;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.db.DB;
020    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
021    import com.liferay.portal.kernel.exception.PortalException;
022    import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
023    import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
024    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
025    import com.liferay.portal.kernel.servlet.taglib.ui.BreadcrumbEntry;
026    import com.liferay.portal.kernel.upload.UploadPortletRequest;
027    import com.liferay.portal.kernel.upload.UploadServletRequest;
028    import com.liferay.portal.model.BaseModel;
029    import com.liferay.portal.model.Company;
030    import com.liferay.portal.model.Group;
031    import com.liferay.portal.model.Layout;
032    import com.liferay.portal.model.LayoutFriendlyURLComposite;
033    import com.liferay.portal.model.LayoutQueryStringComposite;
034    import com.liferay.portal.model.LayoutSet;
035    import com.liferay.portal.model.Portlet;
036    import com.liferay.portal.model.ResourcePermission;
037    import com.liferay.portal.model.User;
038    import com.liferay.portal.service.PortletLocalServiceUtil;
039    import com.liferay.portal.theme.ThemeDisplay;
040    import com.liferay.portlet.InvokerPortlet;
041    import com.liferay.portlet.PortletInstanceFactoryUtil;
042    import com.liferay.portlet.expando.model.ExpandoBridge;
043    
044    import java.io.IOException;
045    import java.io.Serializable;
046    
047    import java.net.InetAddress;
048    
049    import java.sql.SQLException;
050    
051    import java.util.Date;
052    import java.util.List;
053    import java.util.Locale;
054    import java.util.Map;
055    import java.util.Properties;
056    import java.util.ResourceBundle;
057    import java.util.Set;
058    import java.util.TimeZone;
059    
060    import javax.portlet.ActionRequest;
061    import javax.portlet.ActionResponse;
062    import javax.portlet.PortletConfig;
063    import javax.portlet.PortletException;
064    import javax.portlet.PortletMode;
065    import javax.portlet.PortletPreferences;
066    import javax.portlet.PortletRequest;
067    import javax.portlet.PortletResponse;
068    import javax.portlet.PortletURL;
069    import javax.portlet.PreferencesValidator;
070    import javax.portlet.RenderRequest;
071    import javax.portlet.ResourceRequest;
072    import javax.portlet.ResourceResponse;
073    import javax.portlet.ValidatorException;
074    import javax.portlet.WindowState;
075    
076    import javax.servlet.ServletContext;
077    import javax.servlet.ServletException;
078    import javax.servlet.http.HttpServletRequest;
079    import javax.servlet.http.HttpServletResponse;
080    import javax.servlet.http.HttpSession;
081    
082    /**
083     * @author Brian Wing Shun Chan
084     * @author Eduardo Lundgren
085     * @author Juan Fern??ndez
086     */
087    @ProviderType
088    public class PortalUtil {
089    
090            /**
091             * Appends the description to the current meta description of the page in
092             * the request.
093             *
094             * @param description the description to append to the current meta
095             *        description
096             * @param request the servlet request for the page
097             */
098            public static void addPageDescription(
099                    String description, HttpServletRequest request) {
100    
101                    getPortal().addPageDescription(description, request);
102            }
103    
104            /**
105             * Appends the keywords to the current meta keywords of the page in the
106             * request.
107             *
108             * @param keywords the keywords to add to the current meta keywords
109             *        (comma-separated)
110             * @param request the servlet request for the page
111             */
112            public static void addPageKeywords(
113                    String keywords, HttpServletRequest request) {
114    
115                    getPortal().addPageKeywords(keywords, request);
116            }
117    
118            /**
119             * Appends the subtitle to the current subtitle of the page in the request.
120             *
121             * @param subtitle the subtitle to append to the current subtitle
122             * @param request the servlet request for the page
123             */
124            public static void addPageSubtitle(
125                    String subtitle, HttpServletRequest request) {
126    
127                    getPortal().addPageSubtitle(subtitle, request);
128            }
129    
130            /**
131             * Appends the title to the current title of the page in the request.
132             *
133             * @param title the title to append to the current title
134             * @param request the servlet request for the page
135             */
136            public static void addPageTitle(String title, HttpServletRequest request) {
137                    getPortal().addPageTitle(title, request);
138            }
139    
140            public static boolean addPortalInetSocketAddressEventListener(
141                    PortalInetSocketAddressEventListener
142                            portalInetSocketAddressEventListener) {
143    
144                    return getPortal().addPortalInetSocketAddressEventListener(
145                            portalInetSocketAddressEventListener);
146            }
147    
148            /**
149             * Adds the portal port event listener to the portal. The listener is
150             * notified whenever the portal port is set.
151             *
152             * @param      portalPortEventListener the portal port event listener to add
153             * @deprecated As of 7.0.0, replaced by {@link
154             *             #addPortalInetSocketAddressEventListener(
155             *             PortalInetSocketAddressEventListener)}
156             */
157            @Deprecated
158            public static void addPortalPortEventListener(
159                    PortalPortEventListener portalPortEventListener) {
160    
161                    getPortal().addPortalPortEventListener(portalPortEventListener);
162            }
163    
164            /**
165             * Adds an entry to the portlet breadcrumbs for the page in the request.
166             *
167             * @param request the servlet request for the page
168             * @param title the title of the new breadcrumb entry
169             * @param url the URL of the new breadcrumb entry
170             */
171            public static void addPortletBreadcrumbEntry(
172                    HttpServletRequest request, String title, String url) {
173    
174                    getPortal().addPortletBreadcrumbEntry(request, title, url);
175            }
176    
177            /**
178             * Adds an entry to the portlet breadcrumbs for the page in the request.
179             *
180             * @param request the servlet request for the page
181             * @param title the title of the new breadcrumb entry
182             * @param url the URL of the new breadcrumb entry
183             * @param data the HTML5 data parameters of the new breadcrumb entry
184             */
185            public static void addPortletBreadcrumbEntry(
186                    HttpServletRequest request, String title, String url,
187                    Map<String, Object> data) {
188    
189                    getPortal().addPortletBreadcrumbEntry(request, title, url, data);
190            }
191    
192            /**
193             * Adds the default resource permissions for the portlet to the page in the
194             * request.
195             *
196             * @param request the servlet request for the page
197             * @param portlet the portlet
198             */
199            public static void addPortletDefaultResource(
200                            HttpServletRequest request, Portlet portlet)
201                    throws PortalException {
202    
203                    getPortal().addPortletDefaultResource(request, portlet);
204            }
205    
206            public static void addPortletDefaultResource(
207                            long companyId, Layout layout, Portlet portlet)
208                    throws PortalException {
209    
210                    getPortal().addPortletDefaultResource(companyId, layout, portlet);
211            }
212    
213            /**
214             * Adds the preserved parameters doAsGroupId and refererPlid to the URL,
215             * optionally adding doAsUserId and doAsUserLanguageId as well.
216             *
217             * <p>
218             * Preserved parameters are parameters that should be sent with every
219             * request as the user navigates the portal.
220             * </p>
221             *
222             * @param  themeDisplay the current theme display
223             * @param  layout the current page
224             * @param  url the URL
225             * @param  doAsUser whether to include doAsUserId and doAsLanguageId in the
226             *         URL if they are available. If <code>false</code>, doAsUserId and
227             *         doAsUserLanguageId will never be added.
228             * @return the URL with the preserved parameters added
229             */
230            public static String addPreservedParameters(
231                    ThemeDisplay themeDisplay, Layout layout, String url,
232                    boolean doAsUser) {
233    
234                    return getPortal().addPreservedParameters(
235                            themeDisplay, layout, url, doAsUser);
236            }
237    
238            /**
239             * Adds the preserved parameters doAsUserId, doAsUserLanguageId,
240             * doAsGroupId, and refererPlid to the URL.
241             *
242             * @param  themeDisplay the current theme display
243             * @param  url the URL
244             * @return the URL with the preserved parameters added
245             */
246            public static String addPreservedParameters(
247                    ThemeDisplay themeDisplay, String url) {
248    
249                    return getPortal().addPreservedParameters(themeDisplay, url);
250            }
251    
252            public static void addUserLocaleOptionsMessage(HttpServletRequest request) {
253                    getPortal().addUserLocaleOptionsMessage(request);
254            }
255    
256            /**
257             * Clears the render parameters in the request if the portlet is in the
258             * action phase.
259             *
260             * @param renderRequest the render request
261             */
262            public static void clearRequestParameters(RenderRequest renderRequest) {
263                    getPortal().clearRequestParameters(renderRequest);
264            }
265    
266            /**
267             * Copies the request parameters to the render parameters, unless a
268             * parameter with that name already exists in the render parameters.
269             *
270             * @param actionRequest the request from which to get the request parameters
271             * @param actionResponse the response to receive the render parameters
272             */
273            public static void copyRequestParameters(
274                    ActionRequest actionRequest, ActionResponse actionResponse) {
275    
276                    getPortal().copyRequestParameters(actionRequest, actionResponse);
277            }
278    
279            /**
280             * Escapes the URL for use in a redirect and checks that security settings
281             * allow the URL is allowed for redirects.
282             *
283             * @param  url the URL to escape
284             * @return the escaped URL, or <code>null</code> if the URL is not allowed
285             *         for redirects
286             */
287            public static String escapeRedirect(String url) {
288                    return getPortal().escapeRedirect(url);
289            }
290    
291            /**
292             * Generates a random key to identify the request based on the input string.
293             *
294             * @param  request the servlet request for the page
295             * @param  input the input string
296             * @return the generated key
297             */
298            public static String generateRandomKey(
299                    HttpServletRequest request, String input) {
300    
301                    return getPortal().generateRandomKey(request, input);
302            }
303    
304            public static String getAbsoluteURL(
305                    HttpServletRequest request, String url) {
306    
307                    return getPortal().getAbsoluteURL(request, url);
308            }
309    
310            public static LayoutQueryStringComposite
311                            getActualLayoutQueryStringComposite(
312                                    long groupId, boolean privateLayout, String friendlyURL,
313                                    Map<String, String[]> params,
314                                    Map<String, Object> requestContext)
315                    throws PortalException {
316    
317                    return getPortal().getActualLayoutQueryStringComposite(
318                            groupId, privateLayout, friendlyURL, params, requestContext);
319            }
320    
321            public static String getActualURL(
322                            long groupId, boolean privateLayout, String mainPath,
323                            String friendlyURL, Map<String, String[]> params,
324                            Map<String, Object> requestContext)
325                    throws PortalException {
326    
327                    return getPortal().getActualURL(
328                            groupId, privateLayout, mainPath, friendlyURL, params,
329                            requestContext);
330            }
331    
332            /**
333             * Returns the alternate URL for the requested canonical URL in the given
334             * locale.
335             *
336             * <p>
337             * The alternate URL lets search engines know that an equivalent page is
338             * available for the given locale. For more information, see <a
339             * href="https://support.google.com/webmasters/answer/189077?hl=en">https://support.google.com/webmasters/answer/189077?hl=en</a>.
340             * </p>
341             *
342             * @param  canonicalURL the canonical URL being requested. For more
343             *         information, see {@link #getCanonicalURL}.
344             * @param  themeDisplay the theme display
345             * @param  locale the locale of the alternate URL being generated
346             * @param  layout the page being requested
347             * @return the alternate URL for the requested canonical URL in the given
348             *         locale
349             */
350            public static String getAlternateURL(
351                            String canonicalURL, ThemeDisplay themeDisplay, Locale locale,
352                            Layout layout)
353                    throws PortalException {
354    
355                    return getPortal().getAlternateURL(
356                            canonicalURL, themeDisplay, locale, layout);
357            }
358    
359            public static long[] getAncestorSiteGroupIds(long groupId)
360                    throws PortalException {
361    
362                    return getPortal().getAncestorSiteGroupIds(groupId);
363            }
364    
365            /**
366             * @deprecated As of 6.2.0, replaced by {@link
367             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletCSRFWhitelistActions}
368             */
369            @Deprecated
370            public static Set<String> getAuthTokenIgnoreActions() {
371                    return getPortal().getAuthTokenIgnoreActions();
372            }
373    
374            /**
375             * @deprecated As of 6.2.0, replaced by {@link
376             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletCSRFWhitelist}
377             */
378            @Deprecated
379            public static Set<String> getAuthTokenIgnorePortlets() {
380                    return getPortal().getAuthTokenIgnorePortlets();
381            }
382    
383            /**
384             * Returns the base model instance for the resource permission.
385             *
386             * @param  resourcePermission the resource permission
387             * @return the base model instance, or <code>null</code> if the resource
388             *         permission does not have a base model instance (such as if it's a
389             *         portlet)
390             */
391            public static BaseModel<?> getBaseModel(
392                            ResourcePermission resourcePermission)
393                    throws PortalException {
394    
395                    return getPortal().getBaseModel(resourcePermission);
396            }
397    
398            /**
399             * Returns the base model instance for the model name and primary key.
400             *
401             * @param  modelName the fully qualified class name of the model
402             * @param  primKey the primary key of the model instance to get
403             * @return the base model instance, or <code>null</code> if the model does
404             *         not have a base model instance (such as if it's a portlet)
405             */
406            public static BaseModel<?> getBaseModel(String modelName, String primKey)
407                    throws PortalException {
408    
409                    return getPortal().getBaseModel(modelName, primKey);
410            }
411    
412            /**
413             * @deprecated As of 7.0.0, replaced by {@link
414             *             com.liferay.portal.kernel.security.auth.http.HttpAuthManagerUtil#getBasicUserId(
415             *             HttpServletRequest)}
416             */
417            @Deprecated
418            public static long getBasicAuthUserId(HttpServletRequest request)
419                    throws PortalException {
420    
421                    return getPortal().getBasicAuthUserId(request);
422            }
423    
424            /**
425             * @deprecated As of 7.0.0, replaced by {@link
426             *             com.liferay.portal.kernel.security.auth.http.HttpAuthManagerUtil#getBasicUserId(
427             *             HttpServletRequest)}
428             */
429            @Deprecated
430            public static long getBasicAuthUserId(
431                            HttpServletRequest request, long companyId)
432                    throws PortalException {
433    
434                    return getPortal().getBasicAuthUserId(request, companyId);
435            }
436    
437            public static List<Group> getBrowsableScopeGroups(
438                            long userId, long companyId, long groupId, String portletId)
439                    throws PortalException {
440    
441                    return getPortal().getBrowsableScopeGroups(
442                            userId, companyId, groupId, portletId);
443            }
444    
445            /**
446             * Returns the canonical URL for the page. The canonical URL is often used
447             * to distinguish a preferred page from its translations.
448             *
449             * <p>
450             * A canonical URL for the page is the preferred URL to specify for a set of
451             * pages with similar or identical content. The canonical URL is used to
452             * inform search engines that several URLs point to the same page. It is
453             * also used to generate the URLs for site maps, the URLs that social
454             * bookmarks publish (Twitter, Facebook links, etc.), and the URLs in sent
455             * email. For more information, see <a
456             * href="https://support.google.com/webmasters/answer/139394?hl=en">https://support.google.com/webmasters/answer/139394?hl=en</a>.
457             * </p>
458             *
459             * @param  completeURL the complete URL of the page
460             * @param  themeDisplay the theme display
461             * @param  layout the page being requested (optionally <code>null</code>).
462             *         If <code>null</code> is specified, the current page is used.
463             * @return the canonical URL for the page
464             */
465            public static String getCanonicalURL(
466                            String completeURL, ThemeDisplay themeDisplay, Layout layout)
467                    throws PortalException {
468    
469                    return getPortal().getCanonicalURL(completeURL, themeDisplay, layout);
470            }
471    
472            /**
473             * Returns the canonical URL of the page, optionally including the page's
474             * friendly URL. The canonical URL is often used to distinguish a preferred
475             * page from its translations.
476             *
477             * <p>
478             * A canonical URL for the page is the preferred URL to specify for a set of
479             * pages with similar or identical content. The canonical URL is used to
480             * inform search engines that several URLs point to the same page. It is
481             * also used to generate the URLs for site maps, the URLs that social
482             * bookmarks publish (Twitter, Facebook links, etc.), and the URLs in sent
483             * email. For more information, see <a
484             * href="https://support.google.com/webmasters/answer/139394?hl=en">https://support.google.com/webmasters/answer/139394?hl=en</a>.
485             * </p>
486             *
487             * @param  completeURL the complete URL of the page
488             * @param  themeDisplay the current theme display
489             * @param  layout the page. If it is <code>null</code>, then it is generated
490             *         for the current page.
491             * @param  forceLayoutFriendlyURL whether to add the page's friendly URL to
492             *         the canonical URL
493             * @return the canonical URL of the page
494             */
495            public static String getCanonicalURL(
496                            String completeURL, ThemeDisplay themeDisplay, Layout layout,
497                            boolean forceLayoutFriendlyURL)
498                    throws PortalException {
499    
500                    return getPortal().getCanonicalURL(
501                            completeURL, themeDisplay, layout, forceLayoutFriendlyURL);
502            }
503    
504            /**
505             * @deprecated As of 6.1.0, replaced by {@link #getCDNHost(boolean)}
506             */
507            @Deprecated
508            public static String getCDNHost() {
509                    return getPortal().getCDNHost();
510            }
511    
512            /**
513             * Returns the secure (HTTPS) or insecure (HTTP) content distribution
514             * network (CDN) host address for this portal.
515             *
516             * @param  secure whether to get the secure CDN host address
517             * @return the CDN host address
518             */
519            public static String getCDNHost(boolean secure) {
520                    return getPortal().getCDNHost(secure);
521            }
522    
523            public static String getCDNHost(HttpServletRequest request)
524                    throws PortalException {
525    
526                    return getPortal().getCDNHost(request);
527            }
528    
529            /**
530             * Returns the insecure (HTTP) content distribution network (CDN) host
531             * address
532             *
533             * @param  companyId the company ID of a site
534             * @return the CDN host address
535             */
536            public static String getCDNHostHttp(long companyId) {
537                    return getPortal().getCDNHostHttp(companyId);
538            }
539    
540            /**
541             * Returns the secure (HTTPS) content distribution network (CDN) host
542             * address
543             *
544             * @param  companyId the company ID of a site
545             * @return the CDN host address
546             */
547            public static String getCDNHostHttps(long companyId) {
548                    return getPortal().getCDNHostHttps(companyId);
549            }
550    
551            /**
552             * Returns the fully qualified name of the class from its ID.
553             *
554             * @param  classNameId the ID of the class
555             * @return the fully qualified name of the class
556             */
557            public static String getClassName(long classNameId) {
558                    return getPortal().getClassName(classNameId);
559            }
560    
561            /**
562             * Returns the ID of the class from its class object.
563             *
564             * @param  clazz the class object
565             * @return the ID of the class
566             */
567            public static long getClassNameId(Class<?> clazz) {
568                    return getPortal().getClassNameId(clazz);
569            }
570    
571            /**
572             * Returns the ID of the class from its fully qualified name.
573             *
574             * @param  value the fully qualified name of the class
575             * @return the ID of the class
576             */
577            public static long getClassNameId(String value) {
578                    return getPortal().getClassNameId(value);
579            }
580    
581            public static Company getCompany(HttpServletRequest request)
582                    throws PortalException {
583    
584                    return getPortal().getCompany(request);
585            }
586    
587            public static Company getCompany(PortletRequest portletRequest)
588                    throws PortalException {
589    
590                    return getPortal().getCompany(portletRequest);
591            }
592    
593            public static long getCompanyId(HttpServletRequest request) {
594                    return getPortal().getCompanyId(request);
595            }
596    
597            public static long getCompanyId(PortletRequest portletRequest) {
598                    return getPortal().getCompanyId(portletRequest);
599            }
600    
601            public static long[] getCompanyIds() {
602                    return getPortal().getCompanyIds();
603            }
604    
605            public static Set<String> getComputerAddresses() {
606                    return getPortal().getComputerAddresses();
607            }
608    
609            public static String getComputerName() {
610                    return getPortal().getComputerName();
611            }
612    
613            public static String getControlPanelFullURL(
614                            long scopeGroupId, String ppid, Map<String, String[]> params)
615                    throws PortalException {
616    
617                    return getPortal().getControlPanelFullURL(scopeGroupId, ppid, params);
618            }
619    
620            public static long getControlPanelPlid(long companyId)
621                    throws PortalException {
622    
623                    return getPortal().getControlPanelPlid(companyId);
624            }
625    
626            public static long getControlPanelPlid(PortletRequest portletRequest)
627                    throws PortalException {
628    
629                    return getPortal().getControlPanelPlid(portletRequest);
630            }
631    
632            public static PortletURL getControlPanelPortletURL(
633                    HttpServletRequest request, Group group, String portletId,
634                    long refererGroupId, long refererPlid, String lifecycle) {
635    
636                    return getPortal().getControlPanelPortletURL(
637                            request, group, portletId, refererGroupId, refererPlid, lifecycle);
638            }
639    
640            public static PortletURL getControlPanelPortletURL(
641                    HttpServletRequest request, String portletId, String lifecycle) {
642    
643                    return getPortal().getControlPanelPortletURL(
644                            request, portletId, lifecycle);
645            }
646    
647            public static PortletURL getControlPanelPortletURL(
648                    PortletRequest portletRequest, Group group, String portletId,
649                    long refererGroupId, long refererPlid, String lifecycle) {
650    
651                    return getPortal().getControlPanelPortletURL(
652                            portletRequest, group, portletId, refererGroupId, refererPlid,
653                            lifecycle);
654            }
655    
656            public static PortletURL getControlPanelPortletURL(
657                    PortletRequest portletRequest, String portletId, String lifecycle) {
658    
659                    return getPortal().getControlPanelPortletURL(
660                            portletRequest, portletId, lifecycle);
661            }
662    
663            public static String getCreateAccountURL(
664                            HttpServletRequest request, ThemeDisplay themeDisplay)
665                    throws Exception {
666    
667                    return getPortal().getCreateAccountURL(request, themeDisplay);
668            }
669    
670            public static long[] getCurrentAndAncestorSiteGroupIds(long groupId)
671                    throws PortalException {
672    
673                    return getPortal().getCurrentAndAncestorSiteGroupIds(groupId);
674            }
675    
676            public static long[] getCurrentAndAncestorSiteGroupIds(
677                            long groupId, boolean checkContentSharingWithChildrenEnabled)
678                    throws PortalException {
679    
680                    return getPortal().getCurrentAndAncestorSiteGroupIds(
681                            groupId, checkContentSharingWithChildrenEnabled);
682            }
683    
684            public static long[] getCurrentAndAncestorSiteGroupIds(long[] groupIds)
685                    throws PortalException {
686    
687                    return getPortal().getCurrentAndAncestorSiteGroupIds(groupIds);
688            }
689    
690            public static long[] getCurrentAndAncestorSiteGroupIds(
691                            long[] groupIds, boolean checkContentSharingWithChildrenEnabled)
692                    throws PortalException {
693    
694                    return getPortal().getCurrentAndAncestorSiteGroupIds(
695                            groupIds, checkContentSharingWithChildrenEnabled);
696            }
697    
698            public static List<Group> getCurrentAndAncestorSiteGroups(long groupId)
699                    throws PortalException {
700    
701                    return getPortal().getCurrentAndAncestorSiteGroups(groupId);
702            }
703    
704            public static List<Group> getCurrentAndAncestorSiteGroups(
705                            long groupId, boolean checkContentSharingWithChildrenEnabled)
706                    throws PortalException {
707    
708                    return getPortal().getCurrentAndAncestorSiteGroups(
709                            groupId, checkContentSharingWithChildrenEnabled);
710            }
711    
712            public static List<Group> getCurrentAndAncestorSiteGroups(long[] groupIds)
713                    throws PortalException {
714    
715                    return getPortal().getCurrentAndAncestorSiteGroups(groupIds);
716            }
717    
718            public static List<Group> getCurrentAndAncestorSiteGroups(
719                            long[] groupIds, boolean checkContentSharingWithChildrenEnabled)
720                    throws PortalException {
721    
722                    return getPortal().getCurrentAndAncestorSiteGroups(
723                            groupIds, checkContentSharingWithChildrenEnabled);
724            }
725    
726            public static String getCurrentCompleteURL(HttpServletRequest request) {
727                    return getPortal().getCurrentCompleteURL(request);
728            }
729    
730            public static String getCurrentURL(HttpServletRequest request) {
731                    return getPortal().getCurrentURL(request);
732            }
733    
734            public static String getCurrentURL(PortletRequest portletRequest) {
735                    return getPortal().getCurrentURL(portletRequest);
736            }
737    
738            public static String getCustomSQLFunctionIsNotNull() {
739                    return getPortal().getCustomSQLFunctionIsNotNull();
740            }
741    
742            public static String getCustomSQLFunctionIsNull() {
743                    return getPortal().getCustomSQLFunctionIsNull();
744            }
745    
746            /**
747             * Returns the date object for the specified month, day, and year, or
748             * <code>null</code> if the date is invalid.
749             *
750             * @param  month the month (0-based, meaning 0 for January)
751             * @param  day the day of the month
752             * @param  year the year
753             * @return the date object, or <code>null</code> if the date is invalid
754             */
755            public static Date getDate(int month, int day, int year) {
756                    return getPortal().getDate(month, day, year);
757            }
758    
759            /**
760             * Returns the date object for the specified month, day, and year,
761             * optionally throwing an exception if the date is invalid.
762             *
763             * @param  month the month (0-based, meaning 0 for January)
764             * @param  day the day of the month
765             * @param  year the year
766             * @param  clazz the exception class to throw if the date is invalid. If
767             *         <code>null</code>, no exception will be thrown for an invalid
768             *         date.
769             * @return the date object, or <code>null</code> if the date is invalid and
770             *         no exception to throw was provided
771             */
772            public static Date getDate(
773                            int month, int day, int year,
774                            Class<? extends PortalException> clazz)
775                    throws PortalException {
776    
777                    return getPortal().getDate(month, day, year, clazz);
778            }
779    
780            /**
781             * Returns the date object for the specified month, day, year, hour, and
782             * minute, optionally throwing an exception if the date is invalid.
783             *
784             * @param  month the month (0-based, meaning 0 for January)
785             * @param  day the day of the month
786             * @param  year the year
787             * @param  hour the hour (0-24)
788             * @param  min the minute of the hour
789             * @param  clazz the exception class to throw if the date is invalid. If
790             *         <code>null</code>, no exception will be thrown for an invalid
791             *         date.
792             * @return the date object, or <code>null</code> if the date is invalid and
793             *         no exception to throw was provided
794             */
795            public static Date getDate(
796                            int month, int day, int year, int hour, int min,
797                            Class<? extends PortalException> clazz)
798                    throws PortalException {
799    
800                    return getPortal().getDate(month, day, year, hour, min, clazz);
801            }
802    
803            /**
804             * Returns the date object for the specified month, day, year, hour, minute,
805             * and time zone, optionally throwing an exception if the date is invalid.
806             *
807             * @param  month the month (0-based, meaning 0 for January)
808             * @param  day the day of the month
809             * @param  year the year
810             * @param  hour the hour (0-24)
811             * @param  min the minute of the hour
812             * @param  timeZone the time zone of the date
813             * @param  clazz the exception class to throw if the date is invalid. If
814             *         <code>null</code>, no exception will be thrown for an invalid
815             *         date.
816             * @return the date object, or <code>null</code> if the date is invalid and
817             *         no exception to throw was provided
818             */
819            public static Date getDate(
820                            int month, int day, int year, int hour, int min, TimeZone timeZone,
821                            Class<? extends PortalException> clazz)
822                    throws PortalException {
823    
824                    return getPortal().getDate(
825                            month, day, year, hour, min, timeZone, clazz);
826            }
827    
828            /**
829             * Returns the date object for the specified month, day, year, and time
830             * zone, optionally throwing an exception if the date is invalid.
831             *
832             * @param  month the month (0-based, meaning 0 for January)
833             * @param  day the day of the month
834             * @param  year the year
835             * @param  timeZone the time zone of the date
836             * @param  clazz the exception class to throw if the date is invalid. If
837             *         <code>null</code>, no exception will be thrown for an invalid
838             *         date.
839             * @return the date object, or <code>null</code> if the date is invalid and
840             *         no exception to throw was provided
841             */
842            public static Date getDate(
843                            int month, int day, int year, TimeZone timeZone,
844                            Class<? extends PortalException> clazz)
845                    throws PortalException {
846    
847                    return getPortal().getDate(month, day, year, timeZone, clazz);
848            }
849    
850            /**
851             * @deprecated As of 6.1.0, replaced by {@link DBManagerUtil#getDB()}
852             */
853            @Deprecated
854            public static DB getDB() {
855                    return DBManagerUtil.getDB();
856            }
857    
858            public static long getDefaultCompanyId() {
859                    return getPortal().getDefaultCompanyId();
860            }
861    
862            /**
863             * @deprecated As of 7.0.0, replaced by {@link
864             *             com.liferay.portal.kernel.security.auth.http.HttpAuthManagerUtil#getDigestUserId(
865             *             HttpServletRequest)}
866             */
867            @Deprecated
868            public static long getDigestAuthUserId(HttpServletRequest request)
869                    throws PortalException {
870    
871                    return getPortal().getDigestAuthUserId(request);
872            }
873    
874            public static String getEmailFromAddress(
875                    PortletPreferences preferences, long companyId, String defaultValue) {
876    
877                    return getPortal().getEmailFromAddress(
878                            preferences, companyId, defaultValue);
879            }
880    
881            public static String getEmailFromName(
882                    PortletPreferences preferences, long companyId, String defaultValue) {
883    
884                    return getPortal().getEmailFromName(
885                            preferences, companyId, defaultValue);
886            }
887    
888            public static Map<String, Serializable> getExpandoBridgeAttributes(
889                            ExpandoBridge expandoBridge, HttpServletRequest request)
890                    throws PortalException {
891    
892                    return getPortal().getExpandoBridgeAttributes(expandoBridge, request);
893            }
894    
895            public static Map<String, Serializable> getExpandoBridgeAttributes(
896                            ExpandoBridge expandoBridge, PortletRequest portletRequest)
897                    throws PortalException {
898    
899                    return getPortal().getExpandoBridgeAttributes(
900                            expandoBridge, portletRequest);
901            }
902    
903            public static Map<String, Serializable> getExpandoBridgeAttributes(
904                            ExpandoBridge expandoBridge,
905                            UploadPortletRequest uploadPortletRequest)
906                    throws PortalException {
907    
908                    return getPortal().getExpandoBridgeAttributes(
909                            expandoBridge, uploadPortletRequest);
910            }
911    
912            public static Serializable getExpandoValue(
913                            HttpServletRequest request, String name, int type,
914                            String displayType)
915                    throws PortalException {
916    
917                    return getPortal().getExpandoValue(request, name, type, displayType);
918            }
919    
920            public static Serializable getExpandoValue(
921                            PortletRequest portletRequest, String name, int type,
922                            String displayType)
923                    throws PortalException {
924    
925                    return getPortal().getExpandoValue(
926                            portletRequest, name, type, displayType);
927            }
928    
929            public static Serializable getExpandoValue(
930                            UploadPortletRequest uploadPortletRequest, String name, int type,
931                            String displayType)
932                    throws PortalException {
933    
934                    return getPortal().getExpandoValue(
935                            uploadPortletRequest, name, type, displayType);
936            }
937    
938            public static String getFacebookURL(
939                            Portlet portlet, String facebookCanvasPageURL,
940                            ThemeDisplay themeDisplay)
941                    throws PortalException {
942    
943                    return getPortal().getFacebookURL(
944                            portlet, facebookCanvasPageURL, themeDisplay);
945            }
946    
947            public static String getFirstPageLayoutTypes(HttpServletRequest request) {
948                    return getPortal().getFirstPageLayoutTypes(request);
949            }
950    
951            public static String getFullName(
952                    String firstName, String middleName, String lastName) {
953    
954                    return getPortal().getFullName(firstName, middleName, lastName);
955            }
956    
957            public static String getGlobalLibDir() {
958                    return getPortal().getGlobalLibDir();
959            }
960    
961            public static String getGoogleGadgetURL(
962                            Portlet portlet, ThemeDisplay themeDisplay)
963                    throws PortalException {
964    
965                    return getPortal().getGoogleGadgetURL(portlet, themeDisplay);
966            }
967    
968            public static String getGroupFriendlyURL(
969                            LayoutSet layoutSet, ThemeDisplay themeDisplay)
970                    throws PortalException {
971    
972                    return getPortal().getGroupFriendlyURL(layoutSet, themeDisplay);
973            }
974    
975            public static String getGroupFriendlyURL(
976                            LayoutSet layoutSet, ThemeDisplay themeDisplay, Locale locale)
977                    throws PortalException {
978    
979                    return getPortal().getGroupFriendlyURL(layoutSet, themeDisplay, locale);
980            }
981    
982            public static int[] getGroupFriendlyURLIndex(String requestURI) {
983                    return getPortal().getGroupFriendlyURLIndex(requestURI);
984            }
985    
986            public static String[] getGroupPermissions(HttpServletRequest request) {
987                    return getPortal().getGroupPermissions(request);
988            }
989    
990            public static String[] getGroupPermissions(
991                    HttpServletRequest request, String className) {
992    
993                    return getPortal().getGroupPermissions(request, className);
994            }
995    
996            public static String[] getGroupPermissions(PortletRequest portletRequest) {
997                    return getPortal().getGroupPermissions(portletRequest);
998            }
999    
1000            public static String[] getGroupPermissions(
1001                    PortletRequest portletRequest, String className) {
1002    
1003                    return getPortal().getGroupPermissions(portletRequest, className);
1004            }
1005    
1006            public static String[] getGuestPermissions(HttpServletRequest request) {
1007                    return getPortal().getGuestPermissions(request);
1008            }
1009    
1010            public static String[] getGuestPermissions(
1011                    HttpServletRequest request, String className) {
1012    
1013                    return getPortal().getGuestPermissions(request, className);
1014            }
1015    
1016            public static String[] getGuestPermissions(PortletRequest portletRequest) {
1017                    return getPortal().getGuestPermissions(portletRequest);
1018            }
1019    
1020            public static String[] getGuestPermissions(
1021                    PortletRequest portletRequest, String className) {
1022    
1023                    return getPortal().getGuestPermissions(portletRequest, className);
1024            }
1025    
1026            public static String getHomeURL(HttpServletRequest request)
1027                    throws PortalException {
1028    
1029                    return getPortal().getHomeURL(request);
1030            }
1031    
1032            public static String getHost(HttpServletRequest request) {
1033                    return getPortal().getHost(request);
1034            }
1035    
1036            public static String getHost(PortletRequest portletRequest) {
1037                    return getPortal().getHost(portletRequest);
1038            }
1039    
1040            public static HttpServletRequest getHttpServletRequest(
1041                    PortletRequest portletRequest) {
1042    
1043                    return getPortal().getHttpServletRequest(portletRequest);
1044            }
1045    
1046            public static HttpServletResponse getHttpServletResponse(
1047                    PortletResponse portletResponse) {
1048    
1049                    return getPortal().getHttpServletResponse(portletResponse);
1050            }
1051    
1052            public static String getI18nPathLanguageId(
1053                    Locale locale, String defaultI18nPathLanguageId) {
1054    
1055                    return getPortal().getI18nPathLanguageId(
1056                            locale, defaultI18nPathLanguageId);
1057            }
1058    
1059            /**
1060             * @deprecated As of 7.0.0, with no direct replacement
1061             */
1062            @Deprecated
1063            public static String getJournalArticleActualURL(
1064                            long groupId, boolean privateLayout, String mainPath,
1065                            String friendlyURL, Map<String, String[]> params,
1066                            Map<String, Object> requestContext)
1067                    throws PortalException {
1068    
1069                    return getPortal().getJournalArticleActualURL(
1070                            groupId, privateLayout, mainPath, friendlyURL, params,
1071                            requestContext);
1072            }
1073    
1074            /**
1075             * @deprecated As of 7.0.0, with no direct replacement
1076             */
1077            @Deprecated
1078            public static Layout getJournalArticleLayout(
1079                            long groupId, boolean privateLayout, String friendlyURL)
1080                    throws PortalException {
1081    
1082                    return getPortal().getJournalArticleLayout(
1083                            groupId, privateLayout, friendlyURL);
1084            }
1085    
1086            public static String getJsSafePortletId(String portletId) {
1087                    return getPortal().getJsSafePortletId(portletId);
1088            }
1089    
1090            public static String getLayoutActualURL(Layout layout) {
1091                    return getPortal().getLayoutActualURL(layout);
1092            }
1093    
1094            public static String getLayoutActualURL(Layout layout, String mainPath) {
1095                    return getPortal().getLayoutActualURL(layout, mainPath);
1096            }
1097    
1098            public static String getLayoutActualURL(
1099                            long groupId, boolean privateLayout, String mainPath,
1100                            String friendlyURL)
1101                    throws PortalException {
1102    
1103                    return getPortal().getLayoutActualURL(
1104                            groupId, privateLayout, mainPath, friendlyURL);
1105            }
1106    
1107            public static String getLayoutActualURL(
1108                            long groupId, boolean privateLayout, String mainPath,
1109                            String friendlyURL, Map<String, String[]> params,
1110                            Map<String, Object> requestContext)
1111                    throws PortalException {
1112    
1113                    return getPortal().getLayoutActualURL(
1114                            groupId, privateLayout, mainPath, friendlyURL, params,
1115                            requestContext);
1116            }
1117    
1118            public static String getLayoutFriendlyURL(
1119                            Layout layout, ThemeDisplay themeDisplay)
1120                    throws PortalException {
1121    
1122                    return getPortal().getLayoutFriendlyURL(layout, themeDisplay);
1123            }
1124    
1125            public static String getLayoutFriendlyURL(
1126                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
1127                    throws PortalException {
1128    
1129                    return getPortal().getLayoutFriendlyURL(layout, themeDisplay, locale);
1130            }
1131    
1132            public static LayoutFriendlyURLComposite getLayoutFriendlyURLComposite(
1133                            long groupId, boolean privateLayout, String friendlyURL,
1134                            Map<String, String[]> params, Map<String, Object> requestContext)
1135                    throws PortalException {
1136    
1137                    return getPortal().getLayoutFriendlyURLComposite(
1138                            groupId, privateLayout, friendlyURL, params, requestContext);
1139            }
1140    
1141            public static String getLayoutFullURL(
1142                            Layout layout, ThemeDisplay themeDisplay)
1143                    throws PortalException {
1144    
1145                    return getPortal().getLayoutFullURL(layout, themeDisplay);
1146            }
1147    
1148            public static String getLayoutFullURL(
1149                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
1150                    throws PortalException {
1151    
1152                    return getPortal().getLayoutFullURL(layout, themeDisplay, doAsUser);
1153            }
1154    
1155            public static String getLayoutFullURL(long groupId, String portletId)
1156                    throws PortalException {
1157    
1158                    return getPortal().getLayoutFullURL(groupId, portletId);
1159            }
1160    
1161            public static String getLayoutFullURL(
1162                            long groupId, String portletId, boolean secure)
1163                    throws PortalException {
1164    
1165                    return getPortal().getLayoutFullURL(groupId, portletId, secure);
1166            }
1167    
1168            public static String getLayoutFullURL(ThemeDisplay themeDisplay)
1169                    throws PortalException {
1170    
1171                    return getPortal().getLayoutFullURL(themeDisplay);
1172            }
1173    
1174            public static String getLayoutRelativeURL(
1175                            Layout layout, ThemeDisplay themeDisplay)
1176                    throws PortalException {
1177    
1178                    return getPortal().getLayoutRelativeURL(layout, themeDisplay);
1179            }
1180    
1181            public static String getLayoutRelativeURL(
1182                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
1183                    throws PortalException {
1184    
1185                    return getPortal().getLayoutRelativeURL(layout, themeDisplay, doAsUser);
1186            }
1187    
1188            public static String getLayoutSetDisplayURL(
1189                            LayoutSet layoutSet, boolean secureConnection)
1190                    throws PortalException {
1191    
1192                    return getPortal().getLayoutSetDisplayURL(layoutSet, secureConnection);
1193            }
1194    
1195            public static String getLayoutSetFriendlyURL(
1196                            LayoutSet layoutSet, ThemeDisplay themeDisplay)
1197                    throws PortalException {
1198    
1199                    return getPortal().getLayoutSetFriendlyURL(layoutSet, themeDisplay);
1200            }
1201    
1202            public static String getLayoutTarget(Layout layout) {
1203                    return getPortal().getLayoutTarget(layout);
1204            }
1205    
1206            public static String getLayoutURL(Layout layout, ThemeDisplay themeDisplay)
1207                    throws PortalException {
1208    
1209                    return getPortal().getLayoutURL(layout, themeDisplay);
1210            }
1211    
1212            public static String getLayoutURL(
1213                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
1214                    throws PortalException {
1215    
1216                    return getPortal().getLayoutURL(layout, themeDisplay, doAsUser);
1217            }
1218    
1219            public static String getLayoutURL(
1220                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
1221                    throws PortalException {
1222    
1223                    return getPortal().getLayoutURL(layout, themeDisplay, locale);
1224            }
1225    
1226            public static String getLayoutURL(ThemeDisplay themeDisplay)
1227                    throws PortalException {
1228    
1229                    return getPortal().getLayoutURL(themeDisplay);
1230            }
1231    
1232            public static LiferayPortletRequest getLiferayPortletRequest(
1233                    PortletRequest portletRequest) {
1234    
1235                    return getPortal().getLiferayPortletRequest(portletRequest);
1236            }
1237    
1238            public static LiferayPortletResponse getLiferayPortletResponse(
1239                    PortletResponse portletResponse) {
1240    
1241                    return getPortal().getLiferayPortletResponse(portletResponse);
1242            }
1243    
1244            public static Locale getLocale(HttpServletRequest request) {
1245                    return getPortal().getLocale(request);
1246            }
1247    
1248            public static Locale getLocale(
1249                    HttpServletRequest request, HttpServletResponse response,
1250                    boolean initialize) {
1251    
1252                    return getPortal().getLocale(request, response, initialize);
1253            }
1254    
1255            public static Locale getLocale(PortletRequest portletRequest) {
1256                    return getPortal().getLocale(portletRequest);
1257            }
1258    
1259            public static String getLocalizedFriendlyURL(
1260                            HttpServletRequest request, Layout layout, Locale locale,
1261                            Locale originalLocale)
1262                    throws Exception {
1263    
1264                    return getPortal().getLocalizedFriendlyURL(
1265                            request, layout, locale, originalLocale);
1266            }
1267    
1268            public static String getMailId(
1269                    String mx, String popPortletPrefix, Object... ids) {
1270    
1271                    return getPortal().getMailId(mx, popPortletPrefix, ids);
1272            }
1273    
1274            /**
1275             * @deprecated As of 6.1.0, replaced by {@link
1276             *             #getBaseModel(ResourcePermission)}
1277             */
1278            @Deprecated
1279            public static BaseModel<?> getModel(ResourcePermission resourcePermission)
1280                    throws PortalException {
1281    
1282                    return getPortal().getBaseModel(resourcePermission);
1283            }
1284    
1285            /**
1286             * @deprecated As of 6.1.0, replaced by {@link #getBaseModel(String,
1287             *             String)}
1288             */
1289            @Deprecated
1290            public static BaseModel<?> getModel(String modelName, String primKey)
1291                    throws PortalException {
1292    
1293                    return getPortal().getBaseModel(modelName, primKey);
1294            }
1295    
1296            public static String getNetvibesURL(
1297                            Portlet portlet, ThemeDisplay themeDisplay)
1298                    throws PortalException {
1299    
1300                    return getPortal().getNetvibesURL(portlet, themeDisplay);
1301            }
1302    
1303            public static String getNewPortletTitle(
1304                    String portletTitle, String oldScopeName, String newScopeName) {
1305    
1306                    return getPortal().getNewPortletTitle(
1307                            portletTitle, oldScopeName, newScopeName);
1308            }
1309    
1310            public static HttpServletRequest getOriginalServletRequest(
1311                    HttpServletRequest request) {
1312    
1313                    return getPortal().getOriginalServletRequest(request);
1314            }
1315    
1316            /**
1317             * @deprecated As of 6.2.0 renamed to {@link #getSiteGroupId(long)}
1318             */
1319            @Deprecated
1320            public static long getParentGroupId(long scopeGroupId) {
1321                    return getPortal().getParentGroupId(scopeGroupId);
1322            }
1323    
1324            public static String getPathContext() {
1325                    return getPortal().getPathContext();
1326            }
1327    
1328            public static String getPathContext(HttpServletRequest request) {
1329                    return getPortal().getPathContext(request);
1330            }
1331    
1332            public static String getPathContext(PortletRequest portletRequest) {
1333                    return getPortal().getPathContext(portletRequest);
1334            }
1335    
1336            public static String getPathContext(String contextPath) {
1337                    return getPortal().getPathContext(contextPath);
1338            }
1339    
1340            public static String getPathFriendlyURLPrivateGroup() {
1341                    return getPortal().getPathFriendlyURLPrivateGroup();
1342            }
1343    
1344            public static String getPathFriendlyURLPrivateUser() {
1345                    return getPortal().getPathFriendlyURLPrivateUser();
1346            }
1347    
1348            public static String getPathFriendlyURLPublic() {
1349                    return getPortal().getPathFriendlyURLPublic();
1350            }
1351    
1352            public static String getPathImage() {
1353                    return getPortal().getPathImage();
1354            }
1355    
1356            public static String getPathMain() {
1357                    return getPortal().getPathMain();
1358            }
1359    
1360            public static String getPathModule() {
1361                    return getPortal().getPathModule();
1362            }
1363    
1364            public static String getPathProxy() {
1365                    return getPortal().getPathProxy();
1366            }
1367    
1368            public static long getPlidFromFriendlyURL(
1369                    long companyId, String friendlyURL) {
1370    
1371                    return getPortal().getPlidFromFriendlyURL(companyId, friendlyURL);
1372            }
1373    
1374            public static long getPlidFromPortletId(
1375                            long groupId, boolean privateLayout, String portletId)
1376                    throws PortalException {
1377    
1378                    return getPortal().getPlidFromPortletId(
1379                            groupId, privateLayout, portletId);
1380            }
1381    
1382            public static long getPlidFromPortletId(long groupId, String portletId)
1383                    throws PortalException {
1384    
1385                    return getPortal().getPlidFromPortletId(groupId, portletId);
1386            }
1387    
1388            public static Portal getPortal() {
1389                    PortalRuntimePermission.checkGetBeanProperty(PortalUtil.class);
1390    
1391                    return _portal;
1392            }
1393    
1394            public static PortalInetSocketAddressEventListener[]
1395                    getPortalInetSocketAddressEventListeners() {
1396    
1397                    return getPortal().getPortalInetSocketAddressEventListeners();
1398            }
1399    
1400            public static String getPortalLibDir() {
1401                    return getPortal().getPortalLibDir();
1402            }
1403    
1404            public static InetAddress getPortalLocalInetAddress(boolean secure) {
1405                    return getPortal().getPortalLocalInetAddress(secure);
1406            }
1407    
1408            public static int getPortalLocalPort(boolean secure) {
1409                    return getPortal().getPortalLocalPort(secure);
1410            }
1411    
1412            /**
1413             * @deprecated As of 6.1.0, replaced by {@link #getPortalPort(boolean)}
1414             */
1415            @Deprecated
1416            public static int getPortalPort() {
1417                    return getPortal().getPortalPort();
1418            }
1419    
1420            /**
1421             * @deprecated As of 7.0.0, replaced by {@link
1422             *             #getPortalServerPort(boolean)}
1423             */
1424            @Deprecated
1425            public static int getPortalPort(boolean secure) {
1426                    return getPortal().getPortalPort(secure);
1427            }
1428    
1429            public static Properties getPortalProperties() {
1430                    return getPortal().getPortalProperties();
1431            }
1432    
1433            public static InetAddress getPortalServerInetAddress(boolean secure) {
1434                    return getPortal().getPortalServerInetAddress(secure);
1435            }
1436    
1437            public static int getPortalServerPort(boolean secure) {
1438                    return getPortal().getPortalServerPort(secure);
1439            }
1440    
1441            public static String getPortalURL(HttpServletRequest request) {
1442                    return getPortal().getPortalURL(request);
1443            }
1444    
1445            public static String getPortalURL(
1446                    HttpServletRequest request, boolean secure) {
1447    
1448                    return getPortal().getPortalURL(request, secure);
1449            }
1450    
1451            public static String getPortalURL(Layout layout, ThemeDisplay themeDisplay)
1452                    throws PortalException {
1453    
1454                    return getPortal().getPortalURL(layout, themeDisplay);
1455            }
1456    
1457            public static String getPortalURL(PortletRequest portletRequest) {
1458                    return getPortal().getPortalURL(portletRequest);
1459            }
1460    
1461            public static String getPortalURL(
1462                    PortletRequest portletRequest, boolean secure) {
1463    
1464                    return getPortal().getPortalURL(portletRequest, secure);
1465            }
1466    
1467            public static String getPortalURL(
1468                    String serverName, int serverPort, boolean secure) {
1469    
1470                    return getPortal().getPortalURL(serverName, serverPort, secure);
1471            }
1472    
1473            public static String getPortalURL(ThemeDisplay themeDisplay)
1474                    throws PortalException {
1475    
1476                    return getPortal().getPortalURL(themeDisplay);
1477            }
1478    
1479            public static String getPortalWebDir() {
1480                    return getPortal().getPortalWebDir();
1481            }
1482    
1483            /**
1484             * @deprecated As of 6.2.0 replaced by {@link
1485             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletInvocationWhitelist}
1486             */
1487            @Deprecated
1488            public static Set<String> getPortletAddDefaultResourceCheckWhitelist() {
1489                    return getPortal().getPortletAddDefaultResourceCheckWhitelist();
1490            }
1491    
1492            /**
1493             * @deprecated As of 6.2.0 replaced by {@link
1494             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletInvocationWhitelistActions}
1495             */
1496            @Deprecated
1497            public static Set<String>
1498                    getPortletAddDefaultResourceCheckWhitelistActions() {
1499    
1500                    return getPortal().getPortletAddDefaultResourceCheckWhitelistActions();
1501            }
1502    
1503            /**
1504             * @deprecated As of 6.1.0, replaced by {@link
1505             *             #getPortletBreadcrumbs(HttpServletRequest)}
1506             */
1507            @Deprecated
1508            public static List<BreadcrumbEntry> getPortletBreadcrumbList(
1509                    HttpServletRequest request) {
1510    
1511                    return getPortal().getPortletBreadcrumbList(request);
1512            }
1513    
1514            /**
1515             * @deprecated As of 7.0.0, replaced by {@link
1516             *             com.liferay.portal.kernel.servlet.taglib.ui.BreadcrumbUtil#getPortletBreadcrumbEntries(
1517             *             HttpServletRequest)}
1518             */
1519            @Deprecated
1520            public static List<BreadcrumbEntry> getPortletBreadcrumbs(
1521                    HttpServletRequest request) {
1522    
1523                    return getPortal().getPortletBreadcrumbs(request);
1524            }
1525    
1526            public static PortletConfig getPortletConfig(
1527                            long companyId, String portletId, ServletContext servletContext)
1528                    throws PortletException {
1529    
1530                    Portlet portlet = PortletLocalServiceUtil.getPortletById(
1531                            companyId, portletId);
1532    
1533                    InvokerPortlet invokerPortlet = PortletInstanceFactoryUtil.create(
1534                            portlet, servletContext);
1535    
1536                    return invokerPortlet.getPortletConfig();
1537            }
1538    
1539            public static String getPortletDescription(
1540                    Portlet portlet, ServletContext servletContext, Locale locale) {
1541    
1542                    return getPortal().getPortletDescription(
1543                            portlet, servletContext, locale);
1544            }
1545    
1546            public static String getPortletDescription(Portlet portlet, User user) {
1547                    return getPortal().getPortletDescription(portlet, user);
1548            }
1549    
1550            public static String getPortletDescription(
1551                    String portletId, Locale locale) {
1552    
1553                    return getPortal().getPortletDescription(portletId, locale);
1554            }
1555    
1556            public static String getPortletDescription(
1557                    String portletId, String languageId) {
1558    
1559                    return getPortal().getPortletDescription(portletId, languageId);
1560            }
1561    
1562            public static String getPortletDescription(String portletId, User user) {
1563                    return getPortal().getPortletDescription(portletId, user);
1564            }
1565    
1566            public static String getPortletId(HttpServletRequest request) {
1567                    return getPortal().getPortletId(request);
1568            }
1569    
1570            public static String getPortletId(PortletRequest portletRequest) {
1571                    return getPortal().getPortletId(portletRequest);
1572            }
1573    
1574            public static String getPortletLongTitle(Portlet portlet, Locale locale) {
1575                    return getPortal().getPortletLongTitle(portlet, locale);
1576            }
1577    
1578            public static String getPortletLongTitle(
1579                    Portlet portlet, ServletContext servletContext, Locale locale) {
1580    
1581                    return getPortal().getPortletLongTitle(portlet, servletContext, locale);
1582            }
1583    
1584            public static String getPortletLongTitle(
1585                    Portlet portlet, String languageId) {
1586    
1587                    return getPortal().getPortletLongTitle(portlet, languageId);
1588            }
1589    
1590            public static String getPortletLongTitle(Portlet portlet, User user) {
1591                    return getPortal().getPortletLongTitle(portlet, user);
1592            }
1593    
1594            public static String getPortletLongTitle(String portletId, Locale locale) {
1595                    return getPortal().getPortletLongTitle(portletId, locale);
1596            }
1597    
1598            public static String getPortletLongTitle(
1599                    String portletId, String languageId) {
1600    
1601                    return getPortal().getPortletLongTitle(portletId, languageId);
1602            }
1603    
1604            public static String getPortletLongTitle(String portletId, User user) {
1605                    return getPortal().getPortletLongTitle(portletId, user);
1606            }
1607    
1608            public static String getPortletNamespace(String portletId) {
1609                    return getPortal().getPortletNamespace(portletId);
1610            }
1611    
1612            public static String getPortletTitle(Portlet portlet, Locale locale) {
1613                    return getPortal().getPortletTitle(portlet, locale);
1614            }
1615    
1616            public static String getPortletTitle(
1617                    Portlet portlet, ServletContext servletContext, Locale locale) {
1618    
1619                    return getPortal().getPortletTitle(portlet, servletContext, locale);
1620            }
1621    
1622            public static String getPortletTitle(Portlet portlet, String languageId) {
1623                    return getPortal().getPortletTitle(portlet, languageId);
1624            }
1625    
1626            public static String getPortletTitle(Portlet portlet, User user) {
1627                    return getPortal().getPortletTitle(portlet, user);
1628            }
1629    
1630            public static String getPortletTitle(PortletRequest portletRequest) {
1631                    return getPortal().getPortletTitle(portletRequest);
1632            }
1633    
1634            public static String getPortletTitle(PortletResponse portletResponse) {
1635                    return getPortal().getPortletTitle(portletResponse);
1636            }
1637    
1638            public static String getPortletTitle(String portletId, Locale locale) {
1639                    return getPortal().getPortletTitle(portletId, locale);
1640            }
1641    
1642            public static String getPortletTitle(
1643                    String portletId, ResourceBundle resourceBundle) {
1644    
1645                    return getPortal().getPortletTitle(portletId, resourceBundle);
1646            }
1647    
1648            public static String getPortletTitle(String portletId, String languageId) {
1649                    return getPortal().getPortletTitle(portletId, languageId);
1650            }
1651    
1652            public static String getPortletTitle(String portletId, User user) {
1653                    return getPortal().getPortletTitle(portletId, user);
1654            }
1655    
1656            public static String getPortletXmlFileName() {
1657                    return getPortal().getPortletXmlFileName();
1658            }
1659    
1660            public static PortletPreferences getPreferences(
1661                    HttpServletRequest request) {
1662    
1663                    return getPortal().getPreferences(request);
1664            }
1665    
1666            public static PreferencesValidator getPreferencesValidator(
1667                    Portlet portlet) {
1668    
1669                    return getPortal().getPreferencesValidator(portlet);
1670            }
1671    
1672            public static String getRelativeHomeURL(HttpServletRequest request)
1673                    throws PortalException {
1674    
1675                    return getPortal().getRelativeHomeURL(request);
1676            }
1677    
1678            public static ResourceBundle getResourceBundle(Locale locale) {
1679                    return getPortal().getResourceBundle(locale);
1680            }
1681    
1682            public static long getScopeGroupId(HttpServletRequest request)
1683                    throws PortalException {
1684    
1685                    return getPortal().getScopeGroupId(request);
1686            }
1687    
1688            public static long getScopeGroupId(
1689                            HttpServletRequest request, String portletId)
1690                    throws PortalException {
1691    
1692                    return getPortal().getScopeGroupId(request, portletId);
1693            }
1694    
1695            public static long getScopeGroupId(
1696                            HttpServletRequest request, String portletId,
1697                            boolean checkStagingGroup)
1698                    throws PortalException {
1699    
1700                    return getPortal().getScopeGroupId(
1701                            request, portletId, checkStagingGroup);
1702            }
1703    
1704            public static long getScopeGroupId(Layout layout) {
1705                    return getPortal().getScopeGroupId(layout);
1706            }
1707    
1708            public static long getScopeGroupId(Layout layout, String portletId) {
1709                    return getPortal().getScopeGroupId(layout, portletId);
1710            }
1711    
1712            public static long getScopeGroupId(long plid) {
1713                    return getPortal().getScopeGroupId(plid);
1714            }
1715    
1716            public static long getScopeGroupId(PortletRequest portletRequest)
1717                    throws PortalException {
1718    
1719                    return getPortal().getScopeGroupId(portletRequest);
1720            }
1721    
1722            public static User getSelectedUser(HttpServletRequest request)
1723                    throws PortalException {
1724    
1725                    return getPortal().getSelectedUser(request);
1726            }
1727    
1728            public static User getSelectedUser(
1729                            HttpServletRequest request, boolean checkPermission)
1730                    throws PortalException {
1731    
1732                    return getPortal().getSelectedUser(request, checkPermission);
1733            }
1734    
1735            public static User getSelectedUser(PortletRequest portletRequest)
1736                    throws PortalException {
1737    
1738                    return getPortal().getSelectedUser(portletRequest);
1739            }
1740    
1741            public static User getSelectedUser(
1742                            PortletRequest portletRequest, boolean checkPermission)
1743                    throws PortalException {
1744    
1745                    return getPortal().getSelectedUser(portletRequest, checkPermission);
1746            }
1747    
1748            public static String getServletContextName() {
1749                    return getPortal().getServletContextName();
1750            }
1751    
1752            public static long[] getSharedContentSiteGroupIds(
1753                            long companyId, long groupId, long userId)
1754                    throws PortalException {
1755    
1756                    return getPortal().getSharedContentSiteGroupIds(
1757                            companyId, groupId, userId);
1758            }
1759    
1760            /**
1761             * @deprecated As of 7.0.0, replaced by {@link
1762             *             #getControlPanelPortletURL(PortletRequest, Group, String,
1763             *             long, String)}
1764             */
1765            @Deprecated
1766            public static PortletURL getSiteAdministrationURL(
1767                    HttpServletRequest request, ThemeDisplay themeDisplay,
1768                    String portletId) {
1769    
1770                    return getPortal().getSiteAdministrationURL(
1771                            request, themeDisplay, portletId);
1772            }
1773    
1774            /**
1775             * @deprecated As of 7.0.0, replaced by {@link
1776             *             #getControlPanelPortletURL(PortletRequest, Group, String,
1777             *             long, String)}
1778             */
1779            @Deprecated
1780            public static PortletURL getSiteAdministrationURL(
1781                    PortletResponse portletResponse, ThemeDisplay themeDisplay,
1782                    String portletName) {
1783    
1784                    return getPortal().getSiteAdministrationURL(
1785                            portletResponse, themeDisplay, portletName);
1786            }
1787    
1788            /**
1789             * @deprecated As of 7.0.0, replaced by {@link
1790             *             #getCurrentAndAncestorSiteGroupIds(long)}
1791             */
1792            @Deprecated
1793            public static long[] getSiteAndCompanyGroupIds(long groupId)
1794                    throws PortalException {
1795    
1796                    return getPortal().getSiteAndCompanyGroupIds(groupId);
1797            }
1798    
1799            /**
1800             * @deprecated As of 7.0.0, replaced by {@link
1801             *             #getCurrentAndAncestorSiteGroupIds(long)}
1802             */
1803            @Deprecated
1804            public static long[] getSiteAndCompanyGroupIds(ThemeDisplay themeDisplay)
1805                    throws PortalException {
1806    
1807                    return getPortal().getSiteAndCompanyGroupIds(themeDisplay);
1808            }
1809    
1810            public static Locale getSiteDefaultLocale(long groupId)
1811                    throws PortalException {
1812    
1813                    return getPortal().getSiteDefaultLocale(groupId);
1814            }
1815    
1816            public static long getSiteGroupId(long scopeGroupId) {
1817                    return getPortal().getSiteGroupId(scopeGroupId);
1818            }
1819    
1820            public static String getSiteLoginURL(ThemeDisplay themeDisplay)
1821                    throws PortalException {
1822    
1823                    return getPortal().getSiteLoginURL(themeDisplay);
1824            }
1825    
1826            public static String getStaticResourceURL(
1827                    HttpServletRequest request, String uri) {
1828    
1829                    return getPortal().getStaticResourceURL(request, uri);
1830            }
1831    
1832            public static String getStaticResourceURL(
1833                    HttpServletRequest request, String uri, long timestamp) {
1834    
1835                    return getPortal().getStaticResourceURL(request, uri, timestamp);
1836            }
1837    
1838            public static String getStaticResourceURL(
1839                    HttpServletRequest request, String uri, String queryString) {
1840    
1841                    return getPortal().getStaticResourceURL(request, uri, queryString);
1842            }
1843    
1844            public static String getStaticResourceURL(
1845                    HttpServletRequest request, String uri, String queryString,
1846                    long timestamp) {
1847    
1848                    return getPortal().getStaticResourceURL(
1849                            request, uri, queryString, timestamp);
1850            }
1851    
1852            public static String getStrutsAction(HttpServletRequest request) {
1853                    return getPortal().getStrutsAction(request);
1854            }
1855    
1856            public static String[] getSystemGroups() {
1857                    return getPortal().getSystemGroups();
1858            }
1859    
1860            public static String[] getSystemOrganizationRoles() {
1861                    return getPortal().getSystemOrganizationRoles();
1862            }
1863    
1864            public static String[] getSystemRoles() {
1865                    return getPortal().getSystemRoles();
1866            }
1867    
1868            public static String[] getSystemSiteRoles() {
1869                    return getPortal().getSystemSiteRoles();
1870            }
1871    
1872            public static String getUniqueElementId(
1873                    HttpServletRequest request, String namespace, String id) {
1874    
1875                    return getPortal().getUniqueElementId(request, namespace, id);
1876            }
1877    
1878            public static String getUniqueElementId(
1879                    PortletRequest request, String namespace, String id) {
1880    
1881                    return getPortal().getUniqueElementId(request, namespace, id);
1882            }
1883    
1884            public static UploadPortletRequest getUploadPortletRequest(
1885                    PortletRequest portletRequest) {
1886    
1887                    return getPortal().getUploadPortletRequest(portletRequest);
1888            }
1889    
1890            public static UploadServletRequest getUploadServletRequest(
1891                    HttpServletRequest request) {
1892    
1893                    return getPortal().getUploadServletRequest(request);
1894            }
1895    
1896            public static Date getUptime() {
1897                    return getPortal().getUptime();
1898            }
1899    
1900            public static String getURLWithSessionId(String url, String sessionId) {
1901                    return getPortal().getURLWithSessionId(url, sessionId);
1902            }
1903    
1904            public static User getUser(HttpServletRequest request)
1905                    throws PortalException {
1906    
1907                    return getPortal().getUser(request);
1908            }
1909    
1910            public static User getUser(PortletRequest portletRequest)
1911                    throws PortalException {
1912    
1913                    return getPortal().getUser(portletRequest);
1914            }
1915    
1916            public static String getUserEmailAddress(long userId) {
1917                    return getPortal().getUserEmailAddress(userId);
1918            }
1919    
1920            public static long getUserId(HttpServletRequest request) {
1921                    return getPortal().getUserId(request);
1922            }
1923    
1924            public static long getUserId(PortletRequest portletRequest) {
1925                    return getPortal().getUserId(portletRequest);
1926            }
1927    
1928            public static String getUserName(BaseModel<?> baseModel) {
1929                    return getPortal().getUserName(baseModel);
1930            }
1931    
1932            public static String getUserName(long userId, String defaultUserName) {
1933                    return getPortal().getUserName(userId, defaultUserName);
1934            }
1935    
1936            public static String getUserName(
1937                    long userId, String defaultUserName, HttpServletRequest request) {
1938    
1939                    return getPortal().getUserName(userId, defaultUserName, request);
1940            }
1941    
1942            public static String getUserName(
1943                    long userId, String defaultUserName, String userAttribute) {
1944    
1945                    return getPortal().getUserName(userId, defaultUserName, userAttribute);
1946            }
1947    
1948            public static String getUserName(
1949                    long userId, String defaultUserName, String userAttribute,
1950                    HttpServletRequest request) {
1951    
1952                    return getPortal().getUserName(
1953                            userId, defaultUserName, userAttribute, request);
1954            }
1955    
1956            public static String getUserPassword(HttpServletRequest request) {
1957                    return getPortal().getUserPassword(request);
1958            }
1959    
1960            public static String getUserPassword(HttpSession session) {
1961                    return getPortal().getUserPassword(session);
1962            }
1963    
1964            public static String getUserPassword(PortletRequest portletRequest) {
1965                    return getPortal().getUserPassword(portletRequest);
1966            }
1967    
1968            /**
1969             * @deprecated As of 7.0.0, with no direct replacement
1970             */
1971            @Deprecated
1972            public static String getUserValue(
1973                    long userId, String param, String defaultValue) {
1974    
1975                    return getPortal().getUserValue(userId, param, defaultValue);
1976            }
1977    
1978            public static String getValidPortalDomain(long companyId, String domain) {
1979                    return getPortal().getValidPortalDomain(companyId, domain);
1980            }
1981    
1982            public static long getValidUserId(long companyId, long userId)
1983                    throws PortalException {
1984    
1985                    return getPortal().getValidUserId(companyId, userId);
1986            }
1987    
1988            public static String getVirtualHostname(LayoutSet layoutSet) {
1989                    return getPortal().getVirtualHostname(layoutSet);
1990            }
1991    
1992            /**
1993             * @deprecated As of 7.0.0, with no direct replacement
1994             */
1995            @Deprecated
1996            public static String getVirtualLayoutActualURL(
1997                            long groupId, boolean privateLayout, String mainPath,
1998                            String friendlyURL, Map<String, String[]> params,
1999                            Map<String, Object> requestContext)
2000                    throws PortalException {
2001    
2002                    return getPortal().getVirtualLayoutActualURL(
2003                            groupId, privateLayout, mainPath, friendlyURL, params,
2004                            requestContext);
2005            }
2006    
2007            /**
2008             * @deprecated As of 7.0.0, with no direct replacement
2009             */
2010            @Deprecated
2011            public static LayoutFriendlyURLComposite
2012                            getVirtualLayoutFriendlyURLComposite(
2013                                    boolean privateLayout, String friendlyURL,
2014                                    Map<String, String[]> params,
2015                                    Map<String, Object> requestContext)
2016                    throws PortalException {
2017    
2018                    return getPortal().getVirtualLayoutFriendlyURLComposite(
2019                            privateLayout, friendlyURL, params, requestContext);
2020            }
2021    
2022            public static String getWidgetURL(
2023                            Portlet portlet, ThemeDisplay themeDisplay)
2024                    throws PortalException {
2025    
2026                    return getPortal().getWidgetURL(portlet, themeDisplay);
2027            }
2028    
2029            public static void initCustomSQL() {
2030                    getPortal().initCustomSQL();
2031            }
2032    
2033            public static User initUser(HttpServletRequest request) throws Exception {
2034                    return getPortal().initUser(request);
2035            }
2036    
2037            /**
2038             * @deprecated As of 7.0.0, with no direct replacement
2039             */
2040            @Deprecated
2041            public static void invokeTaglibDiscussion(
2042                            PortletConfig portletConfig, ActionRequest actionRequest,
2043                            ActionResponse actionResponse)
2044                    throws Exception {
2045    
2046                    getPortal().invokeTaglibDiscussion(
2047                            portletConfig, actionRequest, actionResponse);
2048            }
2049    
2050            /**
2051             * @deprecated As of 7.0.0, with no direct replacement
2052             */
2053            @Deprecated
2054            public static void invokeTaglibDiscussionPagination(
2055                            PortletConfig portletConfig, ResourceRequest resourceRequest,
2056                            ResourceResponse resourceResponse)
2057                    throws IOException, PortletException {
2058    
2059                    getPortal().invokeTaglibDiscussionPagination(
2060                            portletConfig, resourceRequest, resourceResponse);
2061            }
2062    
2063            /**
2064             * @deprecated As of 6.2.0, with no direct replacement
2065             */
2066            @Deprecated
2067            public static boolean isAllowAddPortletDefaultResource(
2068                            HttpServletRequest request, Portlet portlet)
2069                    throws PortalException {
2070    
2071                    return getPortal().isAllowAddPortletDefaultResource(request, portlet);
2072            }
2073    
2074            public static boolean isCDNDynamicResourcesEnabled(
2075                            HttpServletRequest request)
2076                    throws PortalException {
2077    
2078                    return getPortal().isCDNDynamicResourcesEnabled(request);
2079            }
2080    
2081            public static boolean isCDNDynamicResourcesEnabled(long companyId) {
2082                    return getPortal().isCDNDynamicResourcesEnabled(companyId);
2083            }
2084    
2085            /**
2086             * @deprecated As of 6.1.0, renamed to {@link #isGroupAdmin(User, long)}
2087             */
2088            @Deprecated
2089            public static boolean isCommunityAdmin(User user, long groupId)
2090                    throws Exception {
2091    
2092                    return getPortal().isCommunityAdmin(user, groupId);
2093            }
2094    
2095            /**
2096             * @deprecated As of 6.1.0, renamed to {@link #isGroupOwner(User, long)}
2097             */
2098            @Deprecated
2099            public static boolean isCommunityOwner(User user, long groupId)
2100                    throws Exception {
2101    
2102                    return getPortal().isCommunityOwner(user, groupId);
2103            }
2104    
2105            public static boolean isCompanyAdmin(User user) throws Exception {
2106                    return getPortal().isCompanyAdmin(user);
2107            }
2108    
2109            public static boolean isCompanyControlPanelPortlet(
2110                            String portletId, String category, ThemeDisplay themeDisplay)
2111                    throws PortalException {
2112    
2113                    return getPortal().isCompanyControlPanelPortlet(
2114                            portletId, category, themeDisplay);
2115            }
2116    
2117            public static boolean isCompanyControlPanelPortlet(
2118                            String portletId, ThemeDisplay themeDisplay)
2119                    throws PortalException {
2120    
2121                    return getPortal().isCompanyControlPanelPortlet(
2122                            portletId, themeDisplay);
2123            }
2124    
2125            public static boolean isControlPanelPortlet(
2126                    String portletId, String category, ThemeDisplay themeDisplay) {
2127    
2128                    return getPortal().isControlPanelPortlet(
2129                            portletId, category, themeDisplay);
2130            }
2131    
2132            public static boolean isControlPanelPortlet(
2133                    String portletId, ThemeDisplay themeDisplay) {
2134    
2135                    return getPortal().isControlPanelPortlet(portletId, themeDisplay);
2136            }
2137    
2138            public static boolean isGroupAdmin(User user, long groupId)
2139                    throws Exception {
2140    
2141                    return getPortal().isGroupAdmin(user, groupId);
2142            }
2143    
2144            public static boolean isGroupFriendlyURL(
2145                    String fullURL, String groupFriendlyURL, String layoutFriendlyURL) {
2146    
2147                    return getPortal().isGroupFriendlyURL(
2148                            fullURL, groupFriendlyURL, layoutFriendlyURL);
2149            }
2150    
2151            public static boolean isGroupOwner(User user, long groupId)
2152                    throws Exception {
2153    
2154                    return getPortal().isGroupOwner(user, groupId);
2155            }
2156    
2157            public static boolean isLayoutDescendant(Layout layout, long layoutId)
2158                    throws PortalException {
2159    
2160                    return getPortal().isLayoutDescendant(layout, layoutId);
2161            }
2162    
2163            public static boolean isLayoutSitemapable(Layout layout) {
2164                    return getPortal().isLayoutSitemapable(layout);
2165            }
2166    
2167            public static boolean isLoginRedirectRequired(HttpServletRequest request) {
2168                    return getPortal().isLoginRedirectRequired(request);
2169            }
2170    
2171            public static boolean isMethodGet(PortletRequest portletRequest) {
2172                    return getPortal().isMethodGet(portletRequest);
2173            }
2174    
2175            public static boolean isMethodPost(PortletRequest portletRequest) {
2176                    return getPortal().isMethodPost(portletRequest);
2177            }
2178    
2179            public static boolean isMultipartRequest(HttpServletRequest request) {
2180                    return getPortal().isMultipartRequest(request);
2181            }
2182    
2183            public static boolean isOmniadmin(long userId) {
2184                    return getPortal().isOmniadmin(userId);
2185            }
2186    
2187            public static boolean isOmniadmin(User user) {
2188                    return getPortal().isOmniadmin(user);
2189            }
2190    
2191            public static boolean isReservedParameter(String name) {
2192                    return getPortal().isReservedParameter(name);
2193            }
2194    
2195            public static boolean isRightToLeft(HttpServletRequest request) {
2196                    return getPortal().isRightToLeft(request);
2197            }
2198    
2199            public static boolean isRSSFeedsEnabled() {
2200                    return getPortal().isRSSFeedsEnabled();
2201            }
2202    
2203            public static boolean isSecure(HttpServletRequest request) {
2204                    return getPortal().isSecure(request);
2205            }
2206    
2207            public static boolean isSystemGroup(String groupName) {
2208                    return getPortal().isSystemGroup(groupName);
2209            }
2210    
2211            public static boolean isSystemRole(String roleName) {
2212                    return getPortal().isSystemRole(roleName);
2213            }
2214    
2215            public static boolean isUpdateAvailable() {
2216                    return getPortal().isUpdateAvailable();
2217            }
2218    
2219            public static boolean isValidResourceId(String resourceId) {
2220                    return getPortal().isValidResourceId(resourceId);
2221            }
2222    
2223            public static boolean removePortalEventListener(
2224                    PortalInetSocketAddressEventListener
2225                            portalInetSocketAddressEventListener) {
2226    
2227                    return getPortal().removePortalInetSocketAddressEventListener(
2228                            portalInetSocketAddressEventListener);
2229            }
2230    
2231            public static void resetCDNHosts() {
2232                    getPortal().resetCDNHosts();
2233            }
2234    
2235            /**
2236             * @deprecated As of 6.2.0 replaced by {@link
2237             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#resetPortletInvocationWhitelist}
2238             */
2239            @Deprecated
2240            public static Set<String> resetPortletAddDefaultResourceCheckWhitelist() {
2241                    return getPortal().resetPortletAddDefaultResourceCheckWhitelist();
2242            }
2243    
2244            /**
2245             * @deprecated As of 6.2.0 replaced by {@link
2246             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#resetPortletInvocationWhitelistActions}
2247             */
2248            @Deprecated
2249            public static Set<String>
2250                    resetPortletAddDefaultResourceCheckWhitelistActions() {
2251    
2252                    return getPortal().
2253                            resetPortletAddDefaultResourceCheckWhitelistActions();
2254            }
2255    
2256            public static String resetPortletParameters(String url, String portletId) {
2257                    return getPortal().resetPortletParameters(url, portletId);
2258            }
2259    
2260            /**
2261             * @deprecated As of 6.1.0, replaced by {@link DB#runSQL(String)}
2262             */
2263            @Deprecated
2264            public static void runSQL(String sql) throws IOException, SQLException {
2265                    DBManagerUtil.getDB().runSQL(sql);
2266            }
2267    
2268            public static void sendError(
2269                            Exception e, ActionRequest actionRequest,
2270                            ActionResponse actionResponse)
2271                    throws IOException {
2272    
2273                    getPortal().sendError(e, actionRequest, actionResponse);
2274            }
2275    
2276            public static void sendError(
2277                            Exception e, HttpServletRequest request,
2278                            HttpServletResponse response)
2279                    throws IOException, ServletException {
2280    
2281                    getPortal().sendError(e, request, response);
2282            }
2283    
2284            public static void sendError(
2285                            int status, Exception e, ActionRequest actionRequest,
2286                            ActionResponse actionResponse)
2287                    throws IOException {
2288    
2289                    getPortal().sendError(status, e, actionRequest, actionResponse);
2290            }
2291    
2292            public static void sendError(
2293                            int status, Exception e, HttpServletRequest request,
2294                            HttpServletResponse response)
2295                    throws IOException, ServletException {
2296    
2297                    getPortal().sendError(status, e, request, response);
2298            }
2299    
2300            public static void sendRSSFeedsDisabledError(
2301                            HttpServletRequest request, HttpServletResponse response)
2302                    throws IOException, ServletException {
2303    
2304                    getPortal().sendRSSFeedsDisabledError(request, response);
2305            }
2306    
2307            public static void sendRSSFeedsDisabledError(
2308                            PortletRequest portletRequest, PortletResponse portletResponse)
2309                    throws IOException, ServletException {
2310    
2311                    getPortal().sendRSSFeedsDisabledError(portletRequest, portletResponse);
2312            }
2313    
2314            /**
2315             * Sets the description for a page. This overrides the existing page
2316             * description.
2317             */
2318            public static void setPageDescription(
2319                    String description, HttpServletRequest request) {
2320    
2321                    getPortal().setPageDescription(description, request);
2322            }
2323    
2324            /**
2325             * Sets the keywords for a page. This overrides the existing page keywords.
2326             */
2327            public static void setPageKeywords(
2328                    String keywords, HttpServletRequest request) {
2329    
2330                    getPortal().setPageKeywords(keywords, request);
2331            }
2332    
2333            /**
2334             * Sets the subtitle for a page. This overrides the existing page subtitle.
2335             */
2336            public static void setPageSubtitle(
2337                    String subtitle, HttpServletRequest request) {
2338    
2339                    getPortal().setPageSubtitle(subtitle, request);
2340            }
2341    
2342            /**
2343             * Sets the whole title for a page. This overrides the existing page whole
2344             * title.
2345             */
2346            public static void setPageTitle(String title, HttpServletRequest request) {
2347                    getPortal().setPageTitle(title, request);
2348            }
2349    
2350            public static void setPortalInetSocketAddresses(
2351                    HttpServletRequest request) {
2352    
2353                    getPortal().setPortalInetSocketAddresses(request);
2354            }
2355    
2356            /**
2357             * Sets the port obtained on the first request to the portal.
2358             *
2359             * @deprecated As of 7.0.0, replaced by {@link
2360             *             #setPortalInetSocketAddresses(HttpServletRequest)}
2361             */
2362            @Deprecated
2363            public static void setPortalPort(HttpServletRequest request) {
2364                    getPortal().setPortalPort(request);
2365            }
2366    
2367            public static void storePreferences(PortletPreferences portletPreferences)
2368                    throws IOException, ValidatorException {
2369    
2370                    getPortal().storePreferences(portletPreferences);
2371            }
2372    
2373            public static String[] stripURLAnchor(String url, String separator) {
2374                    return getPortal().stripURLAnchor(url, separator);
2375            }
2376    
2377            public static String transformCustomSQL(String sql) {
2378                    return getPortal().transformCustomSQL(sql);
2379            }
2380    
2381            public static String transformSQL(String sql) {
2382                    return getPortal().transformSQL(sql);
2383            }
2384    
2385            public static void updateImageId(
2386                            BaseModel<?> baseModel, boolean hasImage, byte[] bytes,
2387                            String fieldName, long maxSize, int maxHeight, int maxWidth)
2388                    throws PortalException {
2389    
2390                    getPortal().updateImageId(
2391                            baseModel, hasImage, bytes, fieldName, maxSize, maxHeight,
2392                            maxWidth);
2393            }
2394    
2395            public static PortletMode updatePortletMode(
2396                            String portletId, User user, Layout layout, PortletMode portletMode,
2397                            HttpServletRequest request)
2398                    throws PortalException {
2399    
2400                    return getPortal().updatePortletMode(
2401                            portletId, user, layout, portletMode, request);
2402            }
2403    
2404            public static String updateRedirect(
2405                    String redirect, String oldPath, String newPath) {
2406    
2407                    return getPortal().updateRedirect(redirect, oldPath, newPath);
2408            }
2409    
2410            public static WindowState updateWindowState(
2411                    String portletId, User user, Layout layout, WindowState windowState,
2412                    HttpServletRequest request) {
2413    
2414                    return getPortal().updateWindowState(
2415                            portletId, user, layout, windowState, request);
2416            }
2417    
2418            /**
2419             * @deprecated As of 7.0.0, replaced by {@link
2420             *             #removePortalEventListener(
2421             *             PortalInetSocketAddressEventListener)}
2422             */
2423            @Deprecated
2424            public void removePortalPortEventListener(
2425                    PortalPortEventListener portalPortEventListener) {
2426    
2427                    getPortal().removePortalPortEventListener(portalPortEventListener);
2428            }
2429    
2430            public void setPortal(Portal portal) {
2431                    PortalRuntimePermission.checkSetBeanProperty(getClass());
2432    
2433                    _portal = portal;
2434            }
2435    
2436            private static Portal _portal;
2437    
2438    }