001    /**
002     * Copyright (c) 2000-2013 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 com.liferay.portal.kernel.dao.db.DB;
018    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
022    import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
023    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
024    import com.liferay.portal.kernel.servlet.taglib.ui.BreadcrumbEntry;
025    import com.liferay.portal.kernel.upload.UploadPortletRequest;
026    import com.liferay.portal.kernel.upload.UploadServletRequest;
027    import com.liferay.portal.model.BaseModel;
028    import com.liferay.portal.model.Company;
029    import com.liferay.portal.model.Group;
030    import com.liferay.portal.model.Layout;
031    import com.liferay.portal.model.LayoutFriendlyURLComposite;
032    import com.liferay.portal.model.LayoutQueryStringComposite;
033    import com.liferay.portal.model.LayoutSet;
034    import com.liferay.portal.model.Portlet;
035    import com.liferay.portal.model.ResourcePermission;
036    import com.liferay.portal.model.User;
037    import com.liferay.portal.service.PortletLocalServiceUtil;
038    import com.liferay.portal.theme.ThemeDisplay;
039    import com.liferay.portlet.InvokerPortlet;
040    import com.liferay.portlet.PortletInstanceFactoryUtil;
041    import com.liferay.portlet.expando.model.ExpandoBridge;
042    
043    import java.io.IOException;
044    import java.io.Serializable;
045    
046    import java.sql.SQLException;
047    
048    import java.util.Date;
049    import java.util.List;
050    import java.util.Locale;
051    import java.util.Map;
052    import java.util.Properties;
053    import java.util.Set;
054    import java.util.TimeZone;
055    
056    import javax.portlet.ActionRequest;
057    import javax.portlet.ActionResponse;
058    import javax.portlet.PortletConfig;
059    import javax.portlet.PortletException;
060    import javax.portlet.PortletMode;
061    import javax.portlet.PortletPreferences;
062    import javax.portlet.PortletRequest;
063    import javax.portlet.PortletResponse;
064    import javax.portlet.PortletURL;
065    import javax.portlet.PreferencesValidator;
066    import javax.portlet.RenderRequest;
067    import javax.portlet.RenderResponse;
068    import javax.portlet.ValidatorException;
069    import javax.portlet.WindowState;
070    
071    import javax.servlet.ServletContext;
072    import javax.servlet.ServletException;
073    import javax.servlet.http.HttpServletRequest;
074    import javax.servlet.http.HttpServletResponse;
075    import javax.servlet.http.HttpSession;
076    import javax.servlet.jsp.PageContext;
077    
078    /**
079     * @author Brian Wing Shun Chan
080     * @author Eduardo Lundgren
081     * @author Juan Fern??ndez
082     */
083    public class PortalUtil {
084    
085            /**
086             * Adds the description for a page. This appends to the existing page
087             * description.
088             */
089            public static void addPageDescription(
090                    String description, HttpServletRequest request) {
091    
092                    getPortal().addPageDescription(description, request);
093            }
094    
095            /**
096             * Adds the keywords for a page. This appends to the existing page keywords.
097             */
098            public static void addPageKeywords(
099                    String keywords, HttpServletRequest request) {
100    
101                    getPortal().addPageKeywords(keywords, request);
102            }
103    
104            /**
105             * Adds the subtitle for a page. This appends to the existing page subtitle.
106             */
107            public static void addPageSubtitle(
108                    String subtitle, HttpServletRequest request) {
109    
110                    getPortal().addPageSubtitle(subtitle, request);
111            }
112    
113            /**
114             * Adds the whole title for a page. This appends to the existing page whole
115             * title.
116             */
117            public static void addPageTitle(String title, HttpServletRequest request) {
118                    getPortal().addPageTitle(title, request);
119            }
120    
121            public static void addPortalPortEventListener(
122                    PortalPortEventListener portalPortEventListener) {
123    
124                    getPortal().addPortalPortEventListener(portalPortEventListener);
125            }
126    
127            public static void addPortalPortProtocolEventListener(
128                    PortalPortProtocolEventListener portalPortProtocolEventListener) {
129    
130                    getPortal().addPortalPortProtocolEventListener(
131                            portalPortProtocolEventListener);
132            }
133    
134            public static void addPortletBreadcrumbEntry(
135                    HttpServletRequest request, String title, String url) {
136    
137                    getPortal().addPortletBreadcrumbEntry(request, title, url);
138            }
139    
140            public static void addPortletBreadcrumbEntry(
141                    HttpServletRequest request, String title, String url,
142                    Map<String, Object> data) {
143    
144                    getPortal().addPortletBreadcrumbEntry(request, title, url, data);
145            }
146    
147            public static void addPortletDefaultResource(
148                            HttpServletRequest request, Portlet portlet)
149                    throws PortalException, SystemException {
150    
151                    getPortal().addPortletDefaultResource(request, portlet);
152            }
153    
154            public static void addPortletDefaultResource(
155                            long companyId, Layout layout, Portlet portlet)
156                    throws PortalException, SystemException {
157    
158                    getPortal().addPortletDefaultResource(companyId, layout, portlet);
159            }
160    
161            /**
162             * Adds preserved parameters such as doAsGroupId, doAsUserId,
163             * doAsUserLanguageId, and referrerPlid that should always be preserved as
164             * the user navigates through the portal. If doAsUser is <code>false</code>,
165             * then doAsUserId and doAsUserLanguageId will never be added.
166             */
167            public static String addPreservedParameters(
168                    ThemeDisplay themeDisplay, Layout layout, String url,
169                    boolean doAsUser) {
170    
171                    return getPortal().addPreservedParameters(
172                            themeDisplay, layout, url, doAsUser);
173            }
174    
175            /**
176             * Adds preserved parameters such as doAsGroupId, doAsUserId,
177             * doAsUserLanguageId, and referrerPlid that should always be preserved as
178             * the user navigates through the portal.
179             */
180            public static String addPreservedParameters(
181                    ThemeDisplay themeDisplay, String url) {
182    
183                    return getPortal().addPreservedParameters(themeDisplay, url);
184            }
185    
186            public static void addUserLocaleOptionsMessage(HttpServletRequest request) {
187                    getPortal().addUserLocaleOptionsMessage(request);
188            }
189    
190            public static void clearRequestParameters(RenderRequest renderRequest) {
191                    getPortal().clearRequestParameters(renderRequest);
192            }
193    
194            public static void copyRequestParameters(
195                    ActionRequest actionRequest, ActionResponse actionResponse) {
196    
197                    getPortal().copyRequestParameters(actionRequest, actionResponse);
198            }
199    
200            public static String escapeRedirect(String url) {
201                    return getPortal().escapeRedirect(url);
202            }
203    
204            public static String generateRandomKey(
205                    HttpServletRequest request, String input) {
206    
207                    return getPortal().generateRandomKey(request, input);
208            }
209    
210            public static String getAbsoluteURL(
211                    HttpServletRequest request, String url) {
212    
213                    return getPortal().getAbsoluteURL(request, url);
214            }
215    
216            public static LayoutQueryStringComposite
217                    getActualLayoutQueryStringComposite(
218                            long groupId, boolean privateLayout, String friendlyURL,
219                            Map<String, String[]> params, Map<String, Object> requestContext)
220                    throws PortalException, SystemException {
221    
222                    return getPortal().getActualLayoutQueryStringComposite(
223                            groupId, privateLayout, friendlyURL, params, requestContext);
224            }
225    
226            public static String getActualURL(
227                            long groupId, boolean privateLayout, String mainPath,
228                            String friendlyURL, Map<String, String[]> params,
229                            Map<String, Object> requestContext)
230                    throws PortalException, SystemException {
231    
232                    return getPortal().getActualURL(
233                            groupId, privateLayout, mainPath, friendlyURL, params,
234                            requestContext);
235            }
236    
237            /**
238             * @deprecated As of 6.2.0, replaced by {@link
239             *             com.liferay.portal.kernel.language.LanguageUtil#getAvailableLocales}
240             */
241            public static Locale[] getAlternateLocales(HttpServletRequest request)
242                    throws PortalException, SystemException {
243    
244                    return getPortal().getAlternateLocales(request);
245            }
246    
247            public static String getAlternateURL(
248                            String canonicalURL, ThemeDisplay themeDisplay, Locale locale,
249                            Layout layout)
250                    throws PortalException, SystemException {
251    
252                    return getPortal().getAlternateURL(
253                            canonicalURL, themeDisplay, locale, layout);
254            }
255    
256            /**
257             * @deprecated As of 6.2.0, replaced by {@link
258             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletCSRFWhitelistActions}
259             */
260            public static Set<String> getAuthTokenIgnoreActions() {
261                    return getPortal().getAuthTokenIgnoreActions();
262            }
263    
264            /**
265             * @deprecated As of 6.2.0, replaced by {@link
266             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletCSRFWhitelist}
267             */
268            public static Set<String> getAuthTokenIgnorePortlets() {
269                    return getPortal().getAuthTokenIgnorePortlets();
270            }
271    
272            public static BaseModel<?> getBaseModel(
273                            ResourcePermission resourcePermission)
274                    throws PortalException, SystemException {
275    
276                    return getPortal().getBaseModel(resourcePermission);
277            }
278    
279            public static BaseModel<?> getBaseModel(String modelName, String primKey)
280                    throws PortalException, SystemException {
281    
282                    return getPortal().getBaseModel(modelName, primKey);
283            }
284    
285            public static long getBasicAuthUserId(HttpServletRequest request)
286                    throws PortalException, SystemException {
287    
288                    return getPortal().getBasicAuthUserId(request);
289            }
290    
291            public static long getBasicAuthUserId(
292                            HttpServletRequest request, long companyId)
293                    throws PortalException, SystemException {
294    
295                    return getPortal().getBasicAuthUserId(request, companyId);
296            }
297    
298            public static String getCanonicalURL(
299                            String completeURL, ThemeDisplay themeDisplay, Layout layout)
300                    throws PortalException, SystemException {
301    
302                    return getPortal().getCanonicalURL(completeURL, themeDisplay, layout);
303            }
304    
305            public static String getCanonicalURL(
306                            String completeURL, ThemeDisplay themeDisplay, Layout layout,
307                            boolean forceLayoutFriendlyURL)
308                    throws PortalException, SystemException {
309    
310                    return getPortal().getCanonicalURL(
311                            completeURL, themeDisplay, layout, forceLayoutFriendlyURL);
312            }
313    
314            /**
315             * @deprecated As of 6.1.0, replaced by {@link #getCDNHost(boolean)}
316             */
317            public static String getCDNHost() {
318                    return getPortal().getCDNHost();
319            }
320    
321            public static String getCDNHost(boolean secure) {
322                    return getPortal().getCDNHost(secure);
323            }
324    
325            public static String getCDNHost(HttpServletRequest request)
326                    throws PortalException, SystemException {
327    
328                    return getPortal().getCDNHost(request);
329            }
330    
331            public static String getCDNHostHttp(long companyId) {
332                    return getPortal().getCDNHostHttp(companyId);
333            }
334    
335            public static String getCDNHostHttps(long companyId) {
336                    return getPortal().getCDNHostHttps(companyId);
337            }
338    
339            public static String getClassName(long classNameId) {
340                    return getPortal().getClassName(classNameId);
341            }
342    
343            public static long getClassNameId(Class<?> clazz) {
344                    return getPortal().getClassNameId(clazz);
345            }
346    
347            public static long getClassNameId(String value) {
348                    return getPortal().getClassNameId(value);
349            }
350    
351            public static String getClassNamePortletId(String className) {
352                    return getPortal().getClassNamePortletId(className);
353            }
354    
355            public static Company getCompany(HttpServletRequest request)
356                    throws PortalException, SystemException {
357    
358                    return getPortal().getCompany(request);
359            }
360    
361            public static Company getCompany(PortletRequest portletRequest)
362                    throws PortalException, SystemException {
363    
364                    return getPortal().getCompany(portletRequest);
365            }
366    
367            public static long getCompanyId(HttpServletRequest request) {
368                    return getPortal().getCompanyId(request);
369            }
370    
371            public static long getCompanyId(PortletRequest portletRequest) {
372                    return getPortal().getCompanyId(portletRequest);
373            }
374    
375            public static long[] getCompanyIds() {
376                    return getPortal().getCompanyIds();
377            }
378    
379            public static String getComputerAddress() {
380                    return getPortal().getComputerAddress();
381            }
382    
383            public static String getComputerName() {
384                    return getPortal().getComputerName();
385            }
386    
387            public static Map<String, List<Portlet>> getControlPanelCategoriesMap(
388                            HttpServletRequest request)
389                    throws SystemException {
390    
391                    return getPortal().getControlPanelCategoriesMap(request);
392            }
393    
394            public static String getControlPanelCategory(
395                            String portletId, ThemeDisplay themeDisplay)
396                    throws SystemException {
397    
398                    return getPortal().getControlPanelCategory(portletId, themeDisplay);
399            }
400    
401            public static String getControlPanelFullURL(
402                            long scopeGroupId, String ppid, Map<String, String[]> params)
403                    throws PortalException, SystemException {
404    
405                    return getPortal().getControlPanelFullURL(scopeGroupId, ppid, params);
406            }
407    
408            public static long getControlPanelPlid(long companyId)
409                    throws PortalException, SystemException {
410    
411                    return getPortal().getControlPanelPlid(companyId);
412            }
413    
414            public static long getControlPanelPlid(PortletRequest portletRequest)
415                    throws PortalException, SystemException {
416    
417                    return getPortal().getControlPanelPlid(portletRequest);
418            }
419    
420            public static Set<Portlet> getControlPanelPortlets(
421                            long companyId, String category)
422                    throws SystemException {
423    
424                    return getPortal().getControlPanelPortlets(companyId, category);
425            }
426    
427            public static List<Portlet> getControlPanelPortlets(
428                            String category, ThemeDisplay themeDisplay)
429                    throws SystemException {
430    
431                    return getPortal().getControlPanelPortlets(category, themeDisplay);
432            }
433    
434            public static PortletURL getControlPanelPortletURL(
435                    HttpServletRequest request, String portletId, long referrerPlid,
436                    String lifecycle) {
437    
438                    return getPortal().getControlPanelPortletURL(
439                            request, portletId, referrerPlid, lifecycle);
440            }
441    
442            public static PortletURL getControlPanelPortletURL(
443                    PortletRequest portletRequest, String portletId, long referrerPlid,
444                    String lifecycle) {
445    
446                    return getPortal().getControlPanelPortletURL(
447                            portletRequest, portletId, referrerPlid, lifecycle);
448            }
449    
450            public static String getCreateAccountURL(
451                            HttpServletRequest request, ThemeDisplay themeDisplay)
452                    throws Exception {
453    
454                    return getPortal().getCreateAccountURL(request, themeDisplay);
455            }
456    
457            public static String getCurrentCompleteURL(HttpServletRequest request) {
458                    return getPortal().getCurrentCompleteURL(request);
459            }
460    
461            public static String getCurrentURL(HttpServletRequest request) {
462                    return getPortal().getCurrentURL(request);
463            }
464    
465            public static String getCurrentURL(PortletRequest portletRequest) {
466                    return getPortal().getCurrentURL(portletRequest);
467            }
468    
469            public static String getCustomSQLFunctionIsNotNull() {
470                    return getPortal().getCustomSQLFunctionIsNotNull();
471            }
472    
473            public static String getCustomSQLFunctionIsNull() {
474                    return getPortal().getCustomSQLFunctionIsNull();
475            }
476    
477            public static Date getDate(int month, int day, int year) {
478                    return getPortal().getDate(month, day, year);
479            }
480    
481            public static Date getDate(
482                            int month, int day, int year,
483                            Class<? extends PortalException> clazz)
484                    throws PortalException {
485    
486                    return getPortal().getDate(month, day, year, clazz);
487            }
488    
489            public static Date getDate(
490                            int month, int day, int year, int hour, int min,
491                            Class<? extends PortalException> clazz)
492                    throws PortalException {
493    
494                    return getPortal().getDate(month, day, year, hour, min, clazz);
495            }
496    
497            public static Date getDate(
498                            int month, int day, int year, int hour, int min, TimeZone timeZone,
499                            Class<? extends PortalException> clazz)
500                    throws PortalException {
501    
502                    return getPortal().getDate(
503                            month, day, year, hour, min, timeZone, clazz);
504            }
505    
506            public static Date getDate(
507                            int month, int day, int year, TimeZone timeZone,
508                            Class<? extends PortalException> clazz)
509                    throws PortalException {
510    
511                    return getPortal().getDate(month, day, year, timeZone, clazz);
512            }
513    
514            /**
515             * @deprecated As of 6.1.0, replaced by {@link DBFactoryUtil#getDB()}
516             */
517            public static DB getDB() {
518                    return DBFactoryUtil.getDB();
519            }
520    
521            public static long getDefaultCompanyId() {
522                    return getPortal().getDefaultCompanyId();
523            }
524    
525            public static long getDigestAuthUserId(HttpServletRequest request)
526                    throws PortalException, SystemException {
527    
528                    return getPortal().getDigestAuthUserId(request);
529            }
530    
531            public static String getDisplayURL(Group group, ThemeDisplay themeDisplay)
532                    throws PortalException {
533    
534                    return getPortal().getDisplayURL(group, themeDisplay);
535            }
536    
537            public static String getDisplayURL(
538                            Group group, ThemeDisplay themeDisplay, boolean privateLayout)
539                    throws PortalException {
540    
541                    return getPortal().getDisplayURL(group, themeDisplay, privateLayout);
542            }
543    
544            public static String getEmailFromAddress(
545                            PortletPreferences preferences, long companyId, String defaultValue)
546                    throws SystemException {
547    
548                    return getPortal().getEmailFromAddress(
549                            preferences, companyId, defaultValue);
550            }
551    
552            public static String getEmailFromName(
553                            PortletPreferences preferences, long companyId, String defaultValue)
554                    throws SystemException {
555    
556                    return getPortal().getEmailFromName(
557                            preferences, companyId, defaultValue);
558            }
559    
560            public static Map<String, Serializable> getExpandoBridgeAttributes(
561                            ExpandoBridge expandoBridge, HttpServletRequest request)
562                    throws PortalException, SystemException {
563    
564                    return getPortal().getExpandoBridgeAttributes(expandoBridge, request);
565            }
566    
567            public static Map<String, Serializable> getExpandoBridgeAttributes(
568                            ExpandoBridge expandoBridge, PortletRequest portletRequest)
569                    throws PortalException, SystemException {
570    
571                    return getPortal().getExpandoBridgeAttributes(
572                            expandoBridge, portletRequest);
573            }
574    
575            public static Map<String, Serializable> getExpandoBridgeAttributes(
576                            ExpandoBridge expandoBridge,
577                            UploadPortletRequest uploadPortletRequest)
578                    throws PortalException, SystemException {
579    
580                    return getPortal().getExpandoBridgeAttributes(
581                            expandoBridge, uploadPortletRequest);
582            }
583    
584            public static Serializable getExpandoValue(
585                            HttpServletRequest request, String name, int type,
586                            String displayType)
587                    throws PortalException, SystemException {
588    
589                    return getPortal().getExpandoValue(request, name, type, displayType);
590            }
591    
592            public static Serializable getExpandoValue(
593                            PortletRequest portletRequest, String name, int type,
594                            String displayType)
595                    throws PortalException, SystemException {
596    
597                    return getPortal().getExpandoValue(
598                            portletRequest, name, type, displayType);
599            }
600    
601            public static Serializable getExpandoValue(
602                            UploadPortletRequest uploadPortletRequest, String name, int type,
603                            String displayType)
604                    throws PortalException, SystemException {
605    
606                    return getPortal().getExpandoValue(
607                            uploadPortletRequest, name, type, displayType);
608            }
609    
610            public static String getFacebookURL(
611                            Portlet portlet, String facebookCanvasPageURL,
612                            ThemeDisplay themeDisplay)
613                    throws PortalException, SystemException {
614    
615                    return getPortal().getFacebookURL(
616                            portlet, facebookCanvasPageURL, themeDisplay);
617            }
618    
619            public static Portlet getFirstMyAccountPortlet(ThemeDisplay themeDisplay)
620                    throws SystemException {
621    
622                    return getPortal().getFirstMyAccountPortlet(themeDisplay);
623            }
624    
625            public static String getFirstPageLayoutTypes(PageContext pageContext) {
626                    return getPortal().getFirstPageLayoutTypes(pageContext);
627            }
628    
629            public static Portlet getFirstSiteAdministrationPortlet(
630                            ThemeDisplay themeDisplay)
631                    throws SystemException {
632    
633                    return getPortal().getFirstSiteAdministrationPortlet(themeDisplay);
634            }
635    
636            public static String getFullName(
637                    String firstName, String middleName, String lastName) {
638    
639                    return getPortal().getFullName(firstName, middleName, lastName);
640            }
641    
642            public static String getGlobalLibDir() {
643                    return getPortal().getGlobalLibDir();
644            }
645    
646            public static String getGoogleGadgetURL(
647                            Portlet portlet, ThemeDisplay themeDisplay)
648                    throws PortalException, SystemException {
649    
650                    return getPortal().getGoogleGadgetURL(portlet, themeDisplay);
651            }
652    
653            public static String getGroupFriendlyURL(
654                            Group group, boolean privateLayoutSet, ThemeDisplay themeDisplay)
655                    throws PortalException, SystemException {
656    
657                    return getPortal().getGroupFriendlyURL(
658                            group, privateLayoutSet, themeDisplay);
659            }
660    
661            public static String getGroupFriendlyURL(
662                            Group group, boolean privateLayoutSet, ThemeDisplay themeDisplay,
663                            Locale locale)
664                    throws PortalException, SystemException {
665    
666                    return getPortal().getGroupFriendlyURL(
667                            group, privateLayoutSet, themeDisplay, locale);
668            }
669    
670            public static int[] getGroupFriendlyURLIndex(String requestURI) {
671                    return getPortal().getGroupFriendlyURLIndex(requestURI);
672            }
673    
674            public static String[] getGroupPermissions(HttpServletRequest request) {
675                    return getPortal().getGroupPermissions(request);
676            }
677    
678            public static String[] getGroupPermissions(
679                    HttpServletRequest request, String className) {
680    
681                    return getPortal().getGroupPermissions(request, className);
682            }
683    
684            public static String[] getGroupPermissions(PortletRequest portletRequest) {
685                    return getPortal().getGroupPermissions(portletRequest);
686            }
687    
688            public static String[] getGroupPermissions(
689                    PortletRequest portletRequest, String className) {
690    
691                    return getPortal().getGroupPermissions(portletRequest, className);
692            }
693    
694            public static String[] getGuestPermissions(HttpServletRequest request) {
695                    return getPortal().getGuestPermissions(request);
696            }
697    
698            public static String[] getGuestPermissions(
699                    HttpServletRequest request, String className) {
700    
701                    return getPortal().getGuestPermissions(request, className);
702            }
703    
704            public static String[] getGuestPermissions(PortletRequest portletRequest) {
705                    return getPortal().getGuestPermissions(portletRequest);
706            }
707    
708            public static String[] getGuestPermissions(
709                    PortletRequest portletRequest, String className) {
710    
711                    return getPortal().getGuestPermissions(portletRequest, className);
712            }
713    
714            public static String getHomeURL(HttpServletRequest request)
715                    throws PortalException, SystemException {
716    
717                    return getPortal().getHomeURL(request);
718            }
719    
720            public static String getHost(HttpServletRequest request) {
721                    return getPortal().getHost(request);
722            }
723    
724            public static String getHost(PortletRequest portletRequest) {
725                    return getPortal().getHost(portletRequest);
726            }
727    
728            public static HttpServletRequest getHttpServletRequest(
729                    PortletRequest portletRequest) {
730    
731                    return getPortal().getHttpServletRequest(portletRequest);
732            }
733    
734            public static HttpServletResponse getHttpServletResponse(
735                    PortletResponse portletResponse) {
736    
737                    return getPortal().getHttpServletResponse(portletResponse);
738            }
739    
740            public static String getI18nPathLanguageId(
741                    Locale locale, String defaultI18nPathLanguageId) {
742    
743                    return getPortal().getI18nPathLanguageId(
744                            locale, defaultI18nPathLanguageId);
745            }
746    
747            public static String getJournalArticleActualURL(
748                            long groupId, boolean privateLayout, String mainPath,
749                            String friendlyURL, Map<String, String[]> params,
750                            Map<String, Object> requestContext)
751                    throws PortalException, SystemException {
752    
753                    return getPortal().getJournalArticleActualURL(
754                            groupId, privateLayout, mainPath, friendlyURL, params,
755                            requestContext);
756            }
757    
758            public static Layout getJournalArticleLayout(
759                            long groupId, boolean privateLayout, String friendlyURL)
760                    throws PortalException, SystemException {
761    
762                    return getPortal().getJournalArticleLayout(
763                            groupId, privateLayout, friendlyURL);
764            }
765    
766            public static String getJsSafePortletId(String portletId) {
767                    return getPortal().getJsSafePortletId(portletId);
768            }
769    
770            public static String getLayoutActualURL(Layout layout) {
771                    return getPortal().getLayoutActualURL(layout);
772            }
773    
774            public static String getLayoutActualURL(Layout layout, String mainPath) {
775                    return getPortal().getLayoutActualURL(layout, mainPath);
776            }
777    
778            public static String getLayoutActualURL(
779                            long groupId, boolean privateLayout, String mainPath,
780                            String friendlyURL)
781                    throws PortalException, SystemException {
782    
783                    return getPortal().getLayoutActualURL(
784                            groupId, privateLayout, mainPath, friendlyURL);
785            }
786    
787            public static String getLayoutActualURL(
788                            long groupId, boolean privateLayout, String mainPath,
789                            String friendlyURL, Map<String, String[]> params,
790                            Map<String, Object> requestContext)
791                    throws PortalException, SystemException {
792    
793                    return getPortal().getLayoutActualURL(
794                            groupId, privateLayout, mainPath, friendlyURL, params,
795                            requestContext);
796            }
797    
798            public static String getLayoutEditPage(Layout layout) {
799                    return getPortal().getLayoutEditPage(layout);
800            }
801    
802            public static String getLayoutEditPage(String type) {
803                    return getPortal().getLayoutEditPage(type);
804            }
805    
806            public static String getLayoutFriendlyURL(
807                            Layout layout, ThemeDisplay themeDisplay)
808                    throws PortalException, SystemException {
809    
810                    return getPortal().getLayoutFriendlyURL(layout, themeDisplay);
811            }
812    
813            public static String getLayoutFriendlyURL(
814                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
815                    throws PortalException, SystemException {
816    
817                    return getPortal().getLayoutFriendlyURL(layout, themeDisplay, locale);
818            }
819    
820            public static LayoutFriendlyURLComposite getLayoutFriendlyURLComposite(
821                            long groupId, boolean privateLayout, String friendlyURL,
822                            Map<String, String[]> params, Map<String, Object> requestContext)
823                    throws PortalException, SystemException {
824    
825                    return getPortal().getLayoutFriendlyURLComposite(
826                            groupId, privateLayout, friendlyURL, params, requestContext);
827            }
828    
829            public static String getLayoutFullURL(
830                            Layout layout, ThemeDisplay themeDisplay)
831                    throws PortalException, SystemException {
832    
833                    return getPortal().getLayoutFullURL(layout, themeDisplay);
834            }
835    
836            public static String getLayoutFullURL(
837                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
838                    throws PortalException, SystemException {
839    
840                    return getPortal().getLayoutFullURL(layout, themeDisplay, doAsUser);
841            }
842    
843            public static String getLayoutFullURL(long groupId, String portletId)
844                    throws PortalException, SystemException {
845    
846                    return getPortal().getLayoutFullURL(groupId, portletId);
847            }
848    
849            public static String getLayoutFullURL(
850                            long groupId, String portletId, boolean secure)
851                    throws PortalException, SystemException {
852    
853                    return getPortal().getLayoutFullURL(groupId, portletId, secure);
854            }
855    
856            public static String getLayoutFullURL(ThemeDisplay themeDisplay)
857                    throws PortalException, SystemException {
858    
859                    return getPortal().getLayoutFullURL(themeDisplay);
860            }
861    
862            public static String getLayoutSetFriendlyURL(
863                            LayoutSet layoutSet, ThemeDisplay themeDisplay)
864                    throws PortalException, SystemException {
865    
866                    return getPortal().getLayoutSetFriendlyURL(layoutSet, themeDisplay);
867            }
868    
869            public static String getLayoutTarget(Layout layout) {
870                    return getPortal().getLayoutTarget(layout);
871            }
872    
873            public static String getLayoutURL(Layout layout, ThemeDisplay themeDisplay)
874                    throws PortalException, SystemException {
875    
876                    return getPortal().getLayoutURL(layout, themeDisplay);
877            }
878    
879            public static String getLayoutURL(
880                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
881                    throws PortalException, SystemException {
882    
883                    return getPortal().getLayoutURL(layout, themeDisplay, doAsUser);
884            }
885    
886            public static String getLayoutURL(
887                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
888                    throws PortalException, SystemException {
889    
890                    return getPortal().getLayoutURL(layout, themeDisplay, locale);
891            }
892    
893            public static String getLayoutURL(ThemeDisplay themeDisplay)
894                    throws PortalException, SystemException {
895    
896                    return getPortal().getLayoutURL(themeDisplay);
897            }
898    
899            public static String getLayoutViewPage(Layout layout) {
900                    return getPortal().getLayoutViewPage(layout);
901            }
902    
903            public static String getLayoutViewPage(String type) {
904                    return getPortal().getLayoutViewPage(type);
905            }
906    
907            public static LiferayPortletRequest getLiferayPortletRequest(
908                    PortletRequest portletRequest) {
909    
910                    return getPortal().getLiferayPortletRequest(portletRequest);
911            }
912    
913            public static LiferayPortletResponse getLiferayPortletResponse(
914                    PortletResponse portletResponse) {
915    
916                    return getPortal().getLiferayPortletResponse(portletResponse);
917            }
918    
919            public static Locale getLocale(HttpServletRequest request) {
920                    return getPortal().getLocale(request);
921            }
922    
923            public static Locale getLocale(
924                    HttpServletRequest request, HttpServletResponse response,
925                    boolean initialize) {
926    
927                    return getPortal().getLocale(request, response, initialize);
928            }
929    
930            public static Locale getLocale(PortletRequest portletRequest) {
931                    return getPortal().getLocale(portletRequest);
932            }
933    
934            public static String getLocalizedFriendlyURL(
935                            HttpServletRequest request, Layout layout, Locale locale,
936                            Locale originalLocale)
937                    throws Exception {
938    
939                    return getPortal().getLocalizedFriendlyURL(
940                            request, layout, locale, originalLocale);
941            }
942    
943            public static String getMailId(
944                    String mx, String popPortletPrefix, Object... ids) {
945    
946                    return getPortal().getMailId(mx, popPortletPrefix, ids);
947            }
948    
949            /**
950             * @deprecated As of 6.1.0, replaced by {@link
951             *             #getBaseModel(ResourcePermission)}
952             */
953            public static BaseModel<?> getModel(ResourcePermission resourcePermission)
954                    throws PortalException, SystemException {
955    
956                    return getPortal().getBaseModel(resourcePermission);
957            }
958    
959            /**
960             * @deprecated As of 6.1.0, replaced by {@link #getBaseModel(String,
961             *             String)}
962             */
963            public static BaseModel<?> getModel(String modelName, String primKey)
964                    throws PortalException, SystemException {
965    
966                    return getPortal().getBaseModel(modelName, primKey);
967            }
968    
969            public static String getNetvibesURL(
970                            Portlet portlet, ThemeDisplay themeDisplay)
971                    throws PortalException, SystemException {
972    
973                    return getPortal().getNetvibesURL(portlet, themeDisplay);
974            }
975    
976            public static String getNewPortletTitle(
977                    String portletTitle, String oldScopeName, String newScopeName) {
978    
979                    return getPortal().getNewPortletTitle(
980                            portletTitle, oldScopeName, newScopeName);
981            }
982    
983            public static HttpServletRequest getOriginalServletRequest(
984                    HttpServletRequest request) {
985    
986                    return getPortal().getOriginalServletRequest(request);
987            }
988    
989            /**
990             * @deprecated As of 6.2.0 renamed to {@link #getSiteGroupId(long)}
991             */
992            public static long getParentGroupId(long scopeGroupId)
993                    throws PortalException, SystemException {
994    
995                    return getPortal().getParentGroupId(scopeGroupId);
996            }
997    
998            public static String getPathContext() {
999                    return getPortal().getPathContext();
1000            }
1001    
1002            public static String getPathContext(HttpServletRequest request) {
1003                    return getPortal().getPathContext(request);
1004            }
1005    
1006            public static String getPathContext(PortletRequest portletRequest) {
1007                    return getPortal().getPathContext(portletRequest);
1008            }
1009    
1010            public static String getPathContext(String contextPath) {
1011                    return getPortal().getPathContext(contextPath);
1012            }
1013    
1014            public static String getPathFriendlyURLPrivateGroup() {
1015                    return getPortal().getPathFriendlyURLPrivateGroup();
1016            }
1017    
1018            public static String getPathFriendlyURLPrivateUser() {
1019                    return getPortal().getPathFriendlyURLPrivateUser();
1020            }
1021    
1022            public static String getPathFriendlyURLPublic() {
1023                    return getPortal().getPathFriendlyURLPublic();
1024            }
1025    
1026            public static String getPathImage() {
1027                    return getPortal().getPathImage();
1028            }
1029    
1030            public static String getPathMain() {
1031                    return getPortal().getPathMain();
1032            }
1033    
1034            public static String getPathModule() {
1035                    return getPortal().getPathModule();
1036            }
1037    
1038            public static String getPathProxy() {
1039                    return getPortal().getPathProxy();
1040            }
1041    
1042            public static long getPlidFromFriendlyURL(
1043                    long companyId, String friendlyURL) {
1044    
1045                    return getPortal().getPlidFromFriendlyURL(companyId, friendlyURL);
1046            }
1047    
1048            public static long getPlidFromPortletId(
1049                            long groupId, boolean privateLayout, String portletId)
1050                    throws PortalException, SystemException {
1051    
1052                    return getPortal().getPlidFromPortletId(
1053                            groupId, privateLayout, portletId);
1054            }
1055    
1056            public static long getPlidFromPortletId(long groupId, String portletId)
1057                    throws PortalException, SystemException {
1058    
1059                    return getPortal().getPlidFromPortletId(groupId, portletId);
1060            }
1061    
1062            public static Portal getPortal() {
1063                    PortalRuntimePermission.checkGetBeanProperty(PortalUtil.class);
1064    
1065                    return _portal;
1066            }
1067    
1068            public static String getPortalLibDir() {
1069                    return getPortal().getPortalLibDir();
1070            }
1071    
1072            /**
1073             * @deprecated As of 6.1.0, replaced by {@link #getPortalPort(boolean)}
1074             */
1075            public static int getPortalPort() {
1076                    return getPortal().getPortalPort();
1077            }
1078    
1079            public static int getPortalPort(boolean secure) {
1080                    return getPortal().getPortalPort(secure);
1081            }
1082    
1083            public static Properties getPortalProperties() {
1084                    return getPortal().getPortalProperties();
1085            }
1086    
1087            public static String getPortalURL(HttpServletRequest request) {
1088                    return getPortal().getPortalURL(request);
1089            }
1090    
1091            public static String getPortalURL(
1092                    HttpServletRequest request, boolean secure) {
1093    
1094                    return getPortal().getPortalURL(request, secure);
1095            }
1096    
1097            public static String getPortalURL(Layout layout, ThemeDisplay themeDisplay)
1098                    throws PortalException, SystemException {
1099    
1100                    return getPortal().getPortalURL(layout, themeDisplay);
1101            }
1102    
1103            public static String getPortalURL(PortletRequest portletRequest) {
1104                    return getPortal().getPortalURL(portletRequest);
1105            }
1106    
1107            public static String getPortalURL(
1108                    PortletRequest portletRequest, boolean secure) {
1109    
1110                    return getPortal().getPortalURL(portletRequest, secure);
1111            }
1112    
1113            public static String getPortalURL(
1114                    String serverName, int serverPort, boolean secure) {
1115    
1116                    return getPortal().getPortalURL(serverName, serverPort, secure);
1117            }
1118    
1119            public static String getPortalURL(ThemeDisplay themeDisplay)
1120                    throws PortalException, SystemException {
1121    
1122                    return getPortal().getPortalURL(themeDisplay);
1123            }
1124    
1125            public static String getPortalWebDir() {
1126                    return getPortal().getPortalWebDir();
1127            }
1128    
1129            /**
1130             * @deprecated As of 6.2.0 replaced by {@link
1131             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletInvocationWhitelist}
1132             */
1133            public static Set<String> getPortletAddDefaultResourceCheckWhitelist() {
1134                    return getPortal().getPortletAddDefaultResourceCheckWhitelist();
1135            }
1136    
1137            /**
1138             * @deprecated As of 6.2.0 replaced by {@link
1139             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletInvocationWhitelistActions}
1140             */
1141            public static Set<String>
1142                    getPortletAddDefaultResourceCheckWhitelistActions() {
1143    
1144                    return getPortal().getPortletAddDefaultResourceCheckWhitelistActions();
1145            }
1146    
1147            /**
1148             * @deprecated As of 6.1.0, replaced by {@link
1149             *             #getPortletBreadcrumbs(HttpServletRequest)}
1150             */
1151            public static List<BreadcrumbEntry> getPortletBreadcrumbList(
1152                    HttpServletRequest request) {
1153    
1154                    return getPortal().getPortletBreadcrumbList(request);
1155            }
1156    
1157            public static List<BreadcrumbEntry> getPortletBreadcrumbs(
1158                    HttpServletRequest request) {
1159    
1160                    return getPortal().getPortletBreadcrumbs(request);
1161            }
1162    
1163            public static PortletConfig getPortletConfig(
1164                            long companyId, String portletId, ServletContext servletContext)
1165                    throws PortletException, SystemException {
1166    
1167                    Portlet portlet = PortletLocalServiceUtil.getPortletById(
1168                            companyId, portletId);
1169    
1170                    InvokerPortlet invokerPortlet = PortletInstanceFactoryUtil.create(
1171                            portlet, servletContext);
1172    
1173                    return invokerPortlet.getPortletConfig();
1174            }
1175    
1176            public static String getPortletDescription(
1177                    Portlet portlet, ServletContext servletContext, Locale locale) {
1178    
1179                    return getPortal().getPortletDescription(
1180                            portlet, servletContext, locale);
1181            }
1182    
1183            public static String getPortletDescription(Portlet portlet, User user) {
1184                    return getPortal().getPortletDescription(portlet, user);
1185            }
1186    
1187            public static String getPortletDescription(
1188                    String portletId, Locale locale) {
1189    
1190                    return getPortal().getPortletDescription(portletId, locale);
1191            }
1192    
1193            public static String getPortletDescription(
1194                    String portletId, String languageId) {
1195    
1196                    return getPortal().getPortletDescription(portletId, languageId);
1197            }
1198    
1199            public static String getPortletDescription(String portletId, User user) {
1200                    return getPortal().getPortletDescription(portletId, user);
1201            }
1202    
1203            public static String getPortletId(HttpServletRequest request) {
1204                    return getPortal().getPortletId(request);
1205            }
1206    
1207            public static String getPortletId(PortletRequest portletRequest) {
1208                    return getPortal().getPortletId(portletRequest);
1209            }
1210    
1211            public static String getPortletLongTitle(Portlet portlet, Locale locale) {
1212                    return getPortal().getPortletLongTitle(portlet, locale);
1213            }
1214    
1215            public static String getPortletLongTitle(
1216                    Portlet portlet, ServletContext servletContext, Locale locale) {
1217    
1218                    return getPortal().getPortletLongTitle(portlet, servletContext, locale);
1219            }
1220    
1221            public static String getPortletLongTitle(
1222                    Portlet portlet, String languageId) {
1223    
1224                    return getPortal().getPortletLongTitle(portlet, languageId);
1225            }
1226    
1227            public static String getPortletLongTitle(Portlet portlet, User user) {
1228                    return getPortal().getPortletLongTitle(portlet, user);
1229            }
1230    
1231            public static String getPortletLongTitle(String portletId, Locale locale) {
1232                    return getPortal().getPortletLongTitle(portletId, locale);
1233            }
1234    
1235            public static String getPortletLongTitle(
1236                    String portletId, String languageId) {
1237    
1238                    return getPortal().getPortletLongTitle(portletId, languageId);
1239            }
1240    
1241            public static String getPortletLongTitle(String portletId, User user) {
1242                    return getPortal().getPortletLongTitle(portletId, user);
1243            }
1244    
1245            public static String getPortletNamespace(String portletId) {
1246                    return getPortal().getPortletNamespace(portletId);
1247            }
1248    
1249            public static String getPortletTitle(Portlet portlet, Locale locale) {
1250                    return getPortal().getPortletTitle(portlet, locale);
1251            }
1252    
1253            public static String getPortletTitle(
1254                    Portlet portlet, ServletContext servletContext, Locale locale) {
1255    
1256                    return getPortal().getPortletTitle(portlet, servletContext, locale);
1257            }
1258    
1259            public static String getPortletTitle(Portlet portlet, String languageId) {
1260                    return getPortal().getPortletTitle(portlet, languageId);
1261            }
1262    
1263            public static String getPortletTitle(Portlet portlet, User user) {
1264                    return getPortal().getPortletTitle(portlet, user);
1265            }
1266    
1267            public static String getPortletTitle(RenderRequest renderRequest) {
1268                    return getPortal().getPortletTitle(renderRequest);
1269            }
1270    
1271            public static String getPortletTitle(RenderResponse renderResponse) {
1272                    return getPortal().getPortletTitle(renderResponse);
1273            }
1274    
1275            public static String getPortletTitle(String portletId, Locale locale) {
1276                    return getPortal().getPortletTitle(portletId, locale);
1277            }
1278    
1279            public static String getPortletTitle(String portletId, String languageId) {
1280                    return getPortal().getPortletTitle(portletId, languageId);
1281            }
1282    
1283            public static String getPortletTitle(String portletId, User user) {
1284                    return getPortal().getPortletTitle(portletId, user);
1285            }
1286    
1287            public static String getPortletXmlFileName() throws SystemException {
1288                    return getPortal().getPortletXmlFileName();
1289            }
1290    
1291            public static PortletPreferences getPreferences(
1292                    HttpServletRequest request) {
1293    
1294                    return getPortal().getPreferences(request);
1295            }
1296    
1297            public static PreferencesValidator getPreferencesValidator(
1298                    Portlet portlet) {
1299    
1300                    return getPortal().getPreferencesValidator(portlet);
1301            }
1302    
1303            public static String getRelativeHomeURL(HttpServletRequest request)
1304                    throws PortalException, SystemException {
1305    
1306                    return getPortal().getRelativeHomeURL(request);
1307            }
1308    
1309            public static long getScopeGroupId(HttpServletRequest request)
1310                    throws PortalException, SystemException {
1311    
1312                    return getPortal().getScopeGroupId(request);
1313            }
1314    
1315            public static long getScopeGroupId(
1316                            HttpServletRequest request, String portletId)
1317                    throws PortalException, SystemException {
1318    
1319                    return getPortal().getScopeGroupId(request, portletId);
1320            }
1321    
1322            public static long getScopeGroupId(
1323                            HttpServletRequest request, String portletId,
1324                            boolean checkStagingGroup)
1325                    throws PortalException, SystemException {
1326    
1327                    return getPortal().getScopeGroupId(
1328                            request, portletId, checkStagingGroup);
1329            }
1330    
1331            public static long getScopeGroupId(Layout layout) {
1332                    return getPortal().getScopeGroupId(layout);
1333            }
1334    
1335            public static long getScopeGroupId(Layout layout, String portletId) {
1336                    return getPortal().getScopeGroupId(layout, portletId);
1337            }
1338    
1339            public static long getScopeGroupId(long plid) {
1340                    return getPortal().getScopeGroupId(plid);
1341            }
1342    
1343            public static long getScopeGroupId(PortletRequest portletRequest)
1344                    throws PortalException, SystemException {
1345    
1346                    return getPortal().getScopeGroupId(portletRequest);
1347            }
1348    
1349            public static User getSelectedUser(HttpServletRequest request)
1350                    throws PortalException, SystemException {
1351    
1352                    return getPortal().getSelectedUser(request);
1353            }
1354    
1355            public static User getSelectedUser(
1356                            HttpServletRequest request, boolean checkPermission)
1357                    throws PortalException, SystemException {
1358    
1359                    return getPortal().getSelectedUser(request, checkPermission);
1360            }
1361    
1362            public static User getSelectedUser(PortletRequest portletRequest)
1363                    throws PortalException, SystemException {
1364    
1365                    return getPortal().getSelectedUser(portletRequest);
1366            }
1367    
1368            public static User getSelectedUser(
1369                            PortletRequest portletRequest, boolean checkPermission)
1370                    throws PortalException, SystemException {
1371    
1372                    return getPortal().getSelectedUser(portletRequest, checkPermission);
1373            }
1374    
1375            public static String getServletContextName() {
1376                    return getPortal().getServletContextName();
1377            }
1378    
1379            public static long[] getSharedContentSiteGroupIds(
1380                            long companyId, long groupId, long userId)
1381                    throws PortalException, SystemException {
1382    
1383                    return getPortal().getSharedContentSiteGroupIds(
1384                            companyId, groupId, userId);
1385            }
1386    
1387            public static Map<String, List<Portlet>> getSiteAdministrationCategoriesMap(
1388                            HttpServletRequest request)
1389                    throws SystemException {
1390    
1391                    return getPortal().getSiteAdministrationCategoriesMap(request);
1392            }
1393    
1394            public static PortletURL getSiteAdministrationURL(
1395                            HttpServletRequest request, ThemeDisplay themeDisplay)
1396                    throws SystemException {
1397    
1398                    return getPortal().getSiteAdministrationURL(request, themeDisplay);
1399            }
1400    
1401            public static PortletURL getSiteAdministrationURL(
1402                    HttpServletRequest request, ThemeDisplay themeDisplay,
1403                    String portletName) {
1404    
1405                    return getPortal().getSiteAdministrationURL(
1406                            request, themeDisplay, portletName);
1407            }
1408    
1409            public static PortletURL getSiteAdministrationURL(
1410                            PortletResponse portletResponse, ThemeDisplay themeDisplay)
1411                    throws SystemException {
1412    
1413                    return getPortal().getSiteAdministrationURL(
1414                            portletResponse, themeDisplay);
1415            }
1416    
1417            public static PortletURL getSiteAdministrationURL(
1418                    PortletResponse portletResponse, ThemeDisplay themeDisplay,
1419                    String portletName) {
1420    
1421                    return getPortal().getSiteAdministrationURL(
1422                            portletResponse, themeDisplay, portletName);
1423            }
1424    
1425            public static long[] getSiteAndCompanyGroupIds(long groupId)
1426                    throws PortalException, SystemException {
1427    
1428                    return getPortal().getSiteAndCompanyGroupIds(groupId);
1429            }
1430    
1431            public static long[] getSiteAndCompanyGroupIds(ThemeDisplay themeDisplay)
1432                    throws PortalException, SystemException {
1433    
1434                    return getPortal().getSiteAndCompanyGroupIds(themeDisplay);
1435            }
1436    
1437            public static Locale getSiteDefaultLocale(long groupId)
1438                    throws PortalException, SystemException {
1439    
1440                    return getPortal().getSiteDefaultLocale(groupId);
1441            }
1442    
1443            public static long getSiteGroupId(long scopeGroupId)
1444                    throws PortalException, SystemException {
1445    
1446                    return getPortal().getSiteGroupId(scopeGroupId);
1447            }
1448    
1449            public static String getSiteLoginURL(ThemeDisplay themeDisplay)
1450                    throws PortalException, SystemException {
1451    
1452                    return getPortal().getSiteLoginURL(themeDisplay);
1453            }
1454    
1455            public static String getStaticResourceURL(
1456                    HttpServletRequest request, String uri) {
1457    
1458                    return getPortal().getStaticResourceURL(request, uri);
1459            }
1460    
1461            public static String getStaticResourceURL(
1462                    HttpServletRequest request, String uri, long timestamp) {
1463    
1464                    return getPortal().getStaticResourceURL(request, uri, timestamp);
1465            }
1466    
1467            public static String getStaticResourceURL(
1468                    HttpServletRequest request, String uri, String queryString) {
1469    
1470                    return getPortal().getStaticResourceURL(request, uri, queryString);
1471            }
1472    
1473            public static String getStaticResourceURL(
1474                    HttpServletRequest request, String uri, String queryString,
1475                    long timestamp) {
1476    
1477                    return getPortal().getStaticResourceURL(
1478                            request, uri, queryString, timestamp);
1479            }
1480    
1481            public static String getStrutsAction(HttpServletRequest request) {
1482                    return getPortal().getStrutsAction(request);
1483            }
1484    
1485            public static String[] getSystemGroups() {
1486                    return getPortal().getSystemGroups();
1487            }
1488    
1489            public static String[] getSystemOrganizationRoles() {
1490                    return getPortal().getSystemOrganizationRoles();
1491            }
1492    
1493            public static String[] getSystemRoles() {
1494                    return getPortal().getSystemRoles();
1495            }
1496    
1497            public static String[] getSystemSiteRoles() {
1498                    return getPortal().getSystemSiteRoles();
1499            }
1500    
1501            public static String getUniqueElementId(
1502                    HttpServletRequest request, String namespace, String id) {
1503    
1504                    return getPortal().getUniqueElementId(request, namespace, id);
1505            }
1506    
1507            public static String getUniqueElementId(
1508                    PortletRequest request, String namespace, String id) {
1509    
1510                    return getPortal().getUniqueElementId(request, namespace, id);
1511            }
1512    
1513            public static UploadPortletRequest getUploadPortletRequest(
1514                    PortletRequest portletRequest) {
1515    
1516                    return getPortal().getUploadPortletRequest(portletRequest);
1517            }
1518    
1519            public static UploadServletRequest getUploadServletRequest(
1520                    HttpServletRequest request) {
1521    
1522                    return getPortal().getUploadServletRequest(request);
1523            }
1524    
1525            public static Date getUptime() {
1526                    return getPortal().getUptime();
1527            }
1528    
1529            public static String getURLWithSessionId(String url, String sessionId) {
1530                    return getPortal().getURLWithSessionId(url, sessionId);
1531            }
1532    
1533            public static User getUser(HttpServletRequest request)
1534                    throws PortalException, SystemException {
1535    
1536                    return getPortal().getUser(request);
1537            }
1538    
1539            public static User getUser(PortletRequest portletRequest)
1540                    throws PortalException, SystemException {
1541    
1542                    return getPortal().getUser(portletRequest);
1543            }
1544    
1545            public static String getUserEmailAddress(long userId)
1546                    throws SystemException {
1547    
1548                    return getPortal().getUserEmailAddress(userId);
1549            }
1550    
1551            public static long getUserId(HttpServletRequest request) {
1552                    return getPortal().getUserId(request);
1553            }
1554    
1555            public static long getUserId(PortletRequest portletRequest) {
1556                    return getPortal().getUserId(portletRequest);
1557            }
1558    
1559            public static String getUserName(BaseModel<?> baseModel) {
1560                    return getPortal().getUserName(baseModel);
1561            }
1562    
1563            public static String getUserName(long userId, String defaultUserName) {
1564                    return getPortal().getUserName(userId, defaultUserName);
1565            }
1566    
1567            public static String getUserName(
1568                    long userId, String defaultUserName, HttpServletRequest request) {
1569    
1570                    return getPortal().getUserName(userId, defaultUserName, request);
1571            }
1572    
1573            public static String getUserName(
1574                    long userId, String defaultUserName, String userAttribute) {
1575    
1576                    return getPortal().getUserName(userId, defaultUserName, userAttribute);
1577            }
1578    
1579            public static String getUserName(
1580                    long userId, String defaultUserName, String userAttribute,
1581                    HttpServletRequest request) {
1582    
1583                    return getPortal().getUserName(
1584                            userId, defaultUserName, userAttribute, request);
1585            }
1586    
1587            public static String getUserPassword(HttpServletRequest request) {
1588                    return getPortal().getUserPassword(request);
1589            }
1590    
1591            public static String getUserPassword(HttpSession session) {
1592                    return getPortal().getUserPassword(session);
1593            }
1594    
1595            public static String getUserPassword(PortletRequest portletRequest) {
1596                    return getPortal().getUserPassword(portletRequest);
1597            }
1598    
1599            public static String getUserValue(
1600                            long userId, String param, String defaultValue)
1601                    throws SystemException {
1602    
1603                    return getPortal().getUserValue(userId, param, defaultValue);
1604            }
1605    
1606            public static String getValidPortalDomain(long companyId, String domain) {
1607                    return getPortal().getValidPortalDomain(companyId, domain);
1608            }
1609    
1610            public static long getValidUserId(long companyId, long userId)
1611                    throws PortalException, SystemException {
1612    
1613                    return getPortal().getValidUserId(companyId, userId);
1614            }
1615    
1616            public static String getVirtualLayoutActualURL(
1617                            long groupId, boolean privateLayout, String mainPath,
1618                            String friendlyURL, Map<String, String[]> params,
1619                            Map<String, Object> requestContext)
1620                    throws PortalException, SystemException {
1621    
1622                    return getPortal().getVirtualLayoutActualURL(
1623                            groupId, privateLayout, mainPath, friendlyURL, params,
1624                            requestContext);
1625            }
1626    
1627            public static LayoutFriendlyURLComposite
1628                    getVirtualLayoutFriendlyURLComposite(
1629                            boolean privateLayout, String friendlyURL,
1630                            Map<String, String[]> params, Map<String, Object> requestContext)
1631                    throws PortalException, SystemException {
1632    
1633                    return getPortal().getVirtualLayoutFriendlyURLComposite(
1634                            privateLayout, friendlyURL, params, requestContext);
1635            }
1636    
1637            public static String getWidgetURL(
1638                            Portlet portlet, ThemeDisplay themeDisplay)
1639                    throws PortalException, SystemException {
1640    
1641                    return getPortal().getWidgetURL(portlet, themeDisplay);
1642            }
1643    
1644            public static void initCustomSQL() {
1645                    getPortal().initCustomSQL();
1646            }
1647    
1648            public static User initUser(HttpServletRequest request) throws Exception {
1649                    return getPortal().initUser(request);
1650            }
1651    
1652            public static void invokeTaglibDiscussion(
1653                            PortletConfig portletConfig, ActionRequest actionRequest,
1654                            ActionResponse actionResponse)
1655                    throws Exception {
1656    
1657                    getPortal().invokeTaglibDiscussion(
1658                            portletConfig, actionRequest, actionResponse);
1659            }
1660    
1661            /**
1662             * @deprecated As of 6.2.0 with no direct replacement
1663             */
1664            public static boolean isAllowAddPortletDefaultResource(
1665                            HttpServletRequest request, Portlet portlet)
1666                    throws PortalException, SystemException {
1667    
1668                    return getPortal().isAllowAddPortletDefaultResource(request, portlet);
1669            }
1670    
1671            public static boolean isCDNDynamicResourcesEnabled(
1672                            HttpServletRequest request)
1673                    throws PortalException, SystemException {
1674    
1675                    return getPortal().isCDNDynamicResourcesEnabled(request);
1676            }
1677    
1678            public static boolean isCDNDynamicResourcesEnabled(long companyId) {
1679                    return getPortal().isCDNDynamicResourcesEnabled(companyId);
1680            }
1681    
1682            /**
1683             * @deprecated As of 6.1.0, renamed to {@link #isGroupAdmin(User, long)}
1684             */
1685            public static boolean isCommunityAdmin(User user, long groupId)
1686                    throws Exception {
1687    
1688                    return getPortal().isCommunityAdmin(user, groupId);
1689            }
1690    
1691            /**
1692             * @deprecated As of 6.1.0, renamed to {@link #isGroupOwner(User, long)}
1693             */
1694            public static boolean isCommunityOwner(User user, long groupId)
1695                    throws Exception {
1696    
1697                    return getPortal().isCommunityOwner(user, groupId);
1698            }
1699    
1700            public static boolean isCompanyAdmin(User user) throws Exception {
1701                    return getPortal().isCompanyAdmin(user);
1702            }
1703    
1704            public static boolean isCompanyControlPanelPortlet(
1705                            String portletId, String category, ThemeDisplay themeDisplay)
1706                    throws PortalException, SystemException {
1707    
1708                    return getPortal().isCompanyControlPanelPortlet(
1709                            portletId, category, themeDisplay);
1710            }
1711    
1712            public static boolean isCompanyControlPanelPortlet(
1713                            String portletId, ThemeDisplay themeDisplay)
1714                    throws PortalException, SystemException {
1715    
1716                    return getPortal().isCompanyControlPanelPortlet(
1717                            portletId, themeDisplay);
1718            }
1719    
1720            public static boolean isCompanyControlPanelVisible(
1721                            ThemeDisplay themeDisplay)
1722                    throws PortalException, SystemException {
1723    
1724                    return getPortal().isCompanyControlPanelVisible(themeDisplay);
1725            }
1726    
1727            public static boolean isControlPanelPortlet(
1728                            String portletId, String category, ThemeDisplay themeDisplay)
1729                    throws SystemException {
1730    
1731                    return getPortal().isControlPanelPortlet(
1732                            portletId, category, themeDisplay);
1733            }
1734    
1735            public static boolean isControlPanelPortlet(
1736                            String portletId, ThemeDisplay themeDisplay)
1737                    throws SystemException {
1738    
1739                    return getPortal().isControlPanelPortlet(portletId, themeDisplay);
1740            }
1741    
1742            public static boolean isGroupAdmin(User user, long groupId)
1743                    throws Exception {
1744    
1745                    return getPortal().isGroupAdmin(user, groupId);
1746            }
1747    
1748            public static boolean isGroupFriendlyURL(
1749                    String fullURL, String groupFriendlyURL, String layoutFriendlyURL) {
1750    
1751                    return getPortal().isGroupFriendlyURL(
1752                            fullURL, groupFriendlyURL, layoutFriendlyURL);
1753            }
1754    
1755            public static boolean isGroupOwner(User user, long groupId)
1756                    throws Exception {
1757    
1758                    return getPortal().isGroupOwner(user, groupId);
1759            }
1760    
1761            public static boolean isLayoutDescendant(Layout layout, long layoutId)
1762                    throws PortalException, SystemException {
1763    
1764                    return getPortal().isLayoutDescendant(layout, layoutId);
1765            }
1766    
1767            public static boolean isLayoutFirstPageable(Layout layout) {
1768                    return getPortal().isLayoutFirstPageable(layout);
1769            }
1770    
1771            public static boolean isLayoutFirstPageable(String type) {
1772                    return getPortal().isLayoutFirstPageable(type);
1773            }
1774    
1775            public static boolean isLayoutFriendliable(Layout layout) {
1776                    return getPortal().isLayoutFriendliable(layout);
1777            }
1778    
1779            public static boolean isLayoutFriendliable(String type) {
1780                    return getPortal().isLayoutFriendliable(type);
1781            }
1782    
1783            public static boolean isLayoutParentable(Layout layout) {
1784                    return getPortal().isLayoutParentable(layout);
1785            }
1786    
1787            public static boolean isLayoutParentable(String type) {
1788                    return getPortal().isLayoutParentable(type);
1789            }
1790    
1791            public static boolean isLayoutSitemapable(Layout layout) {
1792                    return getPortal().isLayoutSitemapable(layout);
1793            }
1794    
1795            public static boolean isLoginRedirectRequired(HttpServletRequest request)
1796                    throws SystemException {
1797    
1798                    return getPortal().isLoginRedirectRequired(request);
1799            }
1800    
1801            public static boolean isMethodGet(PortletRequest portletRequest) {
1802                    return getPortal().isMethodGet(portletRequest);
1803            }
1804    
1805            public static boolean isMethodPost(PortletRequest portletRequest) {
1806                    return getPortal().isMethodPost(portletRequest);
1807            }
1808    
1809            public static boolean isMultipartRequest(HttpServletRequest request) {
1810                    return getPortal().isMultipartRequest(request);
1811            }
1812    
1813            public static boolean isOmniadmin(long userId) {
1814                    return getPortal().isOmniadmin(userId);
1815            }
1816    
1817            public static boolean isReservedParameter(String name) {
1818                    return getPortal().isReservedParameter(name);
1819            }
1820    
1821            public static boolean isRSSFeedsEnabled() {
1822                    return getPortal().isRSSFeedsEnabled();
1823            }
1824    
1825            public static boolean isSecure(HttpServletRequest request) {
1826                    return getPortal().isSecure(request);
1827            }
1828    
1829            public static boolean isSystemGroup(String groupName) {
1830                    return getPortal().isSystemGroup(groupName);
1831            }
1832    
1833            public static boolean isSystemRole(String roleName) {
1834                    return getPortal().isSystemRole(roleName);
1835            }
1836    
1837            public static boolean isUpdateAvailable() throws SystemException {
1838                    return getPortal().isUpdateAvailable();
1839            }
1840    
1841            public static boolean isValidResourceId(String resourceId) {
1842                    return getPortal().isValidResourceId(resourceId);
1843            }
1844    
1845            public static void resetCDNHosts() {
1846                    getPortal().resetCDNHosts();
1847            }
1848    
1849            /**
1850             * @deprecated As of 6.2.0 replaced by {@link
1851             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#resetPortletInvocationWhitelist}
1852             */
1853            public static Set<String> resetPortletAddDefaultResourceCheckWhitelist() {
1854                    return getPortal().resetPortletAddDefaultResourceCheckWhitelist();
1855            }
1856    
1857            /**
1858             * @deprecated As of 6.2.0 replaced by {@link
1859             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#resetPortletInvocationWhitelistActions}
1860             */
1861            public static Set<String>
1862                    resetPortletAddDefaultResourceCheckWhitelistActions() {
1863    
1864                    return getPortal().
1865                            resetPortletAddDefaultResourceCheckWhitelistActions();
1866            }
1867    
1868            public static String resetPortletParameters(String url, String portletId) {
1869                    return getPortal().resetPortletParameters(url, portletId);
1870            }
1871    
1872            /**
1873             * @deprecated As of 6.1.0, replaced by {@link DB#runSQL(String)}
1874             */
1875            public static void runSQL(String sql) throws IOException, SQLException {
1876                    DBFactoryUtil.getDB().runSQL(sql);
1877            }
1878    
1879            public static void sendError(
1880                            Exception e, ActionRequest actionRequest,
1881                            ActionResponse actionResponse)
1882                    throws IOException {
1883    
1884                    getPortal().sendError(e, actionRequest, actionResponse);
1885            }
1886    
1887            public static void sendError(
1888                            Exception e, HttpServletRequest request,
1889                            HttpServletResponse response)
1890                    throws IOException, ServletException {
1891    
1892                    getPortal().sendError(e, request, response);
1893            }
1894    
1895            public static void sendError(
1896                            int status, Exception e, ActionRequest actionRequest,
1897                            ActionResponse actionResponse)
1898                    throws IOException {
1899    
1900                    getPortal().sendError(status, e, actionRequest, actionResponse);
1901            }
1902    
1903            public static void sendError(
1904                            int status, Exception e, HttpServletRequest request,
1905                            HttpServletResponse response)
1906                    throws IOException, ServletException {
1907    
1908                    getPortal().sendError(status, e, request, response);
1909            }
1910    
1911            public static void sendRSSFeedsDisabledError(
1912                            HttpServletRequest request, HttpServletResponse response)
1913                    throws IOException, ServletException {
1914    
1915                    getPortal().sendRSSFeedsDisabledError(request, response);
1916            }
1917    
1918            public static void sendRSSFeedsDisabledError(
1919                            PortletRequest portletRequest, PortletResponse portletResponse)
1920                    throws IOException, ServletException {
1921    
1922                    getPortal().sendRSSFeedsDisabledError(portletRequest, portletResponse);
1923            }
1924    
1925            /**
1926             * Sets the description for a page. This overrides the existing page
1927             * description.
1928             */
1929            public static void setPageDescription(
1930                    String description, HttpServletRequest request) {
1931    
1932                    getPortal().setPageDescription(description, request);
1933            }
1934    
1935            /**
1936             * Sets the keywords for a page. This overrides the existing page keywords.
1937             */
1938            public static void setPageKeywords(
1939                    String keywords, HttpServletRequest request) {
1940    
1941                    getPortal().setPageKeywords(keywords, request);
1942            }
1943    
1944            /**
1945             * Sets the subtitle for a page. This overrides the existing page subtitle.
1946             */
1947            public static void setPageSubtitle(
1948                    String subtitle, HttpServletRequest request) {
1949    
1950                    getPortal().setPageSubtitle(subtitle, request);
1951            }
1952    
1953            /**
1954             * Sets the whole title for a page. This overrides the existing page whole
1955             * title.
1956             */
1957            public static void setPageTitle(String title, HttpServletRequest request) {
1958                    getPortal().setPageTitle(title, request);
1959            }
1960    
1961            /**
1962             * Sets the port obtained on the first request to the portal.
1963             */
1964            public static void setPortalPort(HttpServletRequest request) {
1965                    getPortal().setPortalPort(request);
1966            }
1967    
1968            public static void storePreferences(PortletPreferences portletPreferences)
1969                    throws IOException, ValidatorException {
1970    
1971                    getPortal().storePreferences(portletPreferences);
1972            }
1973    
1974            public static String[] stripURLAnchor(String url, String separator) {
1975                    return getPortal().stripURLAnchor(url, separator);
1976            }
1977    
1978            public static String transformCustomSQL(String sql) {
1979                    return getPortal().transformCustomSQL(sql);
1980            }
1981    
1982            public static String transformSQL(String sql) {
1983                    return getPortal().transformSQL(sql);
1984            }
1985    
1986            public static PortletMode updatePortletMode(
1987                    String portletId, User user, Layout layout, PortletMode portletMode,
1988                    HttpServletRequest request) {
1989    
1990                    return getPortal().updatePortletMode(
1991                            portletId, user, layout, portletMode, request);
1992            }
1993    
1994            public static String updateRedirect(
1995                    String redirect, String oldPath, String newPath) {
1996    
1997                    return getPortal().updateRedirect(redirect, oldPath, newPath);
1998            }
1999    
2000            public static WindowState updateWindowState(
2001                    String portletId, User user, Layout layout, WindowState windowState,
2002                    HttpServletRequest request) {
2003    
2004                    return getPortal().updateWindowState(
2005                            portletId, user, layout, windowState, request);
2006            }
2007    
2008            public void removePortalPortEventListener(
2009                    PortalPortEventListener portalPortEventListener) {
2010    
2011                    getPortal().removePortalPortEventListener(portalPortEventListener);
2012            }
2013    
2014            public void setPortal(Portal portal) {
2015                    PortalRuntimePermission.checkSetBeanProperty(getClass());
2016    
2017                    _portal = portal;
2018            }
2019    
2020            private static Portal _portal;
2021    
2022    }