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