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