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