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