001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.db.DB;
020    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
021    import com.liferay.portal.kernel.exception.PortalException;
022    import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
023    import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
024    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
025    import com.liferay.portal.kernel.servlet.taglib.ui.BreadcrumbEntry;
026    import com.liferay.portal.kernel.upload.UploadPortletRequest;
027    import com.liferay.portal.kernel.upload.UploadServletRequest;
028    import com.liferay.portal.model.BaseModel;
029    import com.liferay.portal.model.Company;
030    import com.liferay.portal.model.Group;
031    import com.liferay.portal.model.Layout;
032    import com.liferay.portal.model.LayoutFriendlyURLComposite;
033    import com.liferay.portal.model.LayoutQueryStringComposite;
034    import com.liferay.portal.model.LayoutSet;
035    import com.liferay.portal.model.Portlet;
036    import com.liferay.portal.model.ResourcePermission;
037    import com.liferay.portal.model.User;
038    import com.liferay.portal.service.PortletLocalServiceUtil;
039    import com.liferay.portal.theme.ThemeDisplay;
040    import com.liferay.portlet.InvokerPortlet;
041    import com.liferay.portlet.PortletInstanceFactoryUtil;
042    import com.liferay.portlet.expando.model.ExpandoBridge;
043    
044    import java.io.IOException;
045    import java.io.Serializable;
046    
047    import java.net.InetAddress;
048    
049    import java.sql.SQLException;
050    
051    import java.util.Date;
052    import java.util.List;
053    import java.util.Locale;
054    import java.util.Map;
055    import java.util.Properties;
056    import java.util.ResourceBundle;
057    import java.util.Set;
058    import java.util.TimeZone;
059    
060    import javax.portlet.ActionRequest;
061    import javax.portlet.ActionResponse;
062    import javax.portlet.PortletConfig;
063    import javax.portlet.PortletException;
064    import javax.portlet.PortletMode;
065    import javax.portlet.PortletPreferences;
066    import javax.portlet.PortletRequest;
067    import javax.portlet.PortletResponse;
068    import javax.portlet.PortletURL;
069    import javax.portlet.PreferencesValidator;
070    import javax.portlet.RenderRequest;
071    import javax.portlet.ValidatorException;
072    import javax.portlet.WindowState;
073    
074    import javax.servlet.ServletContext;
075    import javax.servlet.ServletException;
076    import javax.servlet.http.HttpServletRequest;
077    import javax.servlet.http.HttpServletResponse;
078    import javax.servlet.http.HttpSession;
079    
080    /**
081     * @author Brian Wing Shun Chan
082     * @author Eduardo Lundgren
083     * @author Juan Fern??ndez
084     */
085    @ProviderType
086    public class PortalUtil {
087    
088            /**
089             * Appends the description to the current meta description of the page in
090             * the request.
091             *
092             * @param description the description to append to the current meta
093             *        description
094             * @param request the servlet request for the page
095             */
096            public static void addPageDescription(
097                    String description, HttpServletRequest request) {
098    
099                    getPortal().addPageDescription(description, request);
100            }
101    
102            /**
103             * Appends the keywords to the current meta keywords of the page in the
104             * request.
105             *
106             * @param keywords the keywords to add to the current meta keywords
107             *        (comma-separated)
108             * @param request the servlet request for the page
109             */
110            public static void addPageKeywords(
111                    String keywords, HttpServletRequest request) {
112    
113                    getPortal().addPageKeywords(keywords, request);
114            }
115    
116            /**
117             * Appends the subtitle to the current subtitle of the page in the request.
118             *
119             * @param subtitle the subtitle to append to the current subtitle
120             * @param request the servlet request for the page
121             */
122            public static void addPageSubtitle(
123                    String subtitle, HttpServletRequest request) {
124    
125                    getPortal().addPageSubtitle(subtitle, request);
126            }
127    
128            /**
129             * Appends the title to the current title of the page in the request.
130             *
131             * @param title the title to append to the current title
132             * @param request the servlet request for the page
133             */
134            public static void addPageTitle(String title, HttpServletRequest request) {
135                    getPortal().addPageTitle(title, request);
136            }
137    
138            public static boolean addPortalInetSocketAddressEventListener(
139                    PortalInetSocketAddressEventListener
140                            portalInetSocketAddressEventListener) {
141    
142                    return getPortal().addPortalInetSocketAddressEventListener(
143                            portalInetSocketAddressEventListener);
144            }
145    
146            /**
147             * Adds the portal port event listener to the portal. The listener is
148             * notified whenever the portal port is set.
149             *
150             * @param      portalPortEventListener the portal port event listener to add
151             * @deprecated As of 7.0.0, replaced by {@link
152             *             #addPortalInetSocketAddressEventListener(
153             *             PortalInetSocketAddressEventListener)}
154             */
155            @Deprecated
156            public static void addPortalPortEventListener(
157                    PortalPortEventListener portalPortEventListener) {
158    
159                    getPortal().addPortalPortEventListener(portalPortEventListener);
160            }
161    
162            /**
163             * Adds an entry to the portlet breadcrumbs for the page in the request.
164             *
165             * @param request the servlet request for the page
166             * @param title the title of the new breadcrumb entry
167             * @param url the URL of the new breadcrumb entry
168             */
169            public static void addPortletBreadcrumbEntry(
170                    HttpServletRequest request, String title, String url) {
171    
172                    getPortal().addPortletBreadcrumbEntry(request, title, url);
173            }
174    
175            /**
176             * Adds an entry to the portlet breadcrumbs for the page in the request.
177             *
178             * @param request the servlet request for the page
179             * @param title the title of the new breadcrumb entry
180             * @param url the URL of the new breadcrumb entry
181             * @param data the HTML5 data parameters of the new breadcrumb entry
182             */
183            public static void addPortletBreadcrumbEntry(
184                    HttpServletRequest request, String title, String url,
185                    Map<String, Object> data) {
186    
187                    getPortal().addPortletBreadcrumbEntry(request, title, url, data);
188            }
189    
190            /**
191             * Adds the default resource permissions for the portlet to the page in the
192             * request.
193             *
194             * @param  request the servlet request for the page
195             * @param  portlet the portlet
196             * @throws PortalException if adding the default resource permissions failed
197             */
198            public static void addPortletDefaultResource(
199                            HttpServletRequest request, Portlet portlet)
200                    throws PortalException {
201    
202                    getPortal().addPortletDefaultResource(request, portlet);
203            }
204    
205            public static void addPortletDefaultResource(
206                            long companyId, Layout layout, Portlet portlet)
207                    throws PortalException {
208    
209                    getPortal().addPortletDefaultResource(companyId, layout, portlet);
210            }
211    
212            /**
213             * Adds the preserved parameters doAsGroupId and refererPlid to the URL,
214             * optionally adding doAsUserId and doAsUserLanguageId as well.
215             *
216             * <p>
217             * Preserved parameters are parameters that should be sent with every
218             * request as the user navigates the portal.
219             * </p>
220             *
221             * @param  themeDisplay the current theme display
222             * @param  layout the current page
223             * @param  url the URL
224             * @param  doAsUser whether to include doAsUserId and doAsLanguageId in the
225             *         URL if they are available. If <code>false</code>, doAsUserId and
226             *         doAsUserLanguageId will never be added.
227             * @return the URL with the preserved parameters added
228             */
229            public static String addPreservedParameters(
230                    ThemeDisplay themeDisplay, Layout layout, String url,
231                    boolean doAsUser) {
232    
233                    return getPortal().addPreservedParameters(
234                            themeDisplay, layout, url, doAsUser);
235            }
236    
237            /**
238             * Adds the preserved parameters doAsUserId, doAsUserLanguageId,
239             * doAsGroupId, refererPlid, and controlPanelCategory to the URL.
240             *
241             * @param  themeDisplay the current theme display
242             * @param  url the URL
243             * @return the URL with the preserved parameters added
244             */
245            public static String addPreservedParameters(
246                    ThemeDisplay themeDisplay, String url) {
247    
248                    return getPortal().addPreservedParameters(themeDisplay, url);
249            }
250    
251            public static void addUserLocaleOptionsMessage(HttpServletRequest request) {
252                    getPortal().addUserLocaleOptionsMessage(request);
253            }
254    
255            /**
256             * Clears the render parameters in the request if the portlet is in the
257             * action phase.
258             *
259             * @param renderRequest the render request
260             */
261            public static void clearRequestParameters(RenderRequest renderRequest) {
262                    getPortal().clearRequestParameters(renderRequest);
263            }
264    
265            /**
266             * Copies the request parameters to the render parameters, unless a
267             * parameter with that name already exists in the render parameters.
268             *
269             * @param actionRequest the request from which to get the request parameters
270             * @param actionResponse the response to receive the render parameters
271             */
272            public static void copyRequestParameters(
273                    ActionRequest actionRequest, ActionResponse actionResponse) {
274    
275                    getPortal().copyRequestParameters(actionRequest, actionResponse);
276            }
277    
278            /**
279             * Escapes the URL for use in a redirect and checks that security settings
280             * allow the URL is allowed for redirects.
281             *
282             * @param  url the URL to escape
283             * @return the escaped URL, or <code>null</code> if the URL is not allowed
284             *         for redirects
285             */
286            public static String escapeRedirect(String url) {
287                    return getPortal().escapeRedirect(url);
288            }
289    
290            /**
291             * Generates a random key to identify the request based on the input string.
292             *
293             * @param  request the servlet request for the page
294             * @param  input the input string
295             * @return the generated key
296             */
297            public static String generateRandomKey(
298                    HttpServletRequest request, String input) {
299    
300                    return getPortal().generateRandomKey(request, input);
301            }
302    
303            public static String getAbsoluteURL(
304                    HttpServletRequest request, String url) {
305    
306                    return getPortal().getAbsoluteURL(request, url);
307            }
308    
309            public static LayoutQueryStringComposite
310                    getActualLayoutQueryStringComposite(
311                            long groupId, boolean privateLayout, String friendlyURL,
312                            Map<String, String[]> params, Map<String, Object> requestContext)
313                    throws PortalException {
314    
315                    return getPortal().getActualLayoutQueryStringComposite(
316                            groupId, privateLayout, friendlyURL, params, requestContext);
317            }
318    
319            public static String getActualURL(
320                            long groupId, boolean privateLayout, String mainPath,
321                            String friendlyURL, Map<String, String[]> params,
322                            Map<String, Object> requestContext)
323                    throws PortalException {
324    
325                    return getPortal().getActualURL(
326                            groupId, privateLayout, mainPath, friendlyURL, params,
327                            requestContext);
328            }
329    
330            /**
331             * @deprecated As of 6.2.0, replaced by {@link
332             *             com.liferay.portal.kernel.language.LanguageUtil#getAvailableLocales}
333             */
334            @Deprecated
335            public static Locale[] getAlternateLocales(HttpServletRequest request)
336                    throws PortalException {
337    
338                    return getPortal().getAlternateLocales(request);
339            }
340    
341            /**
342             * Returns the alternate URL for the requested canonical URL in the given
343             * locale.
344             *
345             * <p>
346             * The alternate URL lets search engines know that an equivalent page is
347             * available for the given locale. For more information, see <a
348             * href="https://support.google.com/webmasters/answer/189077?hl=en">https://support.google.com/webmasters/answer/189077?hl=en</a>.
349             * </p>
350             *
351             * @param  canonicalURL the canonical URL being requested. For more
352             *         information, see {@link #getCanonicalURL}.
353             * @param  themeDisplay the theme display
354             * @param  locale the locale of the alternate URL being generated
355             * @param  layout the page being requested
356             * @return the alternate URL for the requested canonical URL in the given
357             *         locale
358             * @throws PortalException if a portal exception occurred
359             */
360            public static String getAlternateURL(
361                            String canonicalURL, ThemeDisplay themeDisplay, Locale locale,
362                            Layout layout)
363                    throws PortalException {
364    
365                    return getPortal().getAlternateURL(
366                            canonicalURL, themeDisplay, locale, layout);
367            }
368    
369            public static long[] getAncestorSiteGroupIds(long groupId)
370                    throws PortalException {
371    
372                    return getPortal().getAncestorSiteGroupIds(groupId);
373            }
374    
375            /**
376             * @deprecated As of 6.2.0, replaced by {@link
377             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletCSRFWhitelistActions}
378             */
379            @Deprecated
380            public static Set<String> getAuthTokenIgnoreActions() {
381                    return getPortal().getAuthTokenIgnoreActions();
382            }
383    
384            /**
385             * @deprecated As of 6.2.0, replaced by {@link
386             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletCSRFWhitelist}
387             */
388            @Deprecated
389            public static Set<String> getAuthTokenIgnorePortlets() {
390                    return getPortal().getAuthTokenIgnorePortlets();
391            }
392    
393            /**
394             * Returns the base model instance for the resource permission.
395             *
396             * @param  resourcePermission the resource permission
397             * @return the base model instance, or <code>null</code> if the resource
398             *         permission does not have a base model instance (such as if it's a
399             *         portlet)
400             * @throws PortalException if a base model instance for the resource
401             *         permission could not be found
402             */
403            public static BaseModel<?> getBaseModel(
404                            ResourcePermission resourcePermission)
405                    throws PortalException {
406    
407                    return getPortal().getBaseModel(resourcePermission);
408            }
409    
410            /**
411             * Returns the base model instance for the model name and primary key.
412             *
413             * @param  modelName the fully qualified class name of the model
414             * @param  primKey the primary key of the model instance to get
415             * @return the base model instance, or <code>null</code> if the model does
416             *         not have a base model instance (such as if it's a portlet)
417             * @throws PortalException if a base model instance with the primary key
418             *         could not be found
419             */
420            public static BaseModel<?> getBaseModel(String modelName, String primKey)
421                    throws PortalException {
422    
423                    return getPortal().getBaseModel(modelName, primKey);
424            }
425    
426            /**
427             * Returns the user's ID from the HTTP authentication headers after
428             * validating his credentials.
429             *
430             * @param  request the servlet request from which to retrieve the HTTP
431             *         authentication headers
432             * @return the user's ID if HTTP authentication headers are present and his
433             *         credentials are valid; <code>0</code> otherwise
434             * @throws PortalException if an authentication exception occurred
435             */
436            public static long getBasicAuthUserId(HttpServletRequest request)
437                    throws PortalException {
438    
439                    return getPortal().getBasicAuthUserId(request);
440            }
441    
442            /**
443             * Returns the user's ID from the HTTP authentication headers after
444             * validating his credentials.
445             *
446             * @param  request the servlet request from which to retrieve the HTTP
447             *         authentication headers
448             * @param  companyId the company's ID. This parameter is not used.
449             * @return the user's ID if HTTP authentication headers are present and his
450             *         credentials are valid; <code>0</code> otherwise
451             * @throws PortalException if an authentication exception occurred
452             */
453            public static long getBasicAuthUserId(
454                            HttpServletRequest request, long companyId)
455                    throws PortalException {
456    
457                    return getPortal().getBasicAuthUserId(request, companyId);
458            }
459    
460            public static List<Group> getBrowsableScopeGroups(
461                            long userId, long companyId, long groupId, String portletId)
462                    throws PortalException {
463    
464                    return getPortal().getBrowsableScopeGroups(
465                            userId, companyId, groupId, portletId);
466            }
467    
468            /**
469             * Returns the canonical URL for the page. The canonical URL is often used
470             * to distinguish a preferred page from its translations.
471             *
472             * <p>
473             * A canonical URL for the page is the preferred URL to specify for a set of
474             * pages with similar or identical content. The canonical URL is used to
475             * inform search engines that several URLs point to the same page. It is
476             * also used to generate the URLs for site maps, the URLs that social
477             * bookmarks publish (Twitter, Facebook links, etc.), and the URLs in sent
478             * email. For more information, see <a
479             * href="https://support.google.com/webmasters/answer/139394?hl=en">https://support.google.com/webmasters/answer/139394?hl=en</a>.
480             * </p>
481             *
482             * @param  completeURL the complete URL of the page
483             * @param  themeDisplay the theme display
484             * @param  layout the page being requested (optionally <code>null</code>).
485             *         If <code>null</code> is specified, the current page is used.
486             * @return the canonical URL for the page
487             * @throws PortalException if a group for the page could not be found, if a
488             *         group friendly URL could not be retrieved for the page, or if a
489             *         portal exception occurred
490             */
491            public static String getCanonicalURL(
492                            String completeURL, ThemeDisplay themeDisplay, Layout layout)
493                    throws PortalException {
494    
495                    return getPortal().getCanonicalURL(completeURL, themeDisplay, layout);
496            }
497    
498            /**
499             * Returns the canonical URL of the page, optionally including the page's
500             * friendly URL. The canonical URL is often used to distinguish a preferred
501             * page from its translations.
502             *
503             * <p>
504             * A canonical URL for the page is the preferred URL to specify for a set of
505             * pages with similar or identical content. The canonical URL is used to
506             * inform search engines that several URLs point to the same page. It is
507             * also used to generate the URLs for site maps, the URLs that social
508             * bookmarks publish (Twitter, Facebook links, etc.), and the URLs in sent
509             * email. For more information, see <a
510             * href="https://support.google.com/webmasters/answer/139394?hl=en">https://support.google.com/webmasters/answer/139394?hl=en</a>.
511             * </p>
512             *
513             * @param  completeURL the complete URL of the page
514             * @param  themeDisplay the current theme display
515             * @param  layout the page. If it is <code>null</code>, then it is generated
516             *         for the current page.
517             * @param  forceLayoutFriendlyURL whether to add the page's friendly URL to
518             *         the canonical URL
519             * @return the canonical URL of the page
520             * @throws PortalException if a group for the page could not be found, if a
521             *         group friendly URL could not be retrieved for the page, or if a
522             *         portal exception occurred
523             */
524            public static String getCanonicalURL(
525                            String completeURL, ThemeDisplay themeDisplay, Layout layout,
526                            boolean forceLayoutFriendlyURL)
527                    throws PortalException {
528    
529                    return getPortal().getCanonicalURL(
530                            completeURL, themeDisplay, layout, forceLayoutFriendlyURL);
531            }
532    
533            /**
534             * @deprecated As of 6.1.0, replaced by {@link #getCDNHost(boolean)}
535             */
536            @Deprecated
537            public static String getCDNHost() {
538                    return getPortal().getCDNHost();
539            }
540    
541            /**
542             * Returns the secure (HTTPS) or insecure (HTTP) content distribution
543             * network (CDN) host address for this portal.
544             *
545             * @param  secure whether to get the secure CDN host address
546             * @return the CDN host address
547             */
548            public static String getCDNHost(boolean secure) {
549                    return getPortal().getCDNHost(secure);
550            }
551    
552            public static String getCDNHost(HttpServletRequest request)
553                    throws PortalException {
554    
555                    return getPortal().getCDNHost(request);
556            }
557    
558            /**
559             * Returns the insecure (HTTP) content distribution network (CDN) host
560             * address
561             *
562             * @param  companyId the company ID of a site
563             * @return the CDN host address
564             */
565            public static String getCDNHostHttp(long companyId) {
566                    return getPortal().getCDNHostHttp(companyId);
567            }
568    
569            /**
570             * Returns the secure (HTTPS) content distribution network (CDN) host
571             * address
572             *
573             * @param  companyId the company ID of a site
574             * @return the CDN host address
575             */
576            public static String getCDNHostHttps(long companyId) {
577                    return getPortal().getCDNHostHttps(companyId);
578            }
579    
580            /**
581             * Returns the fully qualified name of the class from its ID.
582             *
583             * @param  classNameId the ID of the class
584             * @return the fully qualified name of the class
585             */
586            public static String getClassName(long classNameId) {
587                    return getPortal().getClassName(classNameId);
588            }
589    
590            /**
591             * Returns the ID of the class from its class object.
592             *
593             * @param  clazz the class object
594             * @return the ID of the class
595             */
596            public static long getClassNameId(Class<?> clazz) {
597                    return getPortal().getClassNameId(clazz);
598            }
599    
600            /**
601             * Returns the ID of the class from its fully qualified name.
602             *
603             * @param  value the fully qualified name of the class
604             * @return the ID of the class
605             */
606            public static long getClassNameId(String value) {
607                    return getPortal().getClassNameId(value);
608            }
609    
610            public static Company getCompany(HttpServletRequest request)
611                    throws PortalException {
612    
613                    return getPortal().getCompany(request);
614            }
615    
616            public static Company getCompany(PortletRequest portletRequest)
617                    throws PortalException {
618    
619                    return getPortal().getCompany(portletRequest);
620            }
621    
622            public static long getCompanyId(HttpServletRequest request) {
623                    return getPortal().getCompanyId(request);
624            }
625    
626            public static long getCompanyId(PortletRequest portletRequest) {
627                    return getPortal().getCompanyId(portletRequest);
628            }
629    
630            public static long[] getCompanyIds() {
631                    return getPortal().getCompanyIds();
632            }
633    
634            public static String getComputerAddress() {
635                    return getPortal().getComputerAddress();
636            }
637    
638            public static String getComputerName() {
639                    return getPortal().getComputerName();
640            }
641    
642            public static Map<String, List<Portlet>> getControlPanelCategoriesMap(
643                    HttpServletRequest request) {
644    
645                    return getPortal().getControlPanelCategoriesMap(request);
646            }
647    
648            public static String getControlPanelCategory(
649                    String portletId, ThemeDisplay themeDisplay) {
650    
651                    return getPortal().getControlPanelCategory(portletId, themeDisplay);
652            }
653    
654            public static String getControlPanelFullURL(
655                            long scopeGroupId, String ppid, Map<String, String[]> params)
656                    throws PortalException {
657    
658                    return getPortal().getControlPanelFullURL(scopeGroupId, ppid, params);
659            }
660    
661            public static long getControlPanelPlid(long companyId)
662                    throws PortalException {
663    
664                    return getPortal().getControlPanelPlid(companyId);
665            }
666    
667            public static long getControlPanelPlid(PortletRequest portletRequest)
668                    throws PortalException {
669    
670                    return getPortal().getControlPanelPlid(portletRequest);
671            }
672    
673            public static Set<Portlet> getControlPanelPortlets(
674                    long companyId, String category) {
675    
676                    return getPortal().getControlPanelPortlets(companyId, category);
677            }
678    
679            public static List<Portlet> getControlPanelPortlets(
680                    String category, ThemeDisplay themeDisplay) {
681    
682                    return getPortal().getControlPanelPortlets(category, themeDisplay);
683            }
684    
685            public static PortletURL getControlPanelPortletURL(
686                    HttpServletRequest request, String portletId, long referrerPlid,
687                    String lifecycle) {
688    
689                    return getPortal().getControlPanelPortletURL(
690                            request, portletId, referrerPlid, lifecycle);
691            }
692    
693            public static PortletURL getControlPanelPortletURL(
694                    PortletRequest portletRequest, String portletId, long referrerPlid,
695                    String lifecycle) {
696    
697                    return getPortal().getControlPanelPortletURL(
698                            portletRequest, portletId, referrerPlid, lifecycle);
699            }
700    
701            public static String getCreateAccountURL(
702                            HttpServletRequest request, ThemeDisplay themeDisplay)
703                    throws Exception {
704    
705                    return getPortal().getCreateAccountURL(request, themeDisplay);
706            }
707    
708            public static long[] getCurrentAndAncestorSiteGroupIds(long groupId)
709                    throws PortalException {
710    
711                    return getPortal().getCurrentAndAncestorSiteGroupIds(groupId);
712            }
713    
714            public static List<Group> getCurrentAndAncestorSiteGroups(long groupId)
715                    throws PortalException {
716    
717                    return getPortal().getCurrentAndAncestorSiteGroups(groupId);
718            }
719    
720            public static String getCurrentCompleteURL(HttpServletRequest request) {
721                    return getPortal().getCurrentCompleteURL(request);
722            }
723    
724            public static String getCurrentURL(HttpServletRequest request) {
725                    return getPortal().getCurrentURL(request);
726            }
727    
728            public static String getCurrentURL(PortletRequest portletRequest) {
729                    return getPortal().getCurrentURL(portletRequest);
730            }
731    
732            public static String getCustomSQLFunctionIsNotNull() {
733                    return getPortal().getCustomSQLFunctionIsNotNull();
734            }
735    
736            public static String getCustomSQLFunctionIsNull() {
737                    return getPortal().getCustomSQLFunctionIsNull();
738            }
739    
740            /**
741             * Returns the date object for the specified month, day, and year, or
742             * <code>null</code> if the date is invalid.
743             *
744             * @param  month the month (0-based, meaning 0 for January)
745             * @param  day the day of the month
746             * @param  year the year
747             * @return the date object, or <code>null</code> if the date is invalid
748             */
749            public static Date getDate(int month, int day, int year) {
750                    return getPortal().getDate(month, day, year);
751            }
752    
753            /**
754             * Returns the date object for the specified month, day, and year,
755             * optionally throwing an exception if the date is invalid.
756             *
757             * @param  month the month (0-based, meaning 0 for January)
758             * @param  day the day of the month
759             * @param  year the year
760             * @param  clazz the exception class to throw if the date is invalid. If
761             *         <code>null</code>, no exception will be thrown for an invalid
762             *         date.
763             * @return the date object, or <code>null</code> if the date is invalid and
764             *         no exception to throw was provided
765             * @throws PortalException if the date was invalid and <code>clazz</code>
766             *         was not <code>null</code>
767             */
768            public static Date getDate(
769                            int month, int day, int year,
770                            Class<? extends PortalException> clazz)
771                    throws PortalException {
772    
773                    return getPortal().getDate(month, day, year, clazz);
774            }
775    
776            /**
777             * Returns the date object for the specified month, day, year, hour, and
778             * minute, optionally throwing an exception if the date is invalid.
779             *
780             * @param  month the month (0-based, meaning 0 for January)
781             * @param  day the day of the month
782             * @param  year the year
783             * @param  hour the hour (0-24)
784             * @param  min the minute of the hour
785             * @param  clazz the exception class to throw if the date is invalid. If
786             *         <code>null</code>, no exception will be thrown for an invalid
787             *         date.
788             * @return the date object, or <code>null</code> if the date is invalid and
789             *         no exception to throw was provided
790             * @throws PortalException if the date was invalid and <code>clazz</code>
791             *         was not <code>null</code>
792             */
793            public static Date getDate(
794                            int month, int day, int year, int hour, int min,
795                            Class<? extends PortalException> clazz)
796                    throws PortalException {
797    
798                    return getPortal().getDate(month, day, year, hour, min, clazz);
799            }
800    
801            /**
802             * Returns the date object for the specified month, day, year, hour, minute,
803             * and time zone, optionally throwing an exception if the date is invalid.
804             *
805             * @param  month the month (0-based, meaning 0 for January)
806             * @param  day the day of the month
807             * @param  year the year
808             * @param  hour the hour (0-24)
809             * @param  min the minute of the hour
810             * @param  timeZone the time zone of the date
811             * @param  clazz the exception class to throw if the date is invalid. If
812             *         <code>null</code>, no exception will be thrown for an invalid
813             *         date.
814             * @return the date object, or <code>null</code> if the date is invalid and
815             *         no exception to throw was provided
816             * @throws PortalException if the date was invalid and <code>clazz</code>
817             *         was not <code>null</code>
818             */
819            public static Date getDate(
820                            int month, int day, int year, int hour, int min, TimeZone timeZone,
821                            Class<? extends PortalException> clazz)
822                    throws PortalException {
823    
824                    return getPortal().getDate(
825                            month, day, year, hour, min, timeZone, clazz);
826            }
827    
828            /**
829             * Returns the date object for the specified month, day, year, and time
830             * zone, optionally throwing an exception if the date is invalid.
831             *
832             * @param  month the month (0-based, meaning 0 for January)
833             * @param  day the day of the month
834             * @param  year the year
835             * @param  timeZone the time zone of the date
836             * @param  clazz the exception class to throw if the date is invalid. If
837             *         <code>null</code>, no exception will be thrown for an invalid
838             *         date.
839             * @return the date object, or <code>null</code> if the date is invalid and
840             *         no exception to throw was provided
841             * @throws PortalException if the date was invalid and <code>clazz</code>
842             *         was not <code>null</code>
843             */
844            public static Date getDate(
845                            int month, int day, int year, TimeZone timeZone,
846                            Class<? extends PortalException> clazz)
847                    throws PortalException {
848    
849                    return getPortal().getDate(month, day, year, timeZone, clazz);
850            }
851    
852            /**
853             * @deprecated As of 6.1.0, replaced by {@link DBFactoryUtil#getDB()}
854             */
855            @Deprecated
856            public static DB getDB() {
857                    return DBFactoryUtil.getDB();
858            }
859    
860            public static long getDefaultCompanyId() {
861                    return getPortal().getDefaultCompanyId();
862            }
863    
864            public static long getDigestAuthUserId(HttpServletRequest request)
865                    throws PortalException {
866    
867                    return getPortal().getDigestAuthUserId(request);
868            }
869    
870            public static String getEmailFromAddress(
871                    PortletPreferences preferences, long companyId, String defaultValue) {
872    
873                    return getPortal().getEmailFromAddress(
874                            preferences, companyId, defaultValue);
875            }
876    
877            public static String getEmailFromName(
878                    PortletPreferences preferences, long companyId, String defaultValue) {
879    
880                    return getPortal().getEmailFromName(
881                            preferences, companyId, defaultValue);
882            }
883    
884            public static Map<String, Serializable> getExpandoBridgeAttributes(
885                            ExpandoBridge expandoBridge, HttpServletRequest request)
886                    throws PortalException {
887    
888                    return getPortal().getExpandoBridgeAttributes(expandoBridge, request);
889            }
890    
891            public static Map<String, Serializable> getExpandoBridgeAttributes(
892                            ExpandoBridge expandoBridge, PortletRequest portletRequest)
893                    throws PortalException {
894    
895                    return getPortal().getExpandoBridgeAttributes(
896                            expandoBridge, portletRequest);
897            }
898    
899            public static Map<String, Serializable> getExpandoBridgeAttributes(
900                            ExpandoBridge expandoBridge,
901                            UploadPortletRequest uploadPortletRequest)
902                    throws PortalException {
903    
904                    return getPortal().getExpandoBridgeAttributes(
905                            expandoBridge, uploadPortletRequest);
906            }
907    
908            public static Serializable getExpandoValue(
909                            HttpServletRequest request, String name, int type,
910                            String displayType)
911                    throws PortalException {
912    
913                    return getPortal().getExpandoValue(request, name, type, displayType);
914            }
915    
916            public static Serializable getExpandoValue(
917                            PortletRequest portletRequest, String name, int type,
918                            String displayType)
919                    throws PortalException {
920    
921                    return getPortal().getExpandoValue(
922                            portletRequest, name, type, displayType);
923            }
924    
925            public static Serializable getExpandoValue(
926                            UploadPortletRequest uploadPortletRequest, String name, int type,
927                            String displayType)
928                    throws PortalException {
929    
930                    return getPortal().getExpandoValue(
931                            uploadPortletRequest, name, type, displayType);
932            }
933    
934            public static String getFacebookURL(
935                            Portlet portlet, String facebookCanvasPageURL,
936                            ThemeDisplay themeDisplay)
937                    throws PortalException {
938    
939                    return getPortal().getFacebookURL(
940                            portlet, facebookCanvasPageURL, themeDisplay);
941            }
942    
943            public static Portlet getFirstMyAccountPortlet(ThemeDisplay themeDisplay) {
944                    return getPortal().getFirstMyAccountPortlet(themeDisplay);
945            }
946    
947            public static String getFirstPageLayoutTypes(HttpServletRequest request) {
948                    return getPortal().getFirstPageLayoutTypes(request);
949            }
950    
951            public static Portlet getFirstSiteAdministrationPortlet(
952                    ThemeDisplay themeDisplay) {
953    
954                    return getPortal().getFirstSiteAdministrationPortlet(themeDisplay);
955            }
956    
957            public static String getFullName(
958                    String firstName, String middleName, String lastName) {
959    
960                    return getPortal().getFullName(firstName, middleName, lastName);
961            }
962    
963            public static String getGlobalLibDir() {
964                    return getPortal().getGlobalLibDir();
965            }
966    
967            public static String getGoogleGadgetURL(
968                            Portlet portlet, ThemeDisplay themeDisplay)
969                    throws PortalException {
970    
971                    return getPortal().getGoogleGadgetURL(portlet, themeDisplay);
972            }
973    
974            public static String getGroupFriendlyURL(
975                            LayoutSet layoutSet, ThemeDisplay themeDisplay)
976                    throws PortalException {
977    
978                    return getPortal().getGroupFriendlyURL(layoutSet, themeDisplay);
979            }
980    
981            public static String getGroupFriendlyURL(
982                            LayoutSet layoutSet, ThemeDisplay themeDisplay, Locale locale)
983                    throws PortalException {
984    
985                    return getPortal().getGroupFriendlyURL(layoutSet, themeDisplay, locale);
986            }
987    
988            public static int[] getGroupFriendlyURLIndex(String requestURI) {
989                    return getPortal().getGroupFriendlyURLIndex(requestURI);
990            }
991    
992            public static String[] getGroupPermissions(HttpServletRequest request) {
993                    return getPortal().getGroupPermissions(request);
994            }
995    
996            public static String[] getGroupPermissions(
997                    HttpServletRequest request, String className) {
998    
999                    return getPortal().getGroupPermissions(request, className);
1000            }
1001    
1002            public static String[] getGroupPermissions(PortletRequest portletRequest) {
1003                    return getPortal().getGroupPermissions(portletRequest);
1004            }
1005    
1006            public static String[] getGroupPermissions(
1007                    PortletRequest portletRequest, String className) {
1008    
1009                    return getPortal().getGroupPermissions(portletRequest, className);
1010            }
1011    
1012            public static String[] getGuestPermissions(HttpServletRequest request) {
1013                    return getPortal().getGuestPermissions(request);
1014            }
1015    
1016            public static String[] getGuestPermissions(
1017                    HttpServletRequest request, String className) {
1018    
1019                    return getPortal().getGuestPermissions(request, className);
1020            }
1021    
1022            public static String[] getGuestPermissions(PortletRequest portletRequest) {
1023                    return getPortal().getGuestPermissions(portletRequest);
1024            }
1025    
1026            public static String[] getGuestPermissions(
1027                    PortletRequest portletRequest, String className) {
1028    
1029                    return getPortal().getGuestPermissions(portletRequest, className);
1030            }
1031    
1032            public static String getHomeURL(HttpServletRequest request)
1033                    throws PortalException {
1034    
1035                    return getPortal().getHomeURL(request);
1036            }
1037    
1038            public static String getHost(HttpServletRequest request) {
1039                    return getPortal().getHost(request);
1040            }
1041    
1042            public static String getHost(PortletRequest portletRequest) {
1043                    return getPortal().getHost(portletRequest);
1044            }
1045    
1046            public static HttpServletRequest getHttpServletRequest(
1047                    PortletRequest portletRequest) {
1048    
1049                    return getPortal().getHttpServletRequest(portletRequest);
1050            }
1051    
1052            public static HttpServletResponse getHttpServletResponse(
1053                    PortletResponse portletResponse) {
1054    
1055                    return getPortal().getHttpServletResponse(portletResponse);
1056            }
1057    
1058            public static String getI18nPathLanguageId(
1059                    Locale locale, String defaultI18nPathLanguageId) {
1060    
1061                    return getPortal().getI18nPathLanguageId(
1062                            locale, defaultI18nPathLanguageId);
1063            }
1064    
1065            public static String getJournalArticleActualURL(
1066                            long groupId, boolean privateLayout, String mainPath,
1067                            String friendlyURL, Map<String, String[]> params,
1068                            Map<String, Object> requestContext)
1069                    throws PortalException {
1070    
1071                    return getPortal().getJournalArticleActualURL(
1072                            groupId, privateLayout, mainPath, friendlyURL, params,
1073                            requestContext);
1074            }
1075    
1076            public static Layout getJournalArticleLayout(
1077                            long groupId, boolean privateLayout, String friendlyURL)
1078                    throws PortalException {
1079    
1080                    return getPortal().getJournalArticleLayout(
1081                            groupId, privateLayout, friendlyURL);
1082            }
1083    
1084            public static String getJsSafePortletId(String portletId) {
1085                    return getPortal().getJsSafePortletId(portletId);
1086            }
1087    
1088            public static String getLayoutActualURL(Layout layout) {
1089                    return getPortal().getLayoutActualURL(layout);
1090            }
1091    
1092            public static String getLayoutActualURL(Layout layout, String mainPath) {
1093                    return getPortal().getLayoutActualURL(layout, mainPath);
1094            }
1095    
1096            public static String getLayoutActualURL(
1097                            long groupId, boolean privateLayout, String mainPath,
1098                            String friendlyURL)
1099                    throws PortalException {
1100    
1101                    return getPortal().getLayoutActualURL(
1102                            groupId, privateLayout, mainPath, friendlyURL);
1103            }
1104    
1105            public static String getLayoutActualURL(
1106                            long groupId, boolean privateLayout, String mainPath,
1107                            String friendlyURL, Map<String, String[]> params,
1108                            Map<String, Object> requestContext)
1109                    throws PortalException {
1110    
1111                    return getPortal().getLayoutActualURL(
1112                            groupId, privateLayout, mainPath, friendlyURL, params,
1113                            requestContext);
1114            }
1115    
1116            public static String getLayoutFriendlyURL(
1117                            Layout layout, ThemeDisplay themeDisplay)
1118                    throws PortalException {
1119    
1120                    return getPortal().getLayoutFriendlyURL(layout, themeDisplay);
1121            }
1122    
1123            public static String getLayoutFriendlyURL(
1124                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
1125                    throws PortalException {
1126    
1127                    return getPortal().getLayoutFriendlyURL(layout, themeDisplay, locale);
1128            }
1129    
1130            public static LayoutFriendlyURLComposite getLayoutFriendlyURLComposite(
1131                            long groupId, boolean privateLayout, String friendlyURL,
1132                            Map<String, String[]> params, Map<String, Object> requestContext)
1133                    throws PortalException {
1134    
1135                    return getPortal().getLayoutFriendlyURLComposite(
1136                            groupId, privateLayout, friendlyURL, params, requestContext);
1137            }
1138    
1139            public static String getLayoutFullURL(
1140                            Layout layout, ThemeDisplay themeDisplay)
1141                    throws PortalException {
1142    
1143                    return getPortal().getLayoutFullURL(layout, themeDisplay);
1144            }
1145    
1146            public static String getLayoutFullURL(
1147                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
1148                    throws PortalException {
1149    
1150                    return getPortal().getLayoutFullURL(layout, themeDisplay, doAsUser);
1151            }
1152    
1153            public static String getLayoutFullURL(long groupId, String portletId)
1154                    throws PortalException {
1155    
1156                    return getPortal().getLayoutFullURL(groupId, portletId);
1157            }
1158    
1159            public static String getLayoutFullURL(
1160                            long groupId, String portletId, boolean secure)
1161                    throws PortalException {
1162    
1163                    return getPortal().getLayoutFullURL(groupId, portletId, secure);
1164            }
1165    
1166            public static String getLayoutFullURL(ThemeDisplay themeDisplay)
1167                    throws PortalException {
1168    
1169                    return getPortal().getLayoutFullURL(themeDisplay);
1170            }
1171    
1172            public static String getLayoutRelativeURL(
1173                            Layout layout, ThemeDisplay themeDisplay)
1174                    throws PortalException {
1175    
1176                    return getPortal().getLayoutRelativeURL(layout, themeDisplay);
1177            }
1178    
1179            public static String getLayoutRelativeURL(
1180                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
1181                    throws PortalException {
1182    
1183                    return getPortal().getLayoutRelativeURL(layout, themeDisplay, doAsUser);
1184            }
1185    
1186            public static String getLayoutSetFriendlyURL(
1187                            LayoutSet layoutSet, ThemeDisplay themeDisplay)
1188                    throws PortalException {
1189    
1190                    return getPortal().getLayoutSetFriendlyURL(layoutSet, themeDisplay);
1191            }
1192    
1193            public static String getLayoutTarget(Layout layout) {
1194                    return getPortal().getLayoutTarget(layout);
1195            }
1196    
1197            public static String getLayoutURL(Layout layout, ThemeDisplay themeDisplay)
1198                    throws PortalException {
1199    
1200                    return getPortal().getLayoutURL(layout, themeDisplay);
1201            }
1202    
1203            public static String getLayoutURL(
1204                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
1205                    throws PortalException {
1206    
1207                    return getPortal().getLayoutURL(layout, themeDisplay, doAsUser);
1208            }
1209    
1210            public static String getLayoutURL(
1211                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
1212                    throws PortalException {
1213    
1214                    return getPortal().getLayoutURL(layout, themeDisplay, locale);
1215            }
1216    
1217            public static String getLayoutURL(ThemeDisplay themeDisplay)
1218                    throws PortalException {
1219    
1220                    return getPortal().getLayoutURL(themeDisplay);
1221            }
1222    
1223            public static LiferayPortletRequest getLiferayPortletRequest(
1224                    PortletRequest portletRequest) {
1225    
1226                    return getPortal().getLiferayPortletRequest(portletRequest);
1227            }
1228    
1229            public static LiferayPortletResponse getLiferayPortletResponse(
1230                    PortletResponse portletResponse) {
1231    
1232                    return getPortal().getLiferayPortletResponse(portletResponse);
1233            }
1234    
1235            public static Locale getLocale(HttpServletRequest request) {
1236                    return getPortal().getLocale(request);
1237            }
1238    
1239            public static Locale getLocale(
1240                    HttpServletRequest request, HttpServletResponse response,
1241                    boolean initialize) {
1242    
1243                    return getPortal().getLocale(request, response, initialize);
1244            }
1245    
1246            public static Locale getLocale(PortletRequest portletRequest) {
1247                    return getPortal().getLocale(portletRequest);
1248            }
1249    
1250            public static String getLocalizedFriendlyURL(
1251                            HttpServletRequest request, Layout layout, Locale locale,
1252                            Locale originalLocale)
1253                    throws Exception {
1254    
1255                    return getPortal().getLocalizedFriendlyURL(
1256                            request, layout, locale, originalLocale);
1257            }
1258    
1259            public static String getMailId(
1260                    String mx, String popPortletPrefix, Object... ids) {
1261    
1262                    return getPortal().getMailId(mx, popPortletPrefix, ids);
1263            }
1264    
1265            /**
1266             * @deprecated As of 6.1.0, replaced by {@link
1267             *             #getBaseModel(ResourcePermission)}
1268             */
1269            @Deprecated
1270            public static BaseModel<?> getModel(ResourcePermission resourcePermission)
1271                    throws PortalException {
1272    
1273                    return getPortal().getBaseModel(resourcePermission);
1274            }
1275    
1276            /**
1277             * @deprecated As of 6.1.0, replaced by {@link #getBaseModel(String,
1278             *             String)}
1279             */
1280            @Deprecated
1281            public static BaseModel<?> getModel(String modelName, String primKey)
1282                    throws PortalException {
1283    
1284                    return getPortal().getBaseModel(modelName, primKey);
1285            }
1286    
1287            public static String getNetvibesURL(
1288                            Portlet portlet, ThemeDisplay themeDisplay)
1289                    throws PortalException {
1290    
1291                    return getPortal().getNetvibesURL(portlet, themeDisplay);
1292            }
1293    
1294            public static String getNewPortletTitle(
1295                    String portletTitle, String oldScopeName, String newScopeName) {
1296    
1297                    return getPortal().getNewPortletTitle(
1298                            portletTitle, oldScopeName, newScopeName);
1299            }
1300    
1301            public static HttpServletRequest getOriginalServletRequest(
1302                    HttpServletRequest request) {
1303    
1304                    return getPortal().getOriginalServletRequest(request);
1305            }
1306    
1307            /**
1308             * @deprecated As of 6.2.0 renamed to {@link #getSiteGroupId(long)}
1309             */
1310            @Deprecated
1311            public static long getParentGroupId(long scopeGroupId)
1312                    throws PortalException {
1313    
1314                    return getPortal().getParentGroupId(scopeGroupId);
1315            }
1316    
1317            public static String getPathContext() {
1318                    return getPortal().getPathContext();
1319            }
1320    
1321            public static String getPathContext(HttpServletRequest request) {
1322                    return getPortal().getPathContext(request);
1323            }
1324    
1325            public static String getPathContext(PortletRequest portletRequest) {
1326                    return getPortal().getPathContext(portletRequest);
1327            }
1328    
1329            public static String getPathContext(String contextPath) {
1330                    return getPortal().getPathContext(contextPath);
1331            }
1332    
1333            public static String getPathFriendlyURLPrivateGroup() {
1334                    return getPortal().getPathFriendlyURLPrivateGroup();
1335            }
1336    
1337            public static String getPathFriendlyURLPrivateUser() {
1338                    return getPortal().getPathFriendlyURLPrivateUser();
1339            }
1340    
1341            public static String getPathFriendlyURLPublic() {
1342                    return getPortal().getPathFriendlyURLPublic();
1343            }
1344    
1345            public static String getPathImage() {
1346                    return getPortal().getPathImage();
1347            }
1348    
1349            public static String getPathMain() {
1350                    return getPortal().getPathMain();
1351            }
1352    
1353            public static String getPathModule() {
1354                    return getPortal().getPathModule();
1355            }
1356    
1357            public static String getPathProxy() {
1358                    return getPortal().getPathProxy();
1359            }
1360    
1361            public static long getPlidFromFriendlyURL(
1362                    long companyId, String friendlyURL) {
1363    
1364                    return getPortal().getPlidFromFriendlyURL(companyId, friendlyURL);
1365            }
1366    
1367            public static long getPlidFromPortletId(
1368                            long groupId, boolean privateLayout, String portletId)
1369                    throws PortalException {
1370    
1371                    return getPortal().getPlidFromPortletId(
1372                            groupId, privateLayout, portletId);
1373            }
1374    
1375            public static long getPlidFromPortletId(long groupId, String portletId)
1376                    throws PortalException {
1377    
1378                    return getPortal().getPlidFromPortletId(groupId, portletId);
1379            }
1380    
1381            public static Portal getPortal() {
1382                    PortalRuntimePermission.checkGetBeanProperty(PortalUtil.class);
1383    
1384                    return _portal;
1385            }
1386    
1387            public static PortalInetSocketAddressEventListener[]
1388                    getPortalInetSocketAddressEventListeners() {
1389    
1390                    return getPortal().getPortalInetSocketAddressEventListeners();
1391            }
1392    
1393            public static String getPortalLibDir() {
1394                    return getPortal().getPortalLibDir();
1395            }
1396    
1397            public static InetAddress getPortalLocalInetAddress(boolean secure) {
1398                    return getPortal().getPortalLocalInetAddress(secure);
1399            }
1400    
1401            public static int getPortalLocalPort(boolean secure) {
1402                    return getPortal().getPortalLocalPort(secure);
1403            }
1404    
1405            /**
1406             * @deprecated As of 6.1.0, replaced by {@link #getPortalPort(boolean)}
1407             */
1408            @Deprecated
1409            public static int getPortalPort() {
1410                    return getPortal().getPortalPort();
1411            }
1412    
1413            /**
1414             * @deprecated As of 7.0.0, replaced by {@link
1415             *             #getPortalServerPort(boolean)}
1416             */
1417            @Deprecated
1418            public static int getPortalPort(boolean secure) {
1419                    return getPortal().getPortalPort(secure);
1420            }
1421    
1422            public static Properties getPortalProperties() {
1423                    return getPortal().getPortalProperties();
1424            }
1425    
1426            public static InetAddress getPortalServerInetAddress(boolean secure) {
1427                    return getPortal().getPortalServerInetAddress(secure);
1428            }
1429    
1430            public static int getPortalServerPort(boolean secure) {
1431                    return getPortal().getPortalServerPort(secure);
1432            }
1433    
1434            public static String getPortalURL(HttpServletRequest request) {
1435                    return getPortal().getPortalURL(request);
1436            }
1437    
1438            public static String getPortalURL(
1439                    HttpServletRequest request, boolean secure) {
1440    
1441                    return getPortal().getPortalURL(request, secure);
1442            }
1443    
1444            public static String getPortalURL(Layout layout, ThemeDisplay themeDisplay)
1445                    throws PortalException {
1446    
1447                    return getPortal().getPortalURL(layout, themeDisplay);
1448            }
1449    
1450            public static String getPortalURL(PortletRequest portletRequest) {
1451                    return getPortal().getPortalURL(portletRequest);
1452            }
1453    
1454            public static String getPortalURL(
1455                    PortletRequest portletRequest, boolean secure) {
1456    
1457                    return getPortal().getPortalURL(portletRequest, secure);
1458            }
1459    
1460            public static String getPortalURL(
1461                    String serverName, int serverPort, boolean secure) {
1462    
1463                    return getPortal().getPortalURL(serverName, serverPort, secure);
1464            }
1465    
1466            public static String getPortalURL(ThemeDisplay themeDisplay)
1467                    throws PortalException {
1468    
1469                    return getPortal().getPortalURL(themeDisplay);
1470            }
1471    
1472            public static String getPortalWebDir() {
1473                    return getPortal().getPortalWebDir();
1474            }
1475    
1476            /**
1477             * @deprecated As of 6.2.0 replaced by {@link
1478             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletInvocationWhitelist}
1479             */
1480            @Deprecated
1481            public static Set<String> getPortletAddDefaultResourceCheckWhitelist() {
1482                    return getPortal().getPortletAddDefaultResourceCheckWhitelist();
1483            }
1484    
1485            /**
1486             * @deprecated As of 6.2.0 replaced by {@link
1487             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#getPortletInvocationWhitelistActions}
1488             */
1489            @Deprecated
1490            public static Set<String>
1491                    getPortletAddDefaultResourceCheckWhitelistActions() {
1492    
1493                    return getPortal().getPortletAddDefaultResourceCheckWhitelistActions();
1494            }
1495    
1496            /**
1497             * @deprecated As of 6.1.0, replaced by {@link
1498             *             #getPortletBreadcrumbs(HttpServletRequest)}
1499             */
1500            @Deprecated
1501            public static List<BreadcrumbEntry> getPortletBreadcrumbList(
1502                    HttpServletRequest request) {
1503    
1504                    return getPortal().getPortletBreadcrumbList(request);
1505            }
1506    
1507            /**
1508             * @deprecated As of 7.0.0, replaced by {@link
1509             *             com.liferay.portal.kernel.servlet.taglib.ui.BreadcrumbUtil#getPortletBreadcrumbEntries(
1510             *             HttpServletRequest)}
1511             */
1512            @Deprecated
1513            public static List<BreadcrumbEntry> getPortletBreadcrumbs(
1514                    HttpServletRequest request) {
1515    
1516                    return getPortal().getPortletBreadcrumbs(request);
1517            }
1518    
1519            public static PortletConfig getPortletConfig(
1520                            long companyId, String portletId, ServletContext servletContext)
1521                    throws PortletException {
1522    
1523                    Portlet portlet = PortletLocalServiceUtil.getPortletById(
1524                            companyId, portletId);
1525    
1526                    InvokerPortlet invokerPortlet = PortletInstanceFactoryUtil.create(
1527                            portlet, servletContext);
1528    
1529                    return invokerPortlet.getPortletConfig();
1530            }
1531    
1532            public static String getPortletDescription(
1533                    Portlet portlet, ServletContext servletContext, Locale locale) {
1534    
1535                    return getPortal().getPortletDescription(
1536                            portlet, servletContext, locale);
1537            }
1538    
1539            public static String getPortletDescription(Portlet portlet, User user) {
1540                    return getPortal().getPortletDescription(portlet, user);
1541            }
1542    
1543            public static String getPortletDescription(
1544                    String portletId, Locale locale) {
1545    
1546                    return getPortal().getPortletDescription(portletId, locale);
1547            }
1548    
1549            public static String getPortletDescription(
1550                    String portletId, String languageId) {
1551    
1552                    return getPortal().getPortletDescription(portletId, languageId);
1553            }
1554    
1555            public static String getPortletDescription(String portletId, User user) {
1556                    return getPortal().getPortletDescription(portletId, user);
1557            }
1558    
1559            public static String getPortletId(HttpServletRequest request) {
1560                    return getPortal().getPortletId(request);
1561            }
1562    
1563            public static String getPortletId(PortletRequest portletRequest) {
1564                    return getPortal().getPortletId(portletRequest);
1565            }
1566    
1567            public static String getPortletLongTitle(Portlet portlet, Locale locale) {
1568                    return getPortal().getPortletLongTitle(portlet, locale);
1569            }
1570    
1571            public static String getPortletLongTitle(
1572                    Portlet portlet, ServletContext servletContext, Locale locale) {
1573    
1574                    return getPortal().getPortletLongTitle(portlet, servletContext, locale);
1575            }
1576    
1577            public static String getPortletLongTitle(
1578                    Portlet portlet, String languageId) {
1579    
1580                    return getPortal().getPortletLongTitle(portlet, languageId);
1581            }
1582    
1583            public static String getPortletLongTitle(Portlet portlet, User user) {
1584                    return getPortal().getPortletLongTitle(portlet, user);
1585            }
1586    
1587            public static String getPortletLongTitle(String portletId, Locale locale) {
1588                    return getPortal().getPortletLongTitle(portletId, locale);
1589            }
1590    
1591            public static String getPortletLongTitle(
1592                    String portletId, String languageId) {
1593    
1594                    return getPortal().getPortletLongTitle(portletId, languageId);
1595            }
1596    
1597            public static String getPortletLongTitle(String portletId, User user) {
1598                    return getPortal().getPortletLongTitle(portletId, user);
1599            }
1600    
1601            public static String getPortletNamespace(String portletId) {
1602                    return getPortal().getPortletNamespace(portletId);
1603            }
1604    
1605            public static String getPortletTitle(Portlet portlet, Locale locale) {
1606                    return getPortal().getPortletTitle(portlet, locale);
1607            }
1608    
1609            public static String getPortletTitle(
1610                    Portlet portlet, ServletContext servletContext, Locale locale) {
1611    
1612                    return getPortal().getPortletTitle(portlet, servletContext, locale);
1613            }
1614    
1615            public static String getPortletTitle(Portlet portlet, String languageId) {
1616                    return getPortal().getPortletTitle(portlet, languageId);
1617            }
1618    
1619            public static String getPortletTitle(Portlet portlet, User user) {
1620                    return getPortal().getPortletTitle(portlet, user);
1621            }
1622    
1623            public static String getPortletTitle(PortletRequest portletRequest) {
1624                    return getPortal().getPortletTitle(portletRequest);
1625            }
1626    
1627            public static String getPortletTitle(PortletResponse portletResponse) {
1628                    return getPortal().getPortletTitle(portletResponse);
1629            }
1630    
1631            public static String getPortletTitle(String portletId, Locale locale) {
1632                    return getPortal().getPortletTitle(portletId, locale);
1633            }
1634    
1635            public static String getPortletTitle(
1636                    String portletId, ResourceBundle resourceBundle) {
1637    
1638                    return getPortal().getPortletTitle(portletId, resourceBundle);
1639            }
1640    
1641            public static String getPortletTitle(String portletId, String languageId) {
1642                    return getPortal().getPortletTitle(portletId, languageId);
1643            }
1644    
1645            public static String getPortletTitle(String portletId, User user) {
1646                    return getPortal().getPortletTitle(portletId, user);
1647            }
1648    
1649            public static String getPortletXmlFileName() {
1650                    return getPortal().getPortletXmlFileName();
1651            }
1652    
1653            public static PortletPreferences getPreferences(
1654                    HttpServletRequest request) {
1655    
1656                    return getPortal().getPreferences(request);
1657            }
1658    
1659            public static PreferencesValidator getPreferencesValidator(
1660                    Portlet portlet) {
1661    
1662                    return getPortal().getPreferencesValidator(portlet);
1663            }
1664    
1665            public static String getRelativeHomeURL(HttpServletRequest request)
1666                    throws PortalException {
1667    
1668                    return getPortal().getRelativeHomeURL(request);
1669            }
1670    
1671            public static ResourceBundle getResourceBundle(Locale locale) {
1672                    return getPortal().getResourceBundle(locale);
1673            }
1674    
1675            public static long getScopeGroupId(HttpServletRequest request)
1676                    throws PortalException {
1677    
1678                    return getPortal().getScopeGroupId(request);
1679            }
1680    
1681            public static long getScopeGroupId(
1682                            HttpServletRequest request, String portletId)
1683                    throws PortalException {
1684    
1685                    return getPortal().getScopeGroupId(request, portletId);
1686            }
1687    
1688            public static long getScopeGroupId(
1689                            HttpServletRequest request, String portletId,
1690                            boolean checkStagingGroup)
1691                    throws PortalException {
1692    
1693                    return getPortal().getScopeGroupId(
1694                            request, portletId, checkStagingGroup);
1695            }
1696    
1697            public static long getScopeGroupId(Layout layout) {
1698                    return getPortal().getScopeGroupId(layout);
1699            }
1700    
1701            public static long getScopeGroupId(Layout layout, String portletId) {
1702                    return getPortal().getScopeGroupId(layout, portletId);
1703            }
1704    
1705            public static long getScopeGroupId(long plid) {
1706                    return getPortal().getScopeGroupId(plid);
1707            }
1708    
1709            public static long getScopeGroupId(PortletRequest portletRequest)
1710                    throws PortalException {
1711    
1712                    return getPortal().getScopeGroupId(portletRequest);
1713            }
1714    
1715            public static User getSelectedUser(HttpServletRequest request)
1716                    throws PortalException {
1717    
1718                    return getPortal().getSelectedUser(request);
1719            }
1720    
1721            public static User getSelectedUser(
1722                            HttpServletRequest request, boolean checkPermission)
1723                    throws PortalException {
1724    
1725                    return getPortal().getSelectedUser(request, checkPermission);
1726            }
1727    
1728            public static User getSelectedUser(PortletRequest portletRequest)
1729                    throws PortalException {
1730    
1731                    return getPortal().getSelectedUser(portletRequest);
1732            }
1733    
1734            public static User getSelectedUser(
1735                            PortletRequest portletRequest, boolean checkPermission)
1736                    throws PortalException {
1737    
1738                    return getPortal().getSelectedUser(portletRequest, checkPermission);
1739            }
1740    
1741            public static String getServletContextName() {
1742                    return getPortal().getServletContextName();
1743            }
1744    
1745            public static long[] getSharedContentSiteGroupIds(
1746                            long companyId, long groupId, long userId)
1747                    throws PortalException {
1748    
1749                    return getPortal().getSharedContentSiteGroupIds(
1750                            companyId, groupId, userId);
1751            }
1752    
1753            public static Map<String, List<Portlet>> getSiteAdministrationCategoriesMap(
1754                    HttpServletRequest request) {
1755    
1756                    return getPortal().getSiteAdministrationCategoriesMap(request);
1757            }
1758    
1759            public static PortletURL getSiteAdministrationURL(
1760                    HttpServletRequest request, ThemeDisplay themeDisplay) {
1761    
1762                    return getPortal().getSiteAdministrationURL(request, themeDisplay);
1763            }
1764    
1765            public static PortletURL getSiteAdministrationURL(
1766                    HttpServletRequest request, ThemeDisplay themeDisplay,
1767                    String portletName) {
1768    
1769                    return getPortal().getSiteAdministrationURL(
1770                            request, themeDisplay, portletName);
1771            }
1772    
1773            public static PortletURL getSiteAdministrationURL(
1774                    PortletResponse portletResponse, ThemeDisplay themeDisplay) {
1775    
1776                    return getPortal().getSiteAdministrationURL(
1777                            portletResponse, themeDisplay);
1778            }
1779    
1780            public static PortletURL getSiteAdministrationURL(
1781                    PortletResponse portletResponse, ThemeDisplay themeDisplay,
1782                    String portletName) {
1783    
1784                    return getPortal().getSiteAdministrationURL(
1785                            portletResponse, themeDisplay, portletName);
1786            }
1787    
1788            /**
1789             * @deprecated As of 7.0.0, replaced by {@link
1790             *             #getCurrentAndAncestorSiteGroupIds(long)}
1791             */
1792            @Deprecated
1793            public static long[] getSiteAndCompanyGroupIds(long groupId)
1794                    throws PortalException {
1795    
1796                    return getPortal().getSiteAndCompanyGroupIds(groupId);
1797            }
1798    
1799            /**
1800             * @deprecated As of 7.0.0, replaced by {@link
1801             *             #getCurrentAndAncestorSiteGroupIds(long)}
1802             */
1803            @Deprecated
1804            public static long[] getSiteAndCompanyGroupIds(ThemeDisplay themeDisplay)
1805                    throws PortalException {
1806    
1807                    return getPortal().getSiteAndCompanyGroupIds(themeDisplay);
1808            }
1809    
1810            public static Locale getSiteDefaultLocale(long groupId)
1811                    throws PortalException {
1812    
1813                    return getPortal().getSiteDefaultLocale(groupId);
1814            }
1815    
1816            public static long getSiteGroupId(long scopeGroupId)
1817                    throws PortalException {
1818    
1819                    return getPortal().getSiteGroupId(scopeGroupId);
1820            }
1821    
1822            public static String getSiteLoginURL(ThemeDisplay themeDisplay)
1823                    throws PortalException {
1824    
1825                    return getPortal().getSiteLoginURL(themeDisplay);
1826            }
1827    
1828            public static String getStaticResourceURL(
1829                    HttpServletRequest request, String uri) {
1830    
1831                    return getPortal().getStaticResourceURL(request, uri);
1832            }
1833    
1834            public static String getStaticResourceURL(
1835                    HttpServletRequest request, String uri, long timestamp) {
1836    
1837                    return getPortal().getStaticResourceURL(request, uri, timestamp);
1838            }
1839    
1840            public static String getStaticResourceURL(
1841                    HttpServletRequest request, String uri, String queryString) {
1842    
1843                    return getPortal().getStaticResourceURL(request, uri, queryString);
1844            }
1845    
1846            public static String getStaticResourceURL(
1847                    HttpServletRequest request, String uri, String queryString,
1848                    long timestamp) {
1849    
1850                    return getPortal().getStaticResourceURL(
1851                            request, uri, queryString, timestamp);
1852            }
1853    
1854            public static String getStrutsAction(HttpServletRequest request) {
1855                    return getPortal().getStrutsAction(request);
1856            }
1857    
1858            public static String[] getSystemGroups() {
1859                    return getPortal().getSystemGroups();
1860            }
1861    
1862            public static String[] getSystemOrganizationRoles() {
1863                    return getPortal().getSystemOrganizationRoles();
1864            }
1865    
1866            public static String[] getSystemRoles() {
1867                    return getPortal().getSystemRoles();
1868            }
1869    
1870            public static String[] getSystemSiteRoles() {
1871                    return getPortal().getSystemSiteRoles();
1872            }
1873    
1874            public static String getUniqueElementId(
1875                    HttpServletRequest request, String namespace, String id) {
1876    
1877                    return getPortal().getUniqueElementId(request, namespace, id);
1878            }
1879    
1880            public static String getUniqueElementId(
1881                    PortletRequest request, String namespace, String id) {
1882    
1883                    return getPortal().getUniqueElementId(request, namespace, id);
1884            }
1885    
1886            public static UploadPortletRequest getUploadPortletRequest(
1887                    PortletRequest portletRequest) {
1888    
1889                    return getPortal().getUploadPortletRequest(portletRequest);
1890            }
1891    
1892            public static UploadServletRequest getUploadServletRequest(
1893                    HttpServletRequest request) {
1894    
1895                    return getPortal().getUploadServletRequest(request);
1896            }
1897    
1898            public static Date getUptime() {
1899                    return getPortal().getUptime();
1900            }
1901    
1902            public static String getURLWithSessionId(String url, String sessionId) {
1903                    return getPortal().getURLWithSessionId(url, sessionId);
1904            }
1905    
1906            public static User getUser(HttpServletRequest request)
1907                    throws PortalException {
1908    
1909                    return getPortal().getUser(request);
1910            }
1911    
1912            public static User getUser(PortletRequest portletRequest)
1913                    throws PortalException {
1914    
1915                    return getPortal().getUser(portletRequest);
1916            }
1917    
1918            public static String getUserEmailAddress(long userId) {
1919                    return getPortal().getUserEmailAddress(userId);
1920            }
1921    
1922            public static long getUserId(HttpServletRequest request) {
1923                    return getPortal().getUserId(request);
1924            }
1925    
1926            public static long getUserId(PortletRequest portletRequest) {
1927                    return getPortal().getUserId(portletRequest);
1928            }
1929    
1930            public static String getUserName(BaseModel<?> baseModel) {
1931                    return getPortal().getUserName(baseModel);
1932            }
1933    
1934            public static String getUserName(long userId, String defaultUserName) {
1935                    return getPortal().getUserName(userId, defaultUserName);
1936            }
1937    
1938            public static String getUserName(
1939                    long userId, String defaultUserName, HttpServletRequest request) {
1940    
1941                    return getPortal().getUserName(userId, defaultUserName, request);
1942            }
1943    
1944            public static String getUserName(
1945                    long userId, String defaultUserName, String userAttribute) {
1946    
1947                    return getPortal().getUserName(userId, defaultUserName, userAttribute);
1948            }
1949    
1950            public static String getUserName(
1951                    long userId, String defaultUserName, String userAttribute,
1952                    HttpServletRequest request) {
1953    
1954                    return getPortal().getUserName(
1955                            userId, defaultUserName, userAttribute, request);
1956            }
1957    
1958            public static String getUserPassword(HttpServletRequest request) {
1959                    return getPortal().getUserPassword(request);
1960            }
1961    
1962            public static String getUserPassword(HttpSession session) {
1963                    return getPortal().getUserPassword(session);
1964            }
1965    
1966            public static String getUserPassword(PortletRequest portletRequest) {
1967                    return getPortal().getUserPassword(portletRequest);
1968            }
1969    
1970            /**
1971             * @deprecated As of 7.0.0, with no direct replacement
1972             */
1973            @Deprecated
1974            public static String getUserValue(
1975                    long userId, String param, String defaultValue) {
1976    
1977                    return getPortal().getUserValue(userId, param, defaultValue);
1978            }
1979    
1980            public static String getValidPortalDomain(long companyId, String domain) {
1981                    return getPortal().getValidPortalDomain(companyId, domain);
1982            }
1983    
1984            public static long getValidUserId(long companyId, long userId)
1985                    throws PortalException {
1986    
1987                    return getPortal().getValidUserId(companyId, userId);
1988            }
1989    
1990            public static String getVirtualHostname(LayoutSet layoutSet) {
1991                    return getPortal().getVirtualHostname(layoutSet);
1992            }
1993    
1994            public static String getVirtualLayoutActualURL(
1995                            long groupId, boolean privateLayout, String mainPath,
1996                            String friendlyURL, Map<String, String[]> params,
1997                            Map<String, Object> requestContext)
1998                    throws PortalException {
1999    
2000                    return getPortal().getVirtualLayoutActualURL(
2001                            groupId, privateLayout, mainPath, friendlyURL, params,
2002                            requestContext);
2003            }
2004    
2005            public static LayoutFriendlyURLComposite
2006                    getVirtualLayoutFriendlyURLComposite(
2007                            boolean privateLayout, String friendlyURL,
2008                            Map<String, String[]> params, Map<String, Object> requestContext)
2009                    throws PortalException {
2010    
2011                    return getPortal().getVirtualLayoutFriendlyURLComposite(
2012                            privateLayout, friendlyURL, params, requestContext);
2013            }
2014    
2015            public static String getWidgetURL(
2016                            Portlet portlet, ThemeDisplay themeDisplay)
2017                    throws PortalException {
2018    
2019                    return getPortal().getWidgetURL(portlet, themeDisplay);
2020            }
2021    
2022            public static void initCustomSQL() {
2023                    getPortal().initCustomSQL();
2024            }
2025    
2026            public static User initUser(HttpServletRequest request) throws Exception {
2027                    return getPortal().initUser(request);
2028            }
2029    
2030            public static void invokeTaglibDiscussion(
2031                            PortletConfig portletConfig, ActionRequest actionRequest,
2032                            ActionResponse actionResponse)
2033                    throws Exception {
2034    
2035                    getPortal().invokeTaglibDiscussion(
2036                            portletConfig, actionRequest, actionResponse);
2037            }
2038    
2039            /**
2040             * @deprecated As of 6.2.0, with no direct replacement
2041             */
2042            @Deprecated
2043            public static boolean isAllowAddPortletDefaultResource(
2044                            HttpServletRequest request, Portlet portlet)
2045                    throws PortalException {
2046    
2047                    return getPortal().isAllowAddPortletDefaultResource(request, portlet);
2048            }
2049    
2050            public static boolean isCDNDynamicResourcesEnabled(
2051                            HttpServletRequest request)
2052                    throws PortalException {
2053    
2054                    return getPortal().isCDNDynamicResourcesEnabled(request);
2055            }
2056    
2057            public static boolean isCDNDynamicResourcesEnabled(long companyId) {
2058                    return getPortal().isCDNDynamicResourcesEnabled(companyId);
2059            }
2060    
2061            /**
2062             * @deprecated As of 6.1.0, renamed to {@link #isGroupAdmin(User, long)}
2063             */
2064            @Deprecated
2065            public static boolean isCommunityAdmin(User user, long groupId)
2066                    throws Exception {
2067    
2068                    return getPortal().isCommunityAdmin(user, groupId);
2069            }
2070    
2071            /**
2072             * @deprecated As of 6.1.0, renamed to {@link #isGroupOwner(User, long)}
2073             */
2074            @Deprecated
2075            public static boolean isCommunityOwner(User user, long groupId)
2076                    throws Exception {
2077    
2078                    return getPortal().isCommunityOwner(user, groupId);
2079            }
2080    
2081            public static boolean isCompanyAdmin(User user) throws Exception {
2082                    return getPortal().isCompanyAdmin(user);
2083            }
2084    
2085            public static boolean isCompanyControlPanelPortlet(
2086                            String portletId, String category, ThemeDisplay themeDisplay)
2087                    throws PortalException {
2088    
2089                    return getPortal().isCompanyControlPanelPortlet(
2090                            portletId, category, themeDisplay);
2091            }
2092    
2093            public static boolean isCompanyControlPanelPortlet(
2094                            String portletId, ThemeDisplay themeDisplay)
2095                    throws PortalException {
2096    
2097                    return getPortal().isCompanyControlPanelPortlet(
2098                            portletId, themeDisplay);
2099            }
2100    
2101            public static boolean isCompanyControlPanelVisible(
2102                            ThemeDisplay themeDisplay)
2103                    throws PortalException {
2104    
2105                    return getPortal().isCompanyControlPanelVisible(themeDisplay);
2106            }
2107    
2108            public static boolean isControlPanelPortlet(
2109                    String portletId, String category, ThemeDisplay themeDisplay) {
2110    
2111                    return getPortal().isControlPanelPortlet(
2112                            portletId, category, themeDisplay);
2113            }
2114    
2115            public static boolean isControlPanelPortlet(
2116                    String portletId, ThemeDisplay themeDisplay) {
2117    
2118                    return getPortal().isControlPanelPortlet(portletId, themeDisplay);
2119            }
2120    
2121            public static boolean isGroupAdmin(User user, long groupId)
2122                    throws Exception {
2123    
2124                    return getPortal().isGroupAdmin(user, groupId);
2125            }
2126    
2127            public static boolean isGroupFriendlyURL(
2128                    String fullURL, String groupFriendlyURL, String layoutFriendlyURL) {
2129    
2130                    return getPortal().isGroupFriendlyURL(
2131                            fullURL, groupFriendlyURL, layoutFriendlyURL);
2132            }
2133    
2134            public static boolean isGroupOwner(User user, long groupId)
2135                    throws Exception {
2136    
2137                    return getPortal().isGroupOwner(user, groupId);
2138            }
2139    
2140            public static boolean isLayoutDescendant(Layout layout, long layoutId)
2141                    throws PortalException {
2142    
2143                    return getPortal().isLayoutDescendant(layout, layoutId);
2144            }
2145    
2146            public static boolean isLayoutSitemapable(Layout layout) {
2147                    return getPortal().isLayoutSitemapable(layout);
2148            }
2149    
2150            public static boolean isLoginRedirectRequired(HttpServletRequest request) {
2151                    return getPortal().isLoginRedirectRequired(request);
2152            }
2153    
2154            public static boolean isMethodGet(PortletRequest portletRequest) {
2155                    return getPortal().isMethodGet(portletRequest);
2156            }
2157    
2158            public static boolean isMethodPost(PortletRequest portletRequest) {
2159                    return getPortal().isMethodPost(portletRequest);
2160            }
2161    
2162            public static boolean isMultipartRequest(HttpServletRequest request) {
2163                    return getPortal().isMultipartRequest(request);
2164            }
2165    
2166            public static boolean isOmniadmin(long userId) {
2167                    return getPortal().isOmniadmin(userId);
2168            }
2169    
2170            public static boolean isOmniadmin(User user) {
2171                    return getPortal().isOmniadmin(user);
2172            }
2173    
2174            public static boolean isReservedParameter(String name) {
2175                    return getPortal().isReservedParameter(name);
2176            }
2177    
2178            public static boolean isRightToLeft(HttpServletRequest request) {
2179                    return getPortal().isRightToLeft(request);
2180            }
2181    
2182            public static boolean isRSSFeedsEnabled() {
2183                    return getPortal().isRSSFeedsEnabled();
2184            }
2185    
2186            public static boolean isSecure(HttpServletRequest request) {
2187                    return getPortal().isSecure(request);
2188            }
2189    
2190            public static boolean isSystemGroup(String groupName) {
2191                    return getPortal().isSystemGroup(groupName);
2192            }
2193    
2194            public static boolean isSystemRole(String roleName) {
2195                    return getPortal().isSystemRole(roleName);
2196            }
2197    
2198            public static boolean isUpdateAvailable() {
2199                    return getPortal().isUpdateAvailable();
2200            }
2201    
2202            public static boolean isValidResourceId(String resourceId) {
2203                    return getPortal().isValidResourceId(resourceId);
2204            }
2205    
2206            public static boolean removePortalEventListener(
2207                    PortalInetSocketAddressEventListener
2208                            portalInetSocketAddressEventListener) {
2209    
2210                    return getPortal().removePortalInetSocketAddressEventListener(
2211                            portalInetSocketAddressEventListener);
2212            }
2213    
2214            public static void resetCDNHosts() {
2215                    getPortal().resetCDNHosts();
2216            }
2217    
2218            /**
2219             * @deprecated As of 6.2.0 replaced by {@link
2220             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#resetPortletInvocationWhitelist}
2221             */
2222            @Deprecated
2223            public static Set<String> resetPortletAddDefaultResourceCheckWhitelist() {
2224                    return getPortal().resetPortletAddDefaultResourceCheckWhitelist();
2225            }
2226    
2227            /**
2228             * @deprecated As of 6.2.0 replaced by {@link
2229             *             com.liferay.portal.security.auth.AuthTokenWhitelistUtil#resetPortletInvocationWhitelistActions}
2230             */
2231            @Deprecated
2232            public static Set<String>
2233                    resetPortletAddDefaultResourceCheckWhitelistActions() {
2234    
2235                    return getPortal().
2236                            resetPortletAddDefaultResourceCheckWhitelistActions();
2237            }
2238    
2239            public static String resetPortletParameters(String url, String portletId) {
2240                    return getPortal().resetPortletParameters(url, portletId);
2241            }
2242    
2243            /**
2244             * @deprecated As of 6.1.0, replaced by {@link DB#runSQL(String)}
2245             */
2246            @Deprecated
2247            public static void runSQL(String sql) throws IOException, SQLException {
2248                    DBFactoryUtil.getDB().runSQL(sql);
2249            }
2250    
2251            public static void sendError(
2252                            Exception e, ActionRequest actionRequest,
2253                            ActionResponse actionResponse)
2254                    throws IOException {
2255    
2256                    getPortal().sendError(e, actionRequest, actionResponse);
2257            }
2258    
2259            public static void sendError(
2260                            Exception e, HttpServletRequest request,
2261                            HttpServletResponse response)
2262                    throws IOException, ServletException {
2263    
2264                    getPortal().sendError(e, request, response);
2265            }
2266    
2267            public static void sendError(
2268                            int status, Exception e, ActionRequest actionRequest,
2269                            ActionResponse actionResponse)
2270                    throws IOException {
2271    
2272                    getPortal().sendError(status, e, actionRequest, actionResponse);
2273            }
2274    
2275            public static void sendError(
2276                            int status, Exception e, HttpServletRequest request,
2277                            HttpServletResponse response)
2278                    throws IOException, ServletException {
2279    
2280                    getPortal().sendError(status, e, request, response);
2281            }
2282    
2283            public static void sendRSSFeedsDisabledError(
2284                            HttpServletRequest request, HttpServletResponse response)
2285                    throws IOException, ServletException {
2286    
2287                    getPortal().sendRSSFeedsDisabledError(request, response);
2288            }
2289    
2290            public static void sendRSSFeedsDisabledError(
2291                            PortletRequest portletRequest, PortletResponse portletResponse)
2292                    throws IOException, ServletException {
2293    
2294                    getPortal().sendRSSFeedsDisabledError(portletRequest, portletResponse);
2295            }
2296    
2297            /**
2298             * Sets the description for a page. This overrides the existing page
2299             * description.
2300             */
2301            public static void setPageDescription(
2302                    String description, HttpServletRequest request) {
2303    
2304                    getPortal().setPageDescription(description, request);
2305            }
2306    
2307            /**
2308             * Sets the keywords for a page. This overrides the existing page keywords.
2309             */
2310            public static void setPageKeywords(
2311                    String keywords, HttpServletRequest request) {
2312    
2313                    getPortal().setPageKeywords(keywords, request);
2314            }
2315    
2316            /**
2317             * Sets the subtitle for a page. This overrides the existing page subtitle.
2318             */
2319            public static void setPageSubtitle(
2320                    String subtitle, HttpServletRequest request) {
2321    
2322                    getPortal().setPageSubtitle(subtitle, request);
2323            }
2324    
2325            /**
2326             * Sets the whole title for a page. This overrides the existing page whole
2327             * title.
2328             */
2329            public static void setPageTitle(String title, HttpServletRequest request) {
2330                    getPortal().setPageTitle(title, request);
2331            }
2332    
2333            public static void setPortalInetSocketAddresses(
2334                    HttpServletRequest request) {
2335    
2336                    getPortal().setPortalInetSocketAddresses(request);
2337            }
2338    
2339            /**
2340             * Sets the port obtained on the first request to the portal.
2341             *
2342             * @deprecated As of 7.0.0, replaced by {@link
2343             *             #setPortalInetSocketAddresses(HttpServletRequest)}
2344             */
2345            @Deprecated
2346            public static void setPortalPort(HttpServletRequest request) {
2347                    getPortal().setPortalPort(request);
2348            }
2349    
2350            public static void storePreferences(PortletPreferences portletPreferences)
2351                    throws IOException, ValidatorException {
2352    
2353                    getPortal().storePreferences(portletPreferences);
2354            }
2355    
2356            public static String[] stripURLAnchor(String url, String separator) {
2357                    return getPortal().stripURLAnchor(url, separator);
2358            }
2359    
2360            public static String transformCustomSQL(String sql) {
2361                    return getPortal().transformCustomSQL(sql);
2362            }
2363    
2364            public static String transformSQL(String sql) {
2365                    return getPortal().transformSQL(sql);
2366            }
2367    
2368            public static void updateImageId(
2369                            BaseModel<?> baseModel, boolean image, byte[] bytes,
2370                            String fieldName, long maxSize, int maxHeight, int maxWidth)
2371                    throws PortalException {
2372    
2373                    getPortal().updateImageId(
2374                            baseModel, image, bytes, fieldName, maxSize, maxHeight, maxWidth);
2375            }
2376    
2377            public static PortletMode updatePortletMode(
2378                    String portletId, User user, Layout layout, PortletMode portletMode,
2379                    HttpServletRequest request) {
2380    
2381                    return getPortal().updatePortletMode(
2382                            portletId, user, layout, portletMode, request);
2383            }
2384    
2385            public static String updateRedirect(
2386                    String redirect, String oldPath, String newPath) {
2387    
2388                    return getPortal().updateRedirect(redirect, oldPath, newPath);
2389            }
2390    
2391            public static WindowState updateWindowState(
2392                    String portletId, User user, Layout layout, WindowState windowState,
2393                    HttpServletRequest request) {
2394    
2395                    return getPortal().updateWindowState(
2396                            portletId, user, layout, windowState, request);
2397            }
2398    
2399            /**
2400             * @deprecated As of 7.0.0, replaced by {@link
2401             *             #removePortalInetSocketAddressEventListener(
2402             *             PortalInetSocketAddressEventListener)}
2403             */
2404            @Deprecated
2405            public void removePortalPortEventListener(
2406                    PortalPortEventListener portalPortEventListener) {
2407    
2408                    getPortal().removePortalPortEventListener(portalPortEventListener);
2409            }
2410    
2411            public void setPortal(Portal portal) {
2412                    PortalRuntimePermission.checkSetBeanProperty(getClass());
2413    
2414                    _portal = portal;
2415            }
2416    
2417            private static Portal _portal;
2418    
2419    }