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