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