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.kernel.util;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    import com.liferay.portal.kernel.exception.PortalException;
021    import com.liferay.portal.kernel.model.BaseModel;
022    import com.liferay.portal.kernel.model.Company;
023    import com.liferay.portal.kernel.model.Group;
024    import com.liferay.portal.kernel.model.Layout;
025    import com.liferay.portal.kernel.model.LayoutFriendlyURLComposite;
026    import com.liferay.portal.kernel.model.LayoutQueryStringComposite;
027    import com.liferay.portal.kernel.model.LayoutSet;
028    import com.liferay.portal.kernel.model.LayoutTypePortlet;
029    import com.liferay.portal.kernel.model.Portlet;
030    import com.liferay.portal.kernel.model.ResourcePermission;
031    import com.liferay.portal.kernel.model.User;
032    import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
033    import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
034    import com.liferay.portal.kernel.servlet.taglib.ui.BreadcrumbEntry;
035    import com.liferay.portal.kernel.theme.PortletDisplay;
036    import com.liferay.portal.kernel.theme.ThemeDisplay;
037    import com.liferay.portal.kernel.upload.UploadPortletRequest;
038    import com.liferay.portal.kernel.upload.UploadServletRequest;
039    
040    import java.io.IOException;
041    import java.io.Serializable;
042    
043    import java.net.InetAddress;
044    
045    import java.util.Date;
046    import java.util.List;
047    import java.util.Locale;
048    import java.util.Map;
049    import java.util.Properties;
050    import java.util.ResourceBundle;
051    import java.util.Set;
052    import java.util.TimeZone;
053    
054    import javax.portlet.ActionRequest;
055    import javax.portlet.ActionResponse;
056    import javax.portlet.PortletConfig;
057    import javax.portlet.PortletException;
058    import javax.portlet.PortletMode;
059    import javax.portlet.PortletPreferences;
060    import javax.portlet.PortletRequest;
061    import javax.portlet.PortletResponse;
062    import javax.portlet.PortletURL;
063    import javax.portlet.PreferencesValidator;
064    import javax.portlet.RenderRequest;
065    import javax.portlet.ResourceRequest;
066    import javax.portlet.ResourceResponse;
067    import javax.portlet.ValidatorException;
068    import javax.portlet.WindowState;
069    
070    import javax.servlet.ServletContext;
071    import javax.servlet.ServletException;
072    import javax.servlet.http.HttpServletRequest;
073    import javax.servlet.http.HttpServletResponse;
074    import javax.servlet.http.HttpSession;
075    
076    /**
077     * @author Brian Wing Shun Chan
078     * @author Eduardo Lundgren
079     */
080    @ProviderType
081    public interface Portal {
082    
083            public static final String FRIENDLY_URL_SEPARATOR = "/-/";
084    
085            public static final String JSESSIONID = ";jsessionid=";
086    
087            public static final String PATH_IMAGE = "/image";
088    
089            public static final String PATH_MAIN = "/c";
090    
091            public static final String PATH_MODULE = "/o";
092    
093            public static final String PATH_PORTAL_LAYOUT = "/portal/layout";
094    
095            public static final String PORTAL_REALM = "PortalRealm";
096    
097            public static final String PORTLET_XML_FILE_NAME_CUSTOM =
098                    "portlet-custom.xml";
099    
100            public static final String PORTLET_XML_FILE_NAME_STANDARD = "portlet.xml";
101    
102            public static final String TEMP_OBFUSCATION_VALUE =
103                    "TEMP_OBFUSCATION_VALUE";
104    
105            /**
106             * Appends the description to the current meta description of the page.
107             *
108             * @param description the description to append to the current meta
109             *        description
110             * @param request the servlet request for the page
111             */
112            public void addPageDescription(
113                    String description, HttpServletRequest request);
114    
115            /**
116             * Appends the keywords to the current meta keywords of the page.
117             *
118             * @param keywords the keywords to add to the current meta keywords
119             *        (comma-separated)
120             * @param request the servlet request for the page
121             */
122            public void addPageKeywords(String keywords, HttpServletRequest request);
123    
124            /**
125             * Appends the subtitle to the current subtitle of the page.
126             *
127             * @param subtitle the subtitle to append to the current subtitle
128             * @param request the servlet request for the page
129             */
130            public void addPageSubtitle(String subtitle, HttpServletRequest request);
131    
132            /**
133             * Appends the title to the current title of the page.
134             *
135             * @param title the title to append to the current title
136             * @param request the servlet request for the page
137             */
138            public void addPageTitle(String title, HttpServletRequest request);
139    
140            public boolean addPortalInetSocketAddressEventListener(
141                    PortalInetSocketAddressEventListener
142                            portalInetSocketAddressEventListener);
143    
144            /**
145             * Adds the portal port event listener to the portal. The listener will be
146             * notified whenever the portal port is set.
147             *
148             * @param      portalPortEventListener the portal port event listener to add
149             * @deprecated As of 7.0.0, replaced by {@link
150             *             #addPortalInetSocketAddressEventListener(
151             *             PortalInetSocketAddressEventListener)}
152             */
153            @Deprecated
154            public void addPortalPortEventListener(
155                    PortalPortEventListener portalPortEventListener);
156    
157            /**
158             * Adds an entry to the portlet breadcrumbs for the page.
159             *
160             * @param request the servlet request for the page
161             * @param title the title of the new breakcrumb entry
162             * @param url the URL of the new breadcrumb entry
163             */
164            public void addPortletBreadcrumbEntry(
165                    HttpServletRequest request, String title, String url);
166    
167            /**
168             * Adds an entry to the portlet breadcrumbs for the page.
169             *
170             * @param request the servlet request for the page
171             * @param title the title of the new breakcrumb entry
172             * @param url the URL of the new breadcrumb entry
173             * @param data the HTML5 data parameters of the new breadcrumb entry
174             */
175            public void addPortletBreadcrumbEntry(
176                    HttpServletRequest request, String title, String url,
177                    Map<String, Object> data);
178    
179            /**
180             * Adds the default resource permissions for the portlet to the page.
181             *
182             * @param request the servlet request for the page
183             * @param portlet the portlet
184             */
185            public void addPortletDefaultResource(
186                            HttpServletRequest request, Portlet portlet)
187                    throws PortalException;
188    
189            public void addPortletDefaultResource(
190                            long companyId, Layout layout, Portlet portlet)
191                    throws PortalException;
192    
193            /**
194             * Adds the preserved parameters doAsGroupId and refererPlid to the URL,
195             * optionally adding doAsUserId and doAsUserLanguageId as well.
196             *
197             * <p>
198             * Preserved parameters are parameters that should be sent with every
199             * request as the user navigates the portal.
200             * </p>
201             *
202             * @param  themeDisplay the current theme display
203             * @param  layout the current layout
204             * @param  url the URL
205             * @param  doAsUser whether to include doAsUserId and doAsLanguageId in the
206             *         URL if they are available. If <code>false</code>, doAsUserId and
207             *         doAsUserLanguageId will never be added.
208             * @return the URL with the preserved parameters added
209             */
210            public String addPreservedParameters(
211                    ThemeDisplay themeDisplay, Layout layout, String url, boolean doAsUser);
212    
213            /**
214             * Adds the preserved parameters doAsUserId, doAsUserLanguageId,
215             * doAsGroupId, and refererPlid to the URL.
216             *
217             * @param  themeDisplay the current theme display
218             * @param  url the URL
219             * @return the URL with the preserved parameters added
220             */
221            public String addPreservedParameters(ThemeDisplay themeDisplay, String url);
222    
223            public void addUserLocaleOptionsMessage(HttpServletRequest request);
224    
225            /**
226             * Clears the render parameters in the request if the portlet is in the
227             * action phase.
228             *
229             * @param renderRequest the render request
230             */
231            public void clearRequestParameters(RenderRequest renderRequest);
232    
233            /**
234             * Copies the request parameters to the render parameters, unless a
235             * parameter with that name already exists in the render parameters.
236             *
237             * @param actionRequest the request from which to get the request parameters
238             * @param actionResponse the response to receive the render parameters
239             */
240            public void copyRequestParameters(
241                    ActionRequest actionRequest, ActionResponse actionResponse);
242    
243            /**
244             * Escapes the URL for use in a redirect and checks that security settings
245             * allow the URL is allowed for redirects.
246             *
247             * @param  url the URL to escape
248             * @return the escaped URL, or <code>null</code> if the URL is not an
249             *         allowed for redirects
250             */
251            public String escapeRedirect(String url);
252    
253            /**
254             * Generates a random key to identify the request based on the input string.
255             *
256             * @param  request the servlet request for the page
257             * @param  input the input string
258             * @return the generated key
259             */
260            public String generateRandomKey(HttpServletRequest request, String input);
261    
262            public String getAbsoluteURL(HttpServletRequest request, String url);
263    
264            public LayoutQueryStringComposite getActualLayoutQueryStringComposite(
265                            long groupId, boolean privateLayout, String friendlyURL,
266                            Map<String, String[]> params, Map<String, Object> requestContext)
267                    throws PortalException;
268    
269            public String getActualURL(
270                            long groupId, boolean privateLayout, String mainPath,
271                            String friendlyURL, Map<String, String[]> params,
272                            Map<String, Object> requestContext)
273                    throws PortalException;
274    
275            /**
276             * Returns the alternate URL for the requested canonical URL in the given
277             * locale.
278             *
279             * <p>
280             * The alternate URL lets search engines know that an equivalent page is
281             * available for the given locale. For more information, see <a
282             * href="https://support.google.com/webmasters/answer/189077?hl=en">https://support.google.com/webmasters/answer/189077?hl=en</a>.
283             * </p>
284             *
285             * @param  canonicalURL the canonical URL being requested. For more
286             *         information, see {@link #getCanonicalURL}.
287             * @param  themeDisplay the theme display
288             * @param  locale the locale of the alternate (translated) page
289             * @param  layout the page being requested
290             * @return the alternate URL for the requested canonical URL in the given
291             *         locale
292             */
293            public String getAlternateURL(
294                            String canonicalURL, ThemeDisplay themeDisplay, Locale locale,
295                            Layout layout)
296                    throws PortalException;
297    
298            public long[] getAncestorSiteGroupIds(long groupId) throws PortalException;
299    
300            /**
301             * Returns the base model instance for the resource permission.
302             *
303             * @param  resourcePermission the resource permission
304             * @return the base model instance, or <code>null</code> if the resource
305             *         permission does not have a base model instance (such as if its a
306             *         portlet)
307             */
308            public BaseModel<?> getBaseModel(ResourcePermission resourcePermission)
309                    throws PortalException;
310    
311            /**
312             * Returns the base model instance for the model name and primary key.
313             *
314             * @param  modelName the fully qualified class name of the model
315             * @param  primKey the primary key of the model instance to get
316             * @return the base model instance, or <code>null</code> if the model does
317             *         not have a base model instance (such as if its a portlet)
318             */
319            public BaseModel<?> getBaseModel(String modelName, String primKey)
320                    throws PortalException;
321    
322            /**
323             * @deprecated As of 7.0.0, replaced by {@link
324             *             com.liferay.portal.kernel.security.auth.http.HttpAuthManagerUtil#getBasicUserId(
325             *             HttpServletRequest)}
326             */
327            @Deprecated
328            public long getBasicAuthUserId(HttpServletRequest request)
329                    throws PortalException;
330    
331            /**
332             * @deprecated As of 7.0.0, replaced by {@link
333             *             com.liferay.portal.kernel.security.auth.http.HttpAuthManagerUtil#getBasicUserId(
334             *             HttpServletRequest)}
335             */
336            @Deprecated
337            public long getBasicAuthUserId(HttpServletRequest request, long companyId)
338                    throws PortalException;
339    
340            public List<Group> getBrowsableScopeGroups(
341                            long userId, long companyId, long groupId, String portletId)
342                    throws PortalException;
343    
344            /**
345             * Returns the canonical URL of the page, to distinguish it among its
346             * translations.
347             *
348             * @param  completeURL the complete URL of the page
349             * @param  themeDisplay the current theme display
350             * @param  layout the layout. If it is <code>null</code>, then it is
351             *         generated for the current layout
352             * @return the canonical URL
353             */
354            public String getCanonicalURL(
355                            String completeURL, ThemeDisplay themeDisplay, Layout layout)
356                    throws PortalException;
357    
358            /**
359             * Returns the canonical URL of the page, to distinguish it among its
360             * translations.
361             *
362             * @param  completeURL the complete URL of the page
363             * @param  themeDisplay the current theme display
364             * @param  layout the layout. If it is <code>null</code>, then it is
365             *         generated for the current layout
366             * @param  forceLayoutFriendlyURL adds the page friendly URL to the
367             *         canonical URL even if it is not needed
368             * @return the canonical URL
369             */
370            public String getCanonicalURL(
371                            String completeURL, ThemeDisplay themeDisplay, Layout layout,
372                            boolean forceLayoutFriendlyURL)
373                    throws PortalException;
374    
375            /**
376             * Returns the secure (HTTPS) or insecure (HTTP) content distribution
377             * network (CDN) host address for this portal.
378             *
379             * @param  secure whether to get the secure or insecure CDN host address
380             * @return the CDN host address
381             */
382            public String getCDNHost(boolean secure);
383    
384            public String getCDNHost(HttpServletRequest request) throws PortalException;
385    
386            /**
387             * Returns the insecure (HTTP) content distribution network (CDN) host
388             * address
389             *
390             * @param  companyId the company ID of a site
391             * @return the CDN host address
392             */
393            public String getCDNHostHttp(long companyId);
394    
395            /**
396             * Returns the secure (HTTPS) content distribution network (CDN) host
397             * address
398             *
399             * @param  companyId the company ID of a site
400             * @return the CDN host address
401             */
402            public String getCDNHostHttps(long companyId);
403    
404            /**
405             * Returns the fully qualified name of the class from its ID.
406             *
407             * @param  classNameId the ID of the class
408             * @return the fully qualified name of the class
409             */
410            public String getClassName(long classNameId);
411    
412            /**
413             * Returns the ID of the class from its class object.
414             *
415             * @param  clazz the class object
416             * @return the ID of the class
417             */
418            public long getClassNameId(Class<?> clazz);
419    
420            /**
421             * Returns the ID of the class from its fully qualified name.
422             *
423             * @param  value the fully qualified name of the class
424             * @return the ID of the class
425             */
426            public long getClassNameId(String value);
427    
428            public Company getCompany(HttpServletRequest request)
429                    throws PortalException;
430    
431            public Company getCompany(PortletRequest portletRequest)
432                    throws PortalException;
433    
434            public long getCompanyId(HttpServletRequest requestuest);
435    
436            public long getCompanyId(PortletRequest portletRequest);
437    
438            public long[] getCompanyIds();
439    
440            public Set<String> getComputerAddresses();
441    
442            public String getComputerName();
443    
444            public String getControlPanelFullURL(
445                            long scopeGroupId, String ppid, Map<String, String[]> params)
446                    throws PortalException;
447    
448            public long getControlPanelPlid(long companyId) throws PortalException;
449    
450            public long getControlPanelPlid(PortletRequest portletRequest)
451                    throws PortalException;
452    
453            public PortletURL getControlPanelPortletURL(
454                    HttpServletRequest request, Group group, String portletId,
455                    long refererGroupId, long refererPlid, String lifecycle);
456    
457            public PortletURL getControlPanelPortletURL(
458                    HttpServletRequest request, String portletId, String lifecycle);
459    
460            public PortletURL getControlPanelPortletURL(
461                    PortletRequest portletRequest, Group group, String portletId,
462                    long refererGroupId, long refererPlid, String lifecycle);
463    
464            public PortletURL getControlPanelPortletURL(
465                    PortletRequest portletRequest, String portletId, String lifecycle);
466    
467            public String getCreateAccountURL(
468                            HttpServletRequest request, ThemeDisplay themeDisplay)
469                    throws Exception;
470    
471            public long[] getCurrentAndAncestorSiteGroupIds(long groupId)
472                    throws PortalException;
473    
474            public long[] getCurrentAndAncestorSiteGroupIds(
475                            long groupId, boolean checkContentSharingWithChildrenEnabled)
476                    throws PortalException;
477    
478            public long[] getCurrentAndAncestorSiteGroupIds(long[] groupIds)
479                    throws PortalException;
480    
481            public long[] getCurrentAndAncestorSiteGroupIds(
482                            long[] groupIds, boolean checkContentSharingWithChildrenEnabled)
483                    throws PortalException;
484    
485            public List<Group> getCurrentAndAncestorSiteGroups(long groupId)
486                    throws PortalException;
487    
488            public List<Group> getCurrentAndAncestorSiteGroups(
489                            long groupId, boolean checkContentSharingWithChildrenEnabled)
490                    throws PortalException;
491    
492            public List<Group> getCurrentAndAncestorSiteGroups(long[] groupIds)
493                    throws PortalException;
494    
495            public List<Group> getCurrentAndAncestorSiteGroups(
496                            long[] groupIds, boolean checkContentSharingWithChildrenEnabled)
497                    throws PortalException;
498    
499            public String getCurrentCompleteURL(HttpServletRequest request);
500    
501            public String getCurrentURL(HttpServletRequest request);
502    
503            public String getCurrentURL(PortletRequest portletRequest);
504    
505            public String getCustomSQLFunctionIsNotNull();
506    
507            public String getCustomSQLFunctionIsNull();
508    
509            /**
510             * Returns the date object for the specified month, day, and year, or
511             * <code>null</code> if the date is invalid.
512             *
513             * @param  month the month (0-based, meaning 0 for January)
514             * @param  day the day of the month
515             * @param  year the year
516             * @return the date object, or <code>null</code> if the date is invalid
517             */
518            public Date getDate(int month, int day, int year);
519    
520            /**
521             * Returns the date object for the specified month, day, and year,
522             * optionally throwing an exception if the date is invalid.
523             *
524             * @param  month the month (0-based, meaning 0 for January)
525             * @param  day the day of the month
526             * @param  year the year
527             * @param  clazz the exception class to throw if the date is invalid. If
528             *         <code>null</code>, no exception will be thrown for an invalid
529             *         date.
530             * @return the date object, or <code>null</code> if the date is invalid and
531             *         no exception to throw was provided
532             */
533            public Date getDate(
534                            int month, int day, int year,
535                            Class<? extends PortalException> clazz)
536                    throws PortalException;
537    
538            /**
539             * Returns the date object for the specified month, day, year, hour, and
540             * minute, optionally throwing an exception if the date is invalid.
541             *
542             * @param  month the month (0-based, meaning 0 for January)
543             * @param  day the day of the month
544             * @param  year the year
545             * @param  hour the hour (0-24)
546             * @param  min the minute of the hour
547             * @param  clazz the exception class to throw if the date is invalid. If
548             *         <code>null</code>, no exception will be thrown for an invalid
549             *         date.
550             * @return the date object, or <code>null</code> if the date is invalid and
551             *         no exception to throw was provided
552             */
553            public Date getDate(
554                            int month, int day, int year, int hour, int min,
555                            Class<? extends PortalException> clazz)
556                    throws PortalException;
557    
558            /**
559             * Returns the date object for the specified month, day, year, hour, minute,
560             * and time zone, optionally throwing an exception if the date is invalid.
561             *
562             * @param  month the month (0-based, meaning 0 for January)
563             * @param  day the day of the month
564             * @param  year the year
565             * @param  hour the hour (0-24)
566             * @param  min the minute of the hour
567             * @param  timeZone the time zone of the date
568             * @param  clazz the exception class to throw if the date is invalid. If
569             *         <code>null</code>, no exception will be thrown for an invalid
570             *         date.
571             * @return the date object, or <code>null</code> if the date is invalid and
572             *         no exception to throw was provided
573             */
574            public Date getDate(
575                            int month, int day, int year, int hour, int min, TimeZone timeZone,
576                            Class<? extends PortalException> clazz)
577                    throws PortalException;
578    
579            /**
580             * Returns the date object for the specified month, day, year, and time
581             * zone, optionally throwing an exception if the date is invalid.
582             *
583             * @param  month the month (0-based, meaning 0 for January)
584             * @param  day the day of the month
585             * @param  year the year
586             * @param  timeZone the time zone of the date
587             * @param  clazz the exception class to throw if the date is invalid. If
588             *         <code>null</code>, no exception will be thrown for an invalid
589             *         date.
590             * @return the date object, or <code>null</code> if the date is invalid and
591             *         no exception to throw was provided
592             */
593            public Date getDate(
594                            int month, int day, int year, TimeZone timeZone,
595                            Class<? extends PortalException> clazz)
596                    throws PortalException;
597    
598            public long getDefaultCompanyId();
599    
600            /**
601             * @deprecated As of 7.0.0, replaced by {@link
602             *             com.liferay.portal.kernel.security.auth.http.HttpAuthManagerUtil#getDigestUserId(
603             *             HttpServletRequest)}
604             */
605            @Deprecated
606            public long getDigestAuthUserId(HttpServletRequest request)
607                    throws PortalException;
608    
609            public String getEmailFromAddress(
610                    PortletPreferences preferences, long companyId, String defaultValue);
611    
612            public String getEmailFromName(
613                    PortletPreferences preferences, long companyId, String defaultValue);
614    
615            public Map<String, Serializable> getExpandoBridgeAttributes(
616                            ExpandoBridge expandoBridge, HttpServletRequest request)
617                    throws PortalException;
618    
619            public Map<String, Serializable> getExpandoBridgeAttributes(
620                            ExpandoBridge expandoBridge, PortletRequest portletRequest)
621                    throws PortalException;
622    
623            public Map<String, Serializable> getExpandoBridgeAttributes(
624                            ExpandoBridge expandoBridge,
625                            UploadPortletRequest uploadPortletRequest)
626                    throws PortalException;
627    
628            public Serializable getExpandoValue(
629                            HttpServletRequest request, String name, int type,
630                            String displayType)
631                    throws PortalException;
632    
633            public Serializable getExpandoValue(
634                            PortletRequest portletRequest, String name, int type,
635                            String displayType)
636                    throws PortalException;
637    
638            public Serializable getExpandoValue(
639                            UploadPortletRequest uploadPortletRequest, String name, int type,
640                            String displayType)
641                    throws PortalException;
642    
643            public String getFacebookURL(
644                            Portlet portlet, String facebookCanvasPageURL,
645                            ThemeDisplay themeDisplay)
646                    throws PortalException;
647    
648            public String getFirstPageLayoutTypes(HttpServletRequest request);
649    
650            public String getForwardedHost(HttpServletRequest request);
651    
652            public int getForwardedPort(HttpServletRequest request);
653    
654            public String getFullName(
655                    String firstName, String middleName, String lastName);
656    
657            public String getGlobalLibDir();
658    
659            public String getGoogleGadgetURL(Portlet portlet, ThemeDisplay themeDisplay)
660                    throws PortalException;
661    
662            public String getGroupFriendlyURL(
663                            LayoutSet layoutSet, ThemeDisplay themeDisplay)
664                    throws PortalException;
665    
666            public String getGroupFriendlyURL(
667                            LayoutSet layoutSet, ThemeDisplay themeDisplay, Locale locale)
668                    throws PortalException;
669    
670            public int[] getGroupFriendlyURLIndex(String requestURI);
671    
672            public String[] getGroupPermissions(HttpServletRequest request);
673    
674            public String[] getGroupPermissions(
675                    HttpServletRequest request, String className);
676    
677            public String[] getGroupPermissions(PortletRequest portletRequest);
678    
679            public String[] getGroupPermissions(
680                    PortletRequest portletRequest, String className);
681    
682            public String[] getGuestPermissions(HttpServletRequest request);
683    
684            public String[] getGuestPermissions(
685                    HttpServletRequest request, String className);
686    
687            public String[] getGuestPermissions(PortletRequest portletRequest);
688    
689            public String[] getGuestPermissions(
690                    PortletRequest portletRequest, String className);
691    
692            public String getHomeURL(HttpServletRequest request) throws PortalException;
693    
694            public String getHost(HttpServletRequest request);
695    
696            public String getHost(PortletRequest portletRequest);
697    
698            public HttpServletRequest getHttpServletRequest(
699                    PortletRequest portletRequest);
700    
701            public HttpServletResponse getHttpServletResponse(
702                    PortletResponse portletResponse);
703    
704            public String getI18nPathLanguageId(
705                    Locale locale, String defaultI18nPathLanguageId);
706    
707            /**
708             * @deprecated As of 7.0.0, with no direct replacement
709             */
710            @Deprecated
711            public String getJournalArticleActualURL(
712                            long groupId, boolean privateLayout, String mainPath,
713                            String friendlyURL, Map<String, String[]> params,
714                            Map<String, Object> requestContext)
715                    throws PortalException;
716    
717            /**
718             * @deprecated As of 7.0.0, with no direct replacement
719             */
720            @Deprecated
721            public Layout getJournalArticleLayout(
722                            long groupId, boolean privateLayout, String friendlyURL)
723                    throws PortalException;
724    
725            public String getJsSafePortletId(String portletId);
726    
727            public String getLayoutActualURL(Layout layout);
728    
729            public String getLayoutActualURL(Layout layout, String mainPath);
730    
731            public String getLayoutActualURL(
732                            long groupId, boolean privateLayout, String mainPath,
733                            String friendlyURL)
734                    throws PortalException;
735    
736            public String getLayoutActualURL(
737                            long groupId, boolean privateLayout, String mainPath,
738                            String friendlyURL, Map<String, String[]> params,
739                            Map<String, Object> requestContext)
740                    throws PortalException;
741    
742            public String getLayoutFriendlyURL(Layout layout, ThemeDisplay themeDisplay)
743                    throws PortalException;
744    
745            public String getLayoutFriendlyURL(
746                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
747                    throws PortalException;
748    
749            public LayoutFriendlyURLComposite getLayoutFriendlyURLComposite(
750                            long groupId, boolean privateLayout, String friendlyURL,
751                            Map<String, String[]> params, Map<String, Object> requestContext)
752                    throws PortalException;
753    
754            public String getLayoutFullURL(Layout layout, ThemeDisplay themeDisplay)
755                    throws PortalException;
756    
757            public String getLayoutFullURL(
758                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
759                    throws PortalException;
760    
761            public String getLayoutFullURL(long groupId, String portletId)
762                    throws PortalException;
763    
764            public String getLayoutFullURL(
765                            long groupId, String portletId, boolean secure)
766                    throws PortalException;
767    
768            public String getLayoutFullURL(ThemeDisplay themeDisplay)
769                    throws PortalException;
770    
771            public String getLayoutRelativeURL(Layout layout, ThemeDisplay themeDisplay)
772                    throws PortalException;
773    
774            public String getLayoutRelativeURL(
775                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
776                    throws PortalException;
777    
778            public String getLayoutSetDisplayURL(
779                            LayoutSet layoutSet, boolean secureConnection)
780                    throws PortalException;
781    
782            public String getLayoutSetFriendlyURL(
783                            LayoutSet layoutSet, ThemeDisplay themeDisplay)
784                    throws PortalException;
785    
786            public String getLayoutTarget(Layout layout);
787    
788            public String getLayoutURL(Layout layout, ThemeDisplay themeDisplay)
789                    throws PortalException;
790    
791            public String getLayoutURL(
792                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
793                    throws PortalException;
794    
795            public String getLayoutURL(
796                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
797                    throws PortalException;
798    
799            public String getLayoutURL(ThemeDisplay themeDisplay)
800                    throws PortalException;
801    
802            public LiferayPortletRequest getLiferayPortletRequest(
803                    PortletRequest portletRequest);
804    
805            public LiferayPortletResponse getLiferayPortletResponse(
806                    PortletResponse portletResponse);
807    
808            public Locale getLocale(HttpServletRequest request);
809    
810            public Locale getLocale(
811                    HttpServletRequest request, HttpServletResponse response,
812                    boolean initialize);
813    
814            public Locale getLocale(PortletRequest portletRequest);
815    
816            public String getLocalizedFriendlyURL(
817                            HttpServletRequest request, Layout layout, Locale locale,
818                            Locale originalLocale)
819                    throws Exception;
820    
821            public String getMailId(String mx, String popPortletPrefix, Object... ids);
822    
823            public String getNetvibesURL(Portlet portlet, ThemeDisplay themeDisplay)
824                    throws PortalException;
825    
826            public String getNewPortletTitle(
827                    String portletTitle, String oldScopeName, String newScopeName);
828    
829            public HttpServletRequest getOriginalServletRequest(
830                    HttpServletRequest request);
831    
832            public String getPathContext();
833    
834            public String getPathContext(HttpServletRequest request);
835    
836            public String getPathContext(PortletRequest portletRequest);
837    
838            public String getPathContext(String contextPath);
839    
840            public String getPathFriendlyURLPrivateGroup();
841    
842            public String getPathFriendlyURLPrivateUser();
843    
844            public String getPathFriendlyURLPublic();
845    
846            public String getPathImage();
847    
848            public String getPathMain();
849    
850            public String getPathModule();
851    
852            public String getPathProxy();
853    
854            public long getPlidFromFriendlyURL(long companyId, String friendlyURL);
855    
856            public long getPlidFromPortletId(
857                            long groupId, boolean privateLayout, String portletId)
858                    throws PortalException;
859    
860            public long getPlidFromPortletId(long groupId, String portletId)
861                    throws PortalException;
862    
863            public PortalInetSocketAddressEventListener[]
864                    getPortalInetSocketAddressEventListeners();
865    
866            public String getPortalLibDir();
867    
868            public InetAddress getPortalLocalInetAddress(boolean secure);
869    
870            public int getPortalLocalPort(boolean secure);
871    
872            /**
873             * @deprecated As of 7.0.0, replaced by {@link
874             *             #getPortalServerPort(boolean)}
875             */
876            @Deprecated
877            public int getPortalPort(boolean secure);
878    
879            public Properties getPortalProperties();
880    
881            public InetAddress getPortalServerInetAddress(boolean secure);
882    
883            public int getPortalServerPort(boolean secure);
884    
885            public String getPortalURL(HttpServletRequest request);
886    
887            public String getPortalURL(HttpServletRequest request, boolean secure);
888    
889            public String getPortalURL(Layout layout, ThemeDisplay themeDisplay)
890                    throws PortalException;
891    
892            public String getPortalURL(LayoutSet layoutSet, ThemeDisplay themeDisplay);
893    
894            public String getPortalURL(PortletRequest portletRequest);
895    
896            public String getPortalURL(PortletRequest portletRequest, boolean secure);
897    
898            public String getPortalURL(
899                    String serverName, int serverPort, boolean secure);
900    
901            public String getPortalURL(ThemeDisplay themeDisplay)
902                    throws PortalException;
903    
904            public String getPortalWebDir();
905    
906            /**
907             * @deprecated As of 7.0.0, replaced by {@link
908             *             com.liferay.portal.kernel.servlet.taglib.ui.BreadcrumbUtil#getPortletBreadcrumbEntries(
909             *             HttpServletRequest)}
910             */
911            @Deprecated
912            public List<BreadcrumbEntry> getPortletBreadcrumbs(
913                    HttpServletRequest request);
914    
915            public PortletConfig getPortletConfig(
916                            long companyId, String portletId, ServletContext servletContext)
917                    throws PortletException;
918    
919            public String getPortletDescription(
920                    Portlet portlet, ServletContext servletContext, Locale locale);
921    
922            public String getPortletDescription(Portlet portlet, User user);
923    
924            public String getPortletDescription(String portletId, Locale locale);
925    
926            public String getPortletDescription(String portletId, String languageId);
927    
928            public String getPortletDescription(String portletId, User user);
929    
930            public String getPortletId(HttpServletRequest request);
931    
932            public String getPortletId(PortletRequest portletRequest);
933    
934            public String getPortletLongTitle(Portlet portlet, Locale locale);
935    
936            public String getPortletLongTitle(
937                    Portlet portlet, ServletContext servletContext, Locale locale);
938    
939            public String getPortletLongTitle(Portlet portlet, String languageId);
940    
941            public String getPortletLongTitle(Portlet portlet, User user);
942    
943            public String getPortletLongTitle(String portletId, Locale locale);
944    
945            public String getPortletLongTitle(String portletId, String languageId);
946    
947            public String getPortletLongTitle(String portletId, User user);
948    
949            public String getPortletNamespace(String portletId);
950    
951            public String getPortletTitle(Portlet portlet, Locale locale);
952    
953            public String getPortletTitle(
954                    Portlet portlet, ServletContext servletContext, Locale locale);
955    
956            public String getPortletTitle(Portlet portlet, String languageId);
957    
958            public String getPortletTitle(Portlet portlet, User user);
959    
960            public String getPortletTitle(PortletRequest portletRequest);
961    
962            public String getPortletTitle(PortletResponse portletResponse);
963    
964            public String getPortletTitle(String portletId, Locale locale);
965    
966            public String getPortletTitle(
967                    String portletId, ResourceBundle resourceBundle);
968    
969            public String getPortletTitle(String portletId, String languageId);
970    
971            public String getPortletTitle(String portletId, User user);
972    
973            public String getPortletXmlFileName();
974    
975            public PortletPreferences getPreferences(HttpServletRequest request);
976    
977            public PreferencesValidator getPreferencesValidator(Portlet portlet);
978    
979            public String getRelativeHomeURL(HttpServletRequest request)
980                    throws PortalException;
981    
982            public ResourceBundle getResourceBundle(Locale locale);
983    
984            public long getScopeGroupId(HttpServletRequest request)
985                    throws PortalException;
986    
987            public long getScopeGroupId(HttpServletRequest request, String portletId)
988                    throws PortalException;
989    
990            public long getScopeGroupId(
991                            HttpServletRequest request, String portletId,
992                            boolean checkStagingGroup)
993                    throws PortalException;
994    
995            public long getScopeGroupId(Layout layout);
996    
997            public long getScopeGroupId(Layout layout, String portletId);
998    
999            public long getScopeGroupId(long plid);
1000    
1001            public long getScopeGroupId(PortletRequest portletRequest)
1002                    throws PortalException;
1003    
1004            public User getSelectedUser(HttpServletRequest request)
1005                    throws PortalException;
1006    
1007            public User getSelectedUser(
1008                            HttpServletRequest request, boolean checkPermission)
1009                    throws PortalException;
1010    
1011            public User getSelectedUser(PortletRequest portletRequest)
1012                    throws PortalException;
1013    
1014            public User getSelectedUser(
1015                            PortletRequest portletRequest, boolean checkPermission)
1016                    throws PortalException;
1017    
1018            public String getServletContextName();
1019    
1020            public long[] getSharedContentSiteGroupIds(
1021                            long companyId, long groupId, long userId)
1022                    throws PortalException;
1023    
1024            /**
1025             * @deprecated As of 7.0.0, replaced by {@link
1026             *             #getControlPanelPortletURL(PortletRequest, Group, String,
1027             *             long, String)}
1028             */
1029            @Deprecated
1030            public PortletURL getSiteAdministrationURL(
1031                    HttpServletRequest request, ThemeDisplay themeDisplay,
1032                    String portletId);
1033    
1034            /**
1035             * @deprecated As of 7.0.0, replaced by {@link
1036             *             #getControlPanelPortletURL(PortletRequest, Group, String,
1037             *             long, String)}
1038             */
1039            @Deprecated
1040            public PortletURL getSiteAdministrationURL(
1041                    PortletResponse portletResponse, ThemeDisplay themeDisplay,
1042                    String portletName);
1043    
1044            /**
1045             * @deprecated As of 7.0.0, replaced by {@link
1046             *             #getCurrentAndAncestorSiteGroupIds(long)}
1047             */
1048            @Deprecated
1049            public long[] getSiteAndCompanyGroupIds(long groupId)
1050                    throws PortalException;
1051    
1052            /**
1053             * @deprecated As of 7.0.0, replaced by {@link
1054             *             #getCurrentAndAncestorSiteGroupIds(long)}
1055             */
1056            @Deprecated
1057            public long[] getSiteAndCompanyGroupIds(ThemeDisplay themeDisplay)
1058                    throws PortalException;
1059    
1060            public Locale getSiteDefaultLocale(long groupId) throws PortalException;
1061    
1062            public long getSiteGroupId(long groupId);
1063    
1064            /**
1065             * Returns the URL of the login page for the current site if one is
1066             * available.
1067             *
1068             * @param  themeDisplay the theme display for the current page
1069             * @return the URL of the login page for the current site, or
1070             *         <code>null</code> if one is not available
1071             */
1072            public String getSiteLoginURL(ThemeDisplay themeDisplay)
1073                    throws PortalException;
1074    
1075            public String getStaticResourceURL(HttpServletRequest request, String uri);
1076    
1077            public String getStaticResourceURL(
1078                    HttpServletRequest request, String uri, long timestamp);
1079    
1080            public String getStaticResourceURL(
1081                    HttpServletRequest request, String uri, String queryString);
1082    
1083            public String getStaticResourceURL(
1084                    HttpServletRequest request, String uri, String queryString,
1085                    long timestamp);
1086    
1087            public String getStrutsAction(HttpServletRequest request);
1088    
1089            public String[] getSystemGroups();
1090    
1091            public String[] getSystemOrganizationRoles();
1092    
1093            public String[] getSystemRoles();
1094    
1095            public String[] getSystemSiteRoles();
1096    
1097            public String getUniqueElementId(
1098                    HttpServletRequest request, String namespace, String id);
1099    
1100            public String getUniqueElementId(
1101                    PortletRequest request, String namespace, String id);
1102    
1103            public UploadPortletRequest getUploadPortletRequest(
1104                    PortletRequest portletRequest);
1105    
1106            public UploadServletRequest getUploadServletRequest(
1107                    HttpServletRequest request);
1108    
1109            public Date getUptime();
1110    
1111            public String getURLWithSessionId(String url, String sessionId);
1112    
1113            public User getUser(HttpServletRequest request) throws PortalException;
1114    
1115            public User getUser(PortletRequest portletRequest) throws PortalException;
1116    
1117            public String getUserEmailAddress(long userId);
1118    
1119            public long getUserId(HttpServletRequest request);
1120    
1121            public long getUserId(PortletRequest portletRequest);
1122    
1123            public String getUserName(BaseModel<?> baseModel);
1124    
1125            public String getUserName(long userId, String defaultUserName);
1126    
1127            public String getUserName(
1128                    long userId, String defaultUserName, HttpServletRequest request);
1129    
1130            public String getUserName(
1131                    long userId, String defaultUserName, String userAttribute);
1132    
1133            public String getUserName(
1134                    long userId, String defaultUserName, String userAttribute,
1135                    HttpServletRequest request);
1136    
1137            public String getUserPassword(HttpServletRequest request);
1138    
1139            public String getUserPassword(HttpSession session);
1140    
1141            public String getUserPassword(PortletRequest portletRequest);
1142    
1143            /**
1144             * @deprecated As of 7.0.0, with no direct replacement
1145             */
1146            @Deprecated
1147            public String getUserValue(long userId, String param, String defaultValue);
1148    
1149            public String getValidPortalDomain(long companyId, String domain);
1150    
1151            public long getValidUserId(long companyId, long userId)
1152                    throws PortalException;
1153    
1154            public String getVirtualHostname(LayoutSet layoutSet);
1155    
1156            /**
1157             * @deprecated As of 7.0.0, with no direct replacement
1158             */
1159            @Deprecated
1160            public String getVirtualLayoutActualURL(
1161                            long groupId, boolean privateLayout, String mainPath,
1162                            String friendlyURL, Map<String, String[]> params,
1163                            Map<String, Object> requestContext)
1164                    throws PortalException;
1165    
1166            /**
1167             * @deprecated As of 7.0.0, with no direct replacement
1168             */
1169            @Deprecated
1170            public LayoutFriendlyURLComposite getVirtualLayoutFriendlyURLComposite(
1171                            boolean privateLayout, String friendlyURL,
1172                            Map<String, String[]> params, Map<String, Object> requestContext)
1173                    throws PortalException;
1174    
1175            public String getWidgetURL(Portlet portlet, ThemeDisplay themeDisplay)
1176                    throws PortalException;
1177    
1178            public void initCustomSQL();
1179    
1180            public User initUser(HttpServletRequest request) throws Exception;
1181    
1182            /**
1183             * @deprecated As of 7.0.0, with no direct replacement
1184             */
1185            @Deprecated
1186            public void invokeTaglibDiscussion(
1187                            PortletConfig portletConfig, ActionRequest actionRequest,
1188                            ActionResponse actionResponse)
1189                    throws Exception;
1190    
1191            /**
1192             * @deprecated As of 7.0.0, with no direct replacement
1193             */
1194            @Deprecated
1195            public void invokeTaglibDiscussionPagination(
1196                            PortletConfig portletConfig, ResourceRequest resourceRequest,
1197                            ResourceResponse resourceResponse)
1198                    throws IOException, PortletException;
1199    
1200            public boolean isCDNDynamicResourcesEnabled(HttpServletRequest request)
1201                    throws PortalException;
1202    
1203            public boolean isCDNDynamicResourcesEnabled(long companyId);
1204    
1205            public boolean isCompanyAdmin(User user) throws Exception;
1206    
1207            public boolean isCompanyControlPanelPortlet(
1208                            String portletId, String category, ThemeDisplay themeDisplay)
1209                    throws PortalException;
1210    
1211            public boolean isCompanyControlPanelPortlet(
1212                            String portletId, ThemeDisplay themeDisplay)
1213                    throws PortalException;
1214    
1215            public boolean isControlPanelPortlet(
1216                    String portletId, String category, ThemeDisplay themeDisplay);
1217    
1218            public boolean isControlPanelPortlet(
1219                    String portletId, ThemeDisplay themeDisplay);
1220    
1221            public boolean isForwardedSecure(HttpServletRequest request);
1222    
1223            public boolean isGroupAdmin(User user, long groupId) throws Exception;
1224    
1225            public boolean isGroupFriendlyURL(
1226                    String fullURL, String groupFriendlyURL, String layoutFriendlyURL);
1227    
1228            public boolean isGroupOwner(User user, long groupId) throws Exception;
1229    
1230            public boolean isLayoutDescendant(Layout layout, long layoutId)
1231                    throws PortalException;
1232    
1233            public boolean isLayoutSitemapable(Layout layout);
1234    
1235            public boolean isLoginRedirectRequired(HttpServletRequest request);
1236    
1237            public boolean isMethodGet(PortletRequest portletRequest);
1238    
1239            public boolean isMethodPost(PortletRequest portletRequest);
1240    
1241            public boolean isMultipartRequest(HttpServletRequest request);
1242    
1243            public boolean isOmniadmin(long userId);
1244    
1245            public boolean isOmniadmin(User user);
1246    
1247            public boolean isReservedParameter(String name);
1248    
1249            public boolean isRightToLeft(HttpServletRequest request);
1250    
1251            public boolean isRSSFeedsEnabled();
1252    
1253            public boolean isSecure(HttpServletRequest request);
1254    
1255            public boolean isSkipPortletContentProcessing(
1256                            Group group, HttpServletRequest httpServletRequest,
1257                            LayoutTypePortlet layoutTypePortlet, PortletDisplay portletDisplay,
1258                            String portletName)
1259                    throws Exception;
1260    
1261            public boolean isSkipPortletContentRendering(
1262                    Group group, LayoutTypePortlet layoutTypePortlet,
1263                    PortletDisplay portletDisplay, String portletName);
1264    
1265            public boolean isSystemGroup(String groupName);
1266    
1267            public boolean isSystemRole(String roleName);
1268    
1269            public boolean isUpdateAvailable();
1270    
1271            public boolean isValidResourceId(String resourceId);
1272    
1273            public boolean removePortalInetSocketAddressEventListener(
1274                    PortalInetSocketAddressEventListener
1275                            portalInetSocketAddressEventListener);
1276    
1277            /**
1278             * @deprecated As of 7.0.0, replaced by {@link
1279             *             #removePortalInetSocketAddressEventListener(
1280             *             PortalInetSocketAddressEventListener)}
1281             */
1282            @Deprecated
1283            public void removePortalPortEventListener(
1284                    PortalPortEventListener portalPortEventListener);
1285    
1286            public void resetCDNHosts();
1287    
1288            public String resetPortletParameters(String url, String portletId);
1289    
1290            public void sendError(
1291                            Exception e, ActionRequest actionRequest,
1292                            ActionResponse actionResponse)
1293                    throws IOException;
1294    
1295            public void sendError(
1296                            Exception e, HttpServletRequest request,
1297                            HttpServletResponse response)
1298                    throws IOException, ServletException;
1299    
1300            public void sendError(
1301                            int status, Exception e, ActionRequest actionRequest,
1302                            ActionResponse actionResponse)
1303                    throws IOException;
1304    
1305            public void sendError(
1306                            int status, Exception e, HttpServletRequest request,
1307                            HttpServletResponse response)
1308                    throws IOException, ServletException;
1309    
1310            public void sendRSSFeedsDisabledError(
1311                            HttpServletRequest request, HttpServletResponse response)
1312                    throws IOException, ServletException;
1313    
1314            public void sendRSSFeedsDisabledError(
1315                            PortletRequest portletRequest, PortletResponse portletResponse)
1316                    throws IOException, ServletException;
1317    
1318            /**
1319             * Sets the description for the page, overriding the existing page
1320             * description.
1321             */
1322            public void setPageDescription(
1323                    String description, HttpServletRequest request);
1324    
1325            /**
1326             * Sets the keywords for the page, overriding the existing page keywords.
1327             */
1328            public void setPageKeywords(String keywords, HttpServletRequest request);
1329    
1330            /**
1331             * Sets the subtitle for the page, overriding the existing page subtitle.
1332             */
1333            public void setPageSubtitle(String subtitle, HttpServletRequest request);
1334    
1335            /**
1336             * Sets the whole title for the page, overriding the existing page whole
1337             * title.
1338             */
1339            public void setPageTitle(String title, HttpServletRequest request);
1340    
1341            public void setPortalInetSocketAddresses(HttpServletRequest request);
1342    
1343            /**
1344             * Sets the port obtained on the first request to the portal.
1345             *
1346             * @deprecated As of 7.0.0, replaced by {@link
1347             *             #setPortalInetSocketAddresses(HttpServletRequest)}
1348             */
1349            @Deprecated
1350            public void setPortalPort(HttpServletRequest request);
1351    
1352            public void storePreferences(PortletPreferences portletPreferences)
1353                    throws IOException, ValidatorException;
1354    
1355            public String[] stripURLAnchor(String url, String separator);
1356    
1357            public String transformCustomSQL(String sql);
1358    
1359            public String transformSQL(String sql);
1360    
1361            public void updateImageId(
1362                            BaseModel<?> baseModel, boolean image, byte[] bytes,
1363                            String fieldName, long maxSize, int maxHeight, int maxWidth)
1364                    throws PortalException;
1365    
1366            public PortletMode updatePortletMode(
1367                            String portletId, User user, Layout layout, PortletMode portletMode,
1368                            HttpServletRequest request)
1369                    throws PortalException;
1370    
1371            public String updateRedirect(
1372                    String redirect, String oldPath, String newPath);
1373    
1374            public WindowState updateWindowState(
1375                    String portletId, User user, Layout layout, WindowState windowState,
1376                    HttpServletRequest request);
1377    
1378    }