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