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