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 getPathFriendlyURLPrivateGroup() {
959                    return getPortal().getPathFriendlyURLPrivateGroup();
960            }
961    
962            public static String getPathFriendlyURLPrivateUser() {
963                    return getPortal().getPathFriendlyURLPrivateUser();
964            }
965    
966            public static String getPathFriendlyURLPublic() {
967                    return getPortal().getPathFriendlyURLPublic();
968            }
969    
970            public static String getPathImage() {
971                    return getPortal().getPathImage();
972            }
973    
974            public static String getPathMain() {
975                    return getPortal().getPathMain();
976            }
977    
978            public static String getPathModule() {
979                    return getPortal().getPathModule();
980            }
981    
982            public static String getPathProxy() {
983                    return getPortal().getPathProxy();
984            }
985    
986            public static long getPlidFromFriendlyURL(
987                    long companyId, String friendlyURL) {
988    
989                    return getPortal().getPlidFromFriendlyURL(companyId, friendlyURL);
990            }
991    
992            public static long getPlidFromPortletId(
993                            long groupId, boolean privateLayout, String portletId)
994                    throws PortalException, SystemException {
995    
996                    return getPortal().getPlidFromPortletId(
997                            groupId, privateLayout, portletId);
998            }
999    
1000            public static long getPlidFromPortletId(long groupId, String portletId)
1001                    throws PortalException, SystemException {
1002    
1003                    return getPortal().getPlidFromPortletId(groupId, portletId);
1004            }
1005    
1006            public static Portal getPortal() {
1007                    PortalRuntimePermission.checkGetBeanProperty(PortalUtil.class);
1008    
1009                    return _portal;
1010            }
1011    
1012            public static String getPortalLibDir() {
1013                    return getPortal().getPortalLibDir();
1014            }
1015    
1016            /**
1017             * @deprecated As of 6.1.0, replaced by {@link #getPortalPort(boolean)}
1018             */
1019            public static int getPortalPort() {
1020                    return getPortal().getPortalPort();
1021            }
1022    
1023            public static int getPortalPort(boolean secure) {
1024                    return getPortal().getPortalPort(secure);
1025            }
1026    
1027            public static Properties getPortalProperties() {
1028                    return getPortal().getPortalProperties();
1029            }
1030    
1031            public static String getPortalURL(HttpServletRequest request) {
1032                    return getPortal().getPortalURL(request);
1033            }
1034    
1035            public static String getPortalURL(
1036                    HttpServletRequest request, boolean secure) {
1037    
1038                    return getPortal().getPortalURL(request, secure);
1039            }
1040    
1041            public static String getPortalURL(Layout layout, ThemeDisplay themeDisplay)
1042                    throws PortalException, SystemException {
1043    
1044                    return getPortal().getPortalURL(layout, themeDisplay);
1045            }
1046    
1047            public static String getPortalURL(PortletRequest portletRequest) {
1048                    return getPortal().getPortalURL(portletRequest);
1049            }
1050    
1051            public static String getPortalURL(
1052                    PortletRequest portletRequest, boolean secure) {
1053    
1054                    return getPortal().getPortalURL(portletRequest, secure);
1055            }
1056    
1057            public static String getPortalURL(
1058                    String serverName, int serverPort, boolean secure) {
1059    
1060                    return getPortal().getPortalURL(serverName, serverPort, secure);
1061            }
1062    
1063            public static String getPortalURL(ThemeDisplay themeDisplay)
1064                    throws PortalException, SystemException {
1065    
1066                    return getPortal().getPortalURL(themeDisplay);
1067            }
1068    
1069            public static String getPortalWebDir() {
1070                    return getPortal().getPortalWebDir();
1071            }
1072    
1073            /**
1074             * @deprecated As of 6.2.0 replaced by {@link
1075             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletInvocationWhitelist}
1076             */
1077            public static Set<String> getPortletAddDefaultResourceCheckWhitelist() {
1078                    return getPortal().getPortletAddDefaultResourceCheckWhitelist();
1079            }
1080    
1081            /**
1082             * @deprecated As of 6.2.0 replaced by {@link
1083             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletInvocationWhitelistActions}
1084             */
1085            public static Set<String>
1086                    getPortletAddDefaultResourceCheckWhitelistActions() {
1087    
1088                    return getPortal().getPortletAddDefaultResourceCheckWhitelistActions();
1089            }
1090    
1091            /**
1092             * @deprecated As of 6.1.0, replaced by {@link
1093             *             #getPortletBreadcrumbs(HttpServletRequest)}
1094             */
1095            public static List<BreadcrumbEntry> getPortletBreadcrumbList(
1096                    HttpServletRequest request) {
1097    
1098                    return getPortal().getPortletBreadcrumbList(request);
1099            }
1100    
1101            public static List<BreadcrumbEntry> getPortletBreadcrumbs(
1102                    HttpServletRequest request) {
1103    
1104                    return getPortal().getPortletBreadcrumbs(request);
1105            }
1106    
1107            public static PortletConfig getPortletConfig(
1108                            long companyId, String portletId, ServletContext servletContext)
1109                    throws PortletException, SystemException {
1110    
1111                    Portlet portlet = PortletLocalServiceUtil.getPortletById(
1112                            companyId, portletId);
1113    
1114                    InvokerPortlet invokerPortlet = PortletInstanceFactoryUtil.create(
1115                            portlet, servletContext);
1116    
1117                    return invokerPortlet.getPortletConfig();
1118            }
1119    
1120            public static String getPortletDescription(
1121                    Portlet portlet, ServletContext servletContext, Locale locale) {
1122    
1123                    return getPortal().getPortletDescription(
1124                            portlet, servletContext, locale);
1125            }
1126    
1127            public static String getPortletDescription(Portlet portlet, User user) {
1128                    return getPortal().getPortletDescription(portlet, user);
1129            }
1130    
1131            public static String getPortletDescription(
1132                    String portletId, Locale locale) {
1133    
1134                    return getPortal().getPortletDescription(portletId, locale);
1135            }
1136    
1137            public static String getPortletDescription(
1138                    String portletId, String languageId) {
1139    
1140                    return getPortal().getPortletDescription(portletId, languageId);
1141            }
1142    
1143            public static String getPortletDescription(String portletId, User user) {
1144                    return getPortal().getPortletDescription(portletId, user);
1145            }
1146    
1147            public static String getPortletId(HttpServletRequest request) {
1148                    return getPortal().getPortletId(request);
1149            }
1150    
1151            public static String getPortletId(PortletRequest portletRequest) {
1152                    return getPortal().getPortletId(portletRequest);
1153            }
1154    
1155            public static String getPortletLongTitle(Portlet portlet, Locale locale) {
1156                    return getPortal().getPortletLongTitle(portlet, locale);
1157            }
1158    
1159            public static String getPortletLongTitle(
1160                    Portlet portlet, ServletContext servletContext, Locale locale) {
1161    
1162                    return getPortal().getPortletLongTitle(portlet, servletContext, locale);
1163            }
1164    
1165            public static String getPortletLongTitle(
1166                    Portlet portlet, String languageId) {
1167    
1168                    return getPortal().getPortletLongTitle(portlet, languageId);
1169            }
1170    
1171            public static String getPortletLongTitle(Portlet portlet, User user) {
1172                    return getPortal().getPortletLongTitle(portlet, user);
1173            }
1174    
1175            public static String getPortletLongTitle(String portletId, Locale locale) {
1176                    return getPortal().getPortletLongTitle(portletId, locale);
1177            }
1178    
1179            public static String getPortletLongTitle(
1180                    String portletId, String languageId) {
1181    
1182                    return getPortal().getPortletLongTitle(portletId, languageId);
1183            }
1184    
1185            public static String getPortletLongTitle(String portletId, User user) {
1186                    return getPortal().getPortletLongTitle(portletId, user);
1187            }
1188    
1189            public static String getPortletNamespace(String portletId) {
1190                    return getPortal().getPortletNamespace(portletId);
1191            }
1192    
1193            public static String getPortletTitle(Portlet portlet, Locale locale) {
1194                    return getPortal().getPortletTitle(portlet, locale);
1195            }
1196    
1197            public static String getPortletTitle(
1198                    Portlet portlet, ServletContext servletContext, Locale locale) {
1199    
1200                    return getPortal().getPortletTitle(portlet, servletContext, locale);
1201            }
1202    
1203            public static String getPortletTitle(Portlet portlet, String languageId) {
1204                    return getPortal().getPortletTitle(portlet, languageId);
1205            }
1206    
1207            public static String getPortletTitle(Portlet portlet, User user) {
1208                    return getPortal().getPortletTitle(portlet, user);
1209            }
1210    
1211            public static String getPortletTitle(RenderRequest renderRequest) {
1212                    return getPortal().getPortletTitle(renderRequest);
1213            }
1214    
1215            public static String getPortletTitle(RenderResponse renderResponse) {
1216                    return getPortal().getPortletTitle(renderResponse);
1217            }
1218    
1219            public static String getPortletTitle(String portletId, Locale locale) {
1220                    return getPortal().getPortletTitle(portletId, locale);
1221            }
1222    
1223            public static String getPortletTitle(String portletId, String languageId) {
1224                    return getPortal().getPortletTitle(portletId, languageId);
1225            }
1226    
1227            public static String getPortletTitle(String portletId, User user) {
1228                    return getPortal().getPortletTitle(portletId, user);
1229            }
1230    
1231            public static String getPortletXmlFileName() throws SystemException {
1232                    return getPortal().getPortletXmlFileName();
1233            }
1234    
1235            public static PortletPreferences getPreferences(
1236                    HttpServletRequest request) {
1237    
1238                    return getPortal().getPreferences(request);
1239            }
1240    
1241            public static PreferencesValidator getPreferencesValidator(
1242                    Portlet portlet) {
1243    
1244                    return getPortal().getPreferencesValidator(portlet);
1245            }
1246    
1247            public static String getRelativeHomeURL(HttpServletRequest request)
1248                    throws PortalException, SystemException {
1249    
1250                    return getPortal().getRelativeHomeURL(request);
1251            }
1252    
1253            public static long getScopeGroupId(HttpServletRequest request)
1254                    throws PortalException, SystemException {
1255    
1256                    return getPortal().getScopeGroupId(request);
1257            }
1258    
1259            public static long getScopeGroupId(
1260                            HttpServletRequest request, String portletId)
1261                    throws PortalException, SystemException {
1262    
1263                    return getPortal().getScopeGroupId(request, portletId);
1264            }
1265    
1266            public static long getScopeGroupId(
1267                            HttpServletRequest request, String portletId,
1268                            boolean checkStagingGroup)
1269                    throws PortalException, SystemException {
1270    
1271                    return getPortal().getScopeGroupId(
1272                            request, portletId, checkStagingGroup);
1273            }
1274    
1275            public static long getScopeGroupId(Layout layout) {
1276                    return getPortal().getScopeGroupId(layout);
1277            }
1278    
1279            public static long getScopeGroupId(Layout layout, String portletId) {
1280                    return getPortal().getScopeGroupId(layout, portletId);
1281            }
1282    
1283            public static long getScopeGroupId(long plid) {
1284                    return getPortal().getScopeGroupId(plid);
1285            }
1286    
1287            public static long getScopeGroupId(PortletRequest portletRequest)
1288                    throws PortalException, SystemException {
1289    
1290                    return getPortal().getScopeGroupId(portletRequest);
1291            }
1292    
1293            public static User getSelectedUser(HttpServletRequest request)
1294                    throws PortalException, SystemException {
1295    
1296                    return getPortal().getSelectedUser(request);
1297            }
1298    
1299            public static User getSelectedUser(
1300                            HttpServletRequest request, boolean checkPermission)
1301                    throws PortalException, SystemException {
1302    
1303                    return getPortal().getSelectedUser(request, checkPermission);
1304            }
1305    
1306            public static User getSelectedUser(PortletRequest portletRequest)
1307                    throws PortalException, SystemException {
1308    
1309                    return getPortal().getSelectedUser(portletRequest);
1310            }
1311    
1312            public static User getSelectedUser(
1313                            PortletRequest portletRequest, boolean checkPermission)
1314                    throws PortalException, SystemException {
1315    
1316                    return getPortal().getSelectedUser(portletRequest, checkPermission);
1317            }
1318    
1319            public static String getServletContextName() {
1320                    return getPortal().getServletContextName();
1321            }
1322    
1323            public static Map<String, List<Portlet>> getSiteAdministrationCategoriesMap(
1324                            HttpServletRequest request)
1325                    throws SystemException {
1326    
1327                    return getPortal().getSiteAdministrationCategoriesMap(request);
1328            }
1329    
1330            public static PortletURL getSiteAdministrationURL(
1331                            HttpServletRequest request, ThemeDisplay themeDisplay)
1332                    throws SystemException {
1333    
1334                    return getPortal().getSiteAdministrationURL(request, themeDisplay);
1335            }
1336    
1337            public static PortletURL getSiteAdministrationURL(
1338                    HttpServletRequest request, ThemeDisplay themeDisplay,
1339                    String portletName) {
1340    
1341                    return getPortal().getSiteAdministrationURL(
1342                            request, themeDisplay, portletName);
1343            }
1344    
1345            public static PortletURL getSiteAdministrationURL(
1346                            PortletResponse portletResponse, ThemeDisplay themeDisplay)
1347                    throws SystemException {
1348    
1349                    return getPortal().getSiteAdministrationURL(
1350                            portletResponse, themeDisplay);
1351            }
1352    
1353            public static PortletURL getSiteAdministrationURL(
1354                    PortletResponse portletResponse, ThemeDisplay themeDisplay,
1355                    String portletName) {
1356    
1357                    return getPortal().getSiteAdministrationURL(
1358                            portletResponse, themeDisplay, portletName);
1359            }
1360    
1361            public static long[] getSiteAndCompanyGroupIds(long groupId)
1362                    throws PortalException, SystemException {
1363    
1364                    return getPortal().getSiteAndCompanyGroupIds(groupId);
1365            }
1366    
1367            public static long[] getSiteAndCompanyGroupIds(ThemeDisplay themeDisplay)
1368                    throws PortalException, SystemException {
1369    
1370                    return getPortal().getSiteAndCompanyGroupIds(themeDisplay);
1371            }
1372    
1373            public static Locale getSiteDefaultLocale(long groupId)
1374                    throws PortalException, SystemException {
1375    
1376                    return getPortal().getSiteDefaultLocale(groupId);
1377            }
1378    
1379            public static long getSiteGroupId(long scopeGroupId)
1380                    throws PortalException, SystemException {
1381    
1382                    return getPortal().getSiteGroupId(scopeGroupId);
1383            }
1384    
1385            public static String getSiteLoginURL(ThemeDisplay themeDisplay)
1386                    throws PortalException, SystemException {
1387    
1388                    return getPortal().getSiteLoginURL(themeDisplay);
1389            }
1390    
1391            public static String getStaticResourceURL(
1392                    HttpServletRequest request, String uri) {
1393    
1394                    return getPortal().getStaticResourceURL(request, uri);
1395            }
1396    
1397            public static String getStaticResourceURL(
1398                    HttpServletRequest request, String uri, long timestamp) {
1399    
1400                    return getPortal().getStaticResourceURL(request, uri, timestamp);
1401            }
1402    
1403            public static String getStaticResourceURL(
1404                    HttpServletRequest request, String uri, String queryString) {
1405    
1406                    return getPortal().getStaticResourceURL(request, uri, queryString);
1407            }
1408    
1409            public static String getStaticResourceURL(
1410                    HttpServletRequest request, String uri, String queryString,
1411                    long timestamp) {
1412    
1413                    return getPortal().getStaticResourceURL(
1414                            request, uri, queryString, timestamp);
1415            }
1416    
1417            public static String getStrutsAction(HttpServletRequest request) {
1418                    return getPortal().getStrutsAction(request);
1419            }
1420    
1421            public static String[] getSystemGroups() {
1422                    return getPortal().getSystemGroups();
1423            }
1424    
1425            public static String[] getSystemOrganizationRoles() {
1426                    return getPortal().getSystemOrganizationRoles();
1427            }
1428    
1429            public static String[] getSystemRoles() {
1430                    return getPortal().getSystemRoles();
1431            }
1432    
1433            public static String[] getSystemSiteRoles() {
1434                    return getPortal().getSystemSiteRoles();
1435            }
1436    
1437            public static String getUniqueElementId(
1438                    HttpServletRequest request, String namespace, String id) {
1439    
1440                    return getPortal().getUniqueElementId(request, namespace, id);
1441            }
1442    
1443            public static String getUniqueElementId(
1444                    PortletRequest request, String namespace, String id) {
1445    
1446                    return getPortal().getUniqueElementId(request, namespace, id);
1447            }
1448    
1449            public static UploadPortletRequest getUploadPortletRequest(
1450                    PortletRequest portletRequest) {
1451    
1452                    return getPortal().getUploadPortletRequest(portletRequest);
1453            }
1454    
1455            public static UploadServletRequest getUploadServletRequest(
1456                    HttpServletRequest request) {
1457    
1458                    return getPortal().getUploadServletRequest(request);
1459            }
1460    
1461            public static Date getUptime() {
1462                    return getPortal().getUptime();
1463            }
1464    
1465            public static String getURLWithSessionId(String url, String sessionId) {
1466                    return getPortal().getURLWithSessionId(url, sessionId);
1467            }
1468    
1469            public static User getUser(HttpServletRequest request)
1470                    throws PortalException, SystemException {
1471    
1472                    return getPortal().getUser(request);
1473            }
1474    
1475            public static User getUser(PortletRequest portletRequest)
1476                    throws PortalException, SystemException {
1477    
1478                    return getPortal().getUser(portletRequest);
1479            }
1480    
1481            public static String getUserEmailAddress(long userId)
1482                    throws SystemException {
1483    
1484                    return getPortal().getUserEmailAddress(userId);
1485            }
1486    
1487            public static long getUserId(HttpServletRequest request) {
1488                    return getPortal().getUserId(request);
1489            }
1490    
1491            public static long getUserId(PortletRequest portletRequest) {
1492                    return getPortal().getUserId(portletRequest);
1493            }
1494    
1495            public static String getUserName(BaseModel<?> baseModel) {
1496                    return getPortal().getUserName(baseModel);
1497            }
1498    
1499            public static String getUserName(long userId, String defaultUserName) {
1500                    return getPortal().getUserName(userId, defaultUserName);
1501            }
1502    
1503            public static String getUserName(
1504                    long userId, String defaultUserName, HttpServletRequest request) {
1505    
1506                    return getPortal().getUserName(userId, defaultUserName, request);
1507            }
1508    
1509            public static String getUserName(
1510                    long userId, String defaultUserName, String userAttribute) {
1511    
1512                    return getPortal().getUserName(userId, defaultUserName, userAttribute);
1513            }
1514    
1515            public static String getUserName(
1516                    long userId, String defaultUserName, String userAttribute,
1517                    HttpServletRequest request) {
1518    
1519                    return getPortal().getUserName(
1520                            userId, defaultUserName, userAttribute, request);
1521            }
1522    
1523            public static String getUserPassword(HttpServletRequest request) {
1524                    return getPortal().getUserPassword(request);
1525            }
1526    
1527            public static String getUserPassword(HttpSession session) {
1528                    return getPortal().getUserPassword(session);
1529            }
1530    
1531            public static String getUserPassword(PortletRequest portletRequest) {
1532                    return getPortal().getUserPassword(portletRequest);
1533            }
1534    
1535            public static String getUserValue(
1536                            long userId, String param, String defaultValue)
1537                    throws SystemException {
1538    
1539                    return getPortal().getUserValue(userId, param, defaultValue);
1540            }
1541    
1542            public static long getValidUserId(long companyId, long userId)
1543                    throws PortalException, SystemException {
1544    
1545                    return getPortal().getValidUserId(companyId, userId);
1546            }
1547    
1548            public static String getVirtualLayoutActualURL(
1549                            long groupId, boolean privateLayout, String mainPath,
1550                            String friendlyURL, Map<String, String[]> params,
1551                            Map<String, Object> requestContext)
1552                    throws PortalException, SystemException {
1553    
1554                    return getPortal().getVirtualLayoutActualURL(
1555                            groupId, privateLayout, mainPath, friendlyURL, params,
1556                            requestContext);
1557            }
1558    
1559            public static LayoutFriendlyURLComposite
1560                    getVirtualLayoutFriendlyURLComposite(
1561                            boolean privateLayout, String friendlyURL,
1562                            Map<String, String[]> params, Map<String, Object> requestContext)
1563                    throws PortalException, SystemException {
1564    
1565                    return getPortal().getVirtualLayoutFriendlyURLComposite(
1566                            privateLayout, friendlyURL, params, requestContext);
1567            }
1568    
1569            public static String getWidgetURL(
1570                            Portlet portlet, ThemeDisplay themeDisplay)
1571                    throws PortalException, SystemException {
1572    
1573                    return getPortal().getWidgetURL(portlet, themeDisplay);
1574            }
1575    
1576            public static void initCustomSQL() {
1577                    getPortal().initCustomSQL();
1578            }
1579    
1580            public static User initUser(HttpServletRequest request) throws Exception {
1581                    return getPortal().initUser(request);
1582            }
1583    
1584            public static void invokeTaglibDiscussion(
1585                            PortletConfig portletConfig, ActionRequest actionRequest,
1586                            ActionResponse actionResponse)
1587                    throws Exception {
1588    
1589                    getPortal().invokeTaglibDiscussion(
1590                            portletConfig, actionRequest, actionResponse);
1591            }
1592    
1593            /**
1594             * @deprecated As of 6.2.0 with no direct replacement
1595             */
1596            public static boolean isAllowAddPortletDefaultResource(
1597                            HttpServletRequest request, Portlet portlet)
1598                    throws PortalException, SystemException {
1599    
1600                    return getPortal().isAllowAddPortletDefaultResource(request, portlet);
1601            }
1602    
1603            public static boolean isCDNDynamicResourcesEnabled(
1604                            HttpServletRequest request)
1605                    throws PortalException, SystemException {
1606    
1607                    return getPortal().isCDNDynamicResourcesEnabled(request);
1608            }
1609    
1610            public static boolean isCDNDynamicResourcesEnabled(long companyId) {
1611                    return getPortal().isCDNDynamicResourcesEnabled(companyId);
1612            }
1613    
1614            /**
1615             * @deprecated As of 6.1.0, renamed to {@link #isGroupAdmin(User, long)}
1616             */
1617            public static boolean isCommunityAdmin(User user, long groupId)
1618                    throws Exception {
1619    
1620                    return getPortal().isCommunityAdmin(user, groupId);
1621            }
1622    
1623            /**
1624             * @deprecated As of 6.1.0, renamed to {@link #isGroupOwner(User, long)}
1625             */
1626            public static boolean isCommunityOwner(User user, long groupId)
1627                    throws Exception {
1628    
1629                    return getPortal().isCommunityOwner(user, groupId);
1630            }
1631    
1632            public static boolean isCompanyAdmin(User user) throws Exception {
1633                    return getPortal().isCompanyAdmin(user);
1634            }
1635    
1636            public static boolean isCompanyControlPanelPortlet(
1637                            String portletId, String category, ThemeDisplay themeDisplay)
1638                    throws PortalException, SystemException {
1639    
1640                    return getPortal().isCompanyControlPanelPortlet(
1641                            portletId, category, themeDisplay);
1642            }
1643    
1644            public static boolean isCompanyControlPanelPortlet(
1645                            String portletId, ThemeDisplay themeDisplay)
1646                    throws PortalException, SystemException {
1647    
1648                    return getPortal().isCompanyControlPanelPortlet(
1649                            portletId, themeDisplay);
1650            }
1651    
1652            public static boolean isCompanyControlPanelVisible(
1653                            ThemeDisplay themeDisplay)
1654                    throws PortalException, SystemException {
1655    
1656                    return getPortal().isCompanyControlPanelVisible(themeDisplay);
1657            }
1658    
1659            public static boolean isControlPanelPortlet(
1660                            String portletId, String category, ThemeDisplay themeDisplay)
1661                    throws SystemException {
1662    
1663                    return getPortal().isControlPanelPortlet(
1664                            portletId, category, themeDisplay);
1665            }
1666    
1667            public static boolean isControlPanelPortlet(
1668                            String portletId, ThemeDisplay themeDisplay)
1669                    throws SystemException {
1670    
1671                    return getPortal().isControlPanelPortlet(portletId, themeDisplay);
1672            }
1673    
1674            public static boolean isGroupAdmin(User user, long groupId)
1675                    throws Exception {
1676    
1677                    return getPortal().isGroupAdmin(user, groupId);
1678            }
1679    
1680            public static boolean isGroupFriendlyURL(
1681                    String fullURL, String groupFriendlyURL, String layoutFriendlyURL) {
1682    
1683                    return getPortal().isGroupFriendlyURL(
1684                            fullURL, groupFriendlyURL, layoutFriendlyURL);
1685            }
1686    
1687            public static boolean isGroupOwner(User user, long groupId)
1688                    throws Exception {
1689    
1690                    return getPortal().isGroupOwner(user, groupId);
1691            }
1692    
1693            public static boolean isLayoutDescendant(Layout layout, long layoutId)
1694                    throws PortalException, SystemException {
1695    
1696                    return getPortal().isLayoutDescendant(layout, layoutId);
1697            }
1698    
1699            public static boolean isLayoutFirstPageable(Layout layout) {
1700                    return getPortal().isLayoutFirstPageable(layout);
1701            }
1702    
1703            public static boolean isLayoutFirstPageable(String type) {
1704                    return getPortal().isLayoutFirstPageable(type);
1705            }
1706    
1707            public static boolean isLayoutFriendliable(Layout layout) {
1708                    return getPortal().isLayoutFriendliable(layout);
1709            }
1710    
1711            public static boolean isLayoutFriendliable(String type) {
1712                    return getPortal().isLayoutFriendliable(type);
1713            }
1714    
1715            public static boolean isLayoutParentable(Layout layout) {
1716                    return getPortal().isLayoutParentable(layout);
1717            }
1718    
1719            public static boolean isLayoutParentable(String type) {
1720                    return getPortal().isLayoutParentable(type);
1721            }
1722    
1723            public static boolean isLayoutSitemapable(Layout layout) {
1724                    return getPortal().isLayoutSitemapable(layout);
1725            }
1726    
1727            public static boolean isLoginRedirectRequired(HttpServletRequest request)
1728                    throws SystemException {
1729    
1730                    return getPortal().isLoginRedirectRequired(request);
1731            }
1732    
1733            public static boolean isMethodGet(PortletRequest portletRequest) {
1734                    return getPortal().isMethodGet(portletRequest);
1735            }
1736    
1737            public static boolean isMethodPost(PortletRequest portletRequest) {
1738                    return getPortal().isMethodPost(portletRequest);
1739            }
1740    
1741            public static boolean isMultipartRequest(HttpServletRequest request) {
1742                    return getPortal().isMultipartRequest(request);
1743            }
1744    
1745            public static boolean isOmniadmin(long userId) {
1746                    return getPortal().isOmniadmin(userId);
1747            }
1748    
1749            public static boolean isReservedParameter(String name) {
1750                    return getPortal().isReservedParameter(name);
1751            }
1752    
1753            public static boolean isRSSFeedsEnabled() {
1754                    return getPortal().isRSSFeedsEnabled();
1755            }
1756    
1757            public static boolean isSecure(HttpServletRequest request) {
1758                    return getPortal().isSecure(request);
1759            }
1760    
1761            public static boolean isSystemGroup(String groupName) {
1762                    return getPortal().isSystemGroup(groupName);
1763            }
1764    
1765            public static boolean isSystemRole(String roleName) {
1766                    return getPortal().isSystemRole(roleName);
1767            }
1768    
1769            public static boolean isUpdateAvailable() throws SystemException {
1770                    return getPortal().isUpdateAvailable();
1771            }
1772    
1773            public static boolean isValidResourceId(String resourceId) {
1774                    return getPortal().isValidResourceId(resourceId);
1775            }
1776    
1777            public static void resetCDNHosts() {
1778                    getPortal().resetCDNHosts();
1779            }
1780    
1781            /**
1782             * @deprecated As of 6.2.0 replaced by {@link
1783             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#resetPortletInvocationWhitelist}
1784             */
1785            public static Set<String> resetPortletAddDefaultResourceCheckWhitelist() {
1786                    return getPortal().resetPortletAddDefaultResourceCheckWhitelist();
1787            }
1788    
1789            /**
1790             * @deprecated As of 6.2.0 replaced by {@link
1791             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#resetPortletInvocationWhitelistActions}
1792             */
1793            public static Set<String>
1794                    resetPortletAddDefaultResourceCheckWhitelistActions() {
1795    
1796                    return getPortal().
1797                            resetPortletAddDefaultResourceCheckWhitelistActions();
1798            }
1799    
1800            /**
1801             * @deprecated As of 6.1.0, replaced by {@link DB#runSQL(String)}
1802             */
1803            public static void runSQL(String sql) throws IOException, SQLException {
1804                    DBFactoryUtil.getDB().runSQL(sql);
1805            }
1806    
1807            public static void sendError(
1808                            Exception e, ActionRequest actionRequest,
1809                            ActionResponse actionResponse)
1810                    throws IOException {
1811    
1812                    getPortal().sendError(e, actionRequest, actionResponse);
1813            }
1814    
1815            public static void sendError(
1816                            Exception e, HttpServletRequest request,
1817                            HttpServletResponse response)
1818                    throws IOException, ServletException {
1819    
1820                    getPortal().sendError(e, request, response);
1821            }
1822    
1823            public static void sendError(
1824                            int status, Exception e, ActionRequest actionRequest,
1825                            ActionResponse actionResponse)
1826                    throws IOException {
1827    
1828                    getPortal().sendError(status, e, actionRequest, actionResponse);
1829            }
1830    
1831            public static void sendError(
1832                            int status, Exception e, HttpServletRequest request,
1833                            HttpServletResponse response)
1834                    throws IOException, ServletException {
1835    
1836                    getPortal().sendError(status, e, request, response);
1837            }
1838    
1839            public static void sendRSSFeedsDisabledError(
1840                            HttpServletRequest request, HttpServletResponse response)
1841                    throws IOException, ServletException {
1842    
1843                    getPortal().sendRSSFeedsDisabledError(request, response);
1844            }
1845    
1846            public static void sendRSSFeedsDisabledError(
1847                            PortletRequest portletRequest, PortletResponse portletResponse)
1848                    throws IOException, ServletException {
1849    
1850                    getPortal().sendRSSFeedsDisabledError(portletRequest, portletResponse);
1851            }
1852    
1853            /**
1854             * Sets the description for a page. This overrides the existing page
1855             * description.
1856             */
1857            public static void setPageDescription(
1858                    String description, HttpServletRequest request) {
1859    
1860                    getPortal().setPageDescription(description, request);
1861            }
1862    
1863            /**
1864             * Sets the keywords for a page. This overrides the existing page keywords.
1865             */
1866            public static void setPageKeywords(
1867                    String keywords, HttpServletRequest request) {
1868    
1869                    getPortal().setPageKeywords(keywords, request);
1870            }
1871    
1872            /**
1873             * Sets the subtitle for a page. This overrides the existing page subtitle.
1874             */
1875            public static void setPageSubtitle(
1876                    String subtitle, HttpServletRequest request) {
1877    
1878                    getPortal().setPageSubtitle(subtitle, request);
1879            }
1880    
1881            /**
1882             * Sets the whole title for a page. This overrides the existing page whole
1883             * title.
1884             */
1885            public static void setPageTitle(String title, HttpServletRequest request) {
1886                    getPortal().setPageTitle(title, request);
1887            }
1888    
1889            /**
1890             * Sets the port obtained on the first request to the portal.
1891             */
1892            public static void setPortalPort(HttpServletRequest request) {
1893                    getPortal().setPortalPort(request);
1894            }
1895    
1896            public static void storePreferences(PortletPreferences portletPreferences)
1897                    throws IOException, ValidatorException {
1898    
1899                    getPortal().storePreferences(portletPreferences);
1900            }
1901    
1902            public static String[] stripURLAnchor(String url, String separator) {
1903                    return getPortal().stripURLAnchor(url, separator);
1904            }
1905    
1906            public static String transformCustomSQL(String sql) {
1907                    return getPortal().transformCustomSQL(sql);
1908            }
1909    
1910            public static String transformSQL(String sql) {
1911                    return getPortal().transformSQL(sql);
1912            }
1913    
1914            public static PortletMode updatePortletMode(
1915                    String portletId, User user, Layout layout, PortletMode portletMode,
1916                    HttpServletRequest request) {
1917    
1918                    return getPortal().updatePortletMode(
1919                            portletId, user, layout, portletMode, request);
1920            }
1921    
1922            public static String updateRedirect(
1923                    String redirect, String oldPath, String newPath) {
1924    
1925                    return getPortal().updateRedirect(redirect, oldPath, newPath);
1926            }
1927    
1928            public static WindowState updateWindowState(
1929                    String portletId, User user, Layout layout, WindowState windowState,
1930                    HttpServletRequest request) {
1931    
1932                    return getPortal().updateWindowState(
1933                            portletId, user, layout, windowState, request);
1934            }
1935    
1936            public void removePortalPortEventListener(
1937                    PortalPortEventListener portalPortEventListener) {
1938    
1939                    getPortal().removePortalPortEventListener(portalPortEventListener);
1940            }
1941    
1942            public void setPortal(Portal portal) {
1943                    PortalRuntimePermission.checkSetBeanProperty(getClass());
1944    
1945                    _portal = portal;
1946            }
1947    
1948            private static Portal _portal;
1949    
1950    }