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