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 getFullName(
651                    String firstName, String middleName, String lastName);
652    
653            public String getGlobalLibDir();
654    
655            public String getGoogleGadgetURL(Portlet portlet, ThemeDisplay themeDisplay)
656                    throws PortalException;
657    
658            public String getGroupFriendlyURL(
659                            LayoutSet layoutSet, ThemeDisplay themeDisplay)
660                    throws PortalException;
661    
662            public String getGroupFriendlyURL(
663                            LayoutSet layoutSet, ThemeDisplay themeDisplay, Locale locale)
664                    throws PortalException;
665    
666            public int[] getGroupFriendlyURLIndex(String requestURI);
667    
668            public String[] getGroupPermissions(HttpServletRequest request);
669    
670            public String[] getGroupPermissions(
671                    HttpServletRequest request, String className);
672    
673            public String[] getGroupPermissions(PortletRequest portletRequest);
674    
675            public String[] getGroupPermissions(
676                    PortletRequest portletRequest, String className);
677    
678            public String[] getGuestPermissions(HttpServletRequest request);
679    
680            public String[] getGuestPermissions(
681                    HttpServletRequest request, String className);
682    
683            public String[] getGuestPermissions(PortletRequest portletRequest);
684    
685            public String[] getGuestPermissions(
686                    PortletRequest portletRequest, String className);
687    
688            public String getHomeURL(HttpServletRequest request) throws PortalException;
689    
690            public String getHost(HttpServletRequest request);
691    
692            public String getHost(PortletRequest portletRequest);
693    
694            public HttpServletRequest getHttpServletRequest(
695                    PortletRequest portletRequest);
696    
697            public HttpServletResponse getHttpServletResponse(
698                    PortletResponse portletResponse);
699    
700            public String getI18nPathLanguageId(
701                    Locale locale, String defaultI18nPathLanguageId);
702    
703            /**
704             * @deprecated As of 7.0.0, with no direct replacement
705             */
706            @Deprecated
707            public String getJournalArticleActualURL(
708                            long groupId, boolean privateLayout, String mainPath,
709                            String friendlyURL, Map<String, String[]> params,
710                            Map<String, Object> requestContext)
711                    throws PortalException;
712    
713            /**
714             * @deprecated As of 7.0.0, with no direct replacement
715             */
716            @Deprecated
717            public Layout getJournalArticleLayout(
718                            long groupId, boolean privateLayout, String friendlyURL)
719                    throws PortalException;
720    
721            public String getJsSafePortletId(String portletId);
722    
723            public String getLayoutActualURL(Layout layout);
724    
725            public String getLayoutActualURL(Layout layout, String mainPath);
726    
727            public String getLayoutActualURL(
728                            long groupId, boolean privateLayout, String mainPath,
729                            String friendlyURL)
730                    throws PortalException;
731    
732            public String getLayoutActualURL(
733                            long groupId, boolean privateLayout, String mainPath,
734                            String friendlyURL, Map<String, String[]> params,
735                            Map<String, Object> requestContext)
736                    throws PortalException;
737    
738            public String getLayoutFriendlyURL(Layout layout, ThemeDisplay themeDisplay)
739                    throws PortalException;
740    
741            public String getLayoutFriendlyURL(
742                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
743                    throws PortalException;
744    
745            public LayoutFriendlyURLComposite getLayoutFriendlyURLComposite(
746                            long groupId, boolean privateLayout, String friendlyURL,
747                            Map<String, String[]> params, Map<String, Object> requestContext)
748                    throws PortalException;
749    
750            public String getLayoutFullURL(Layout layout, ThemeDisplay themeDisplay)
751                    throws PortalException;
752    
753            public String getLayoutFullURL(
754                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
755                    throws PortalException;
756    
757            public String getLayoutFullURL(long groupId, String portletId)
758                    throws PortalException;
759    
760            public String getLayoutFullURL(
761                            long groupId, String portletId, boolean secure)
762                    throws PortalException;
763    
764            public String getLayoutFullURL(ThemeDisplay themeDisplay)
765                    throws PortalException;
766    
767            public String getLayoutRelativeURL(Layout layout, ThemeDisplay themeDisplay)
768                    throws PortalException;
769    
770            public String getLayoutRelativeURL(
771                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
772                    throws PortalException;
773    
774            public String getLayoutSetDisplayURL(
775                            LayoutSet layoutSet, boolean secureConnection)
776                    throws PortalException;
777    
778            public String getLayoutSetFriendlyURL(
779                            LayoutSet layoutSet, ThemeDisplay themeDisplay)
780                    throws PortalException;
781    
782            public String getLayoutTarget(Layout layout);
783    
784            public String getLayoutURL(Layout layout, ThemeDisplay themeDisplay)
785                    throws PortalException;
786    
787            public String getLayoutURL(
788                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
789                    throws PortalException;
790    
791            public String getLayoutURL(
792                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
793                    throws PortalException;
794    
795            public String getLayoutURL(ThemeDisplay themeDisplay)
796                    throws PortalException;
797    
798            public LiferayPortletRequest getLiferayPortletRequest(
799                    PortletRequest portletRequest);
800    
801            public LiferayPortletResponse getLiferayPortletResponse(
802                    PortletResponse portletResponse);
803    
804            public Locale getLocale(HttpServletRequest request);
805    
806            public Locale getLocale(
807                    HttpServletRequest request, HttpServletResponse response,
808                    boolean initialize);
809    
810            public Locale getLocale(PortletRequest portletRequest);
811    
812            public String getLocalizedFriendlyURL(
813                            HttpServletRequest request, Layout layout, Locale locale,
814                            Locale originalLocale)
815                    throws Exception;
816    
817            public String getMailId(String mx, String popPortletPrefix, Object... ids);
818    
819            public String getNetvibesURL(Portlet portlet, ThemeDisplay themeDisplay)
820                    throws PortalException;
821    
822            public String getNewPortletTitle(
823                    String portletTitle, String oldScopeName, String newScopeName);
824    
825            public HttpServletRequest getOriginalServletRequest(
826                    HttpServletRequest request);
827    
828            public String getPathContext();
829    
830            public String getPathContext(HttpServletRequest request);
831    
832            public String getPathContext(PortletRequest portletRequest);
833    
834            public String getPathContext(String contextPath);
835    
836            public String getPathFriendlyURLPrivateGroup();
837    
838            public String getPathFriendlyURLPrivateUser();
839    
840            public String getPathFriendlyURLPublic();
841    
842            public String getPathImage();
843    
844            public String getPathMain();
845    
846            public String getPathModule();
847    
848            public String getPathProxy();
849    
850            public long getPlidFromFriendlyURL(long companyId, String friendlyURL);
851    
852            public long getPlidFromPortletId(
853                            long groupId, boolean privateLayout, String portletId)
854                    throws PortalException;
855    
856            public long getPlidFromPortletId(long groupId, String portletId)
857                    throws PortalException;
858    
859            public PortalInetSocketAddressEventListener[]
860                    getPortalInetSocketAddressEventListeners();
861    
862            public String getPortalLibDir();
863    
864            public InetAddress getPortalLocalInetAddress(boolean secure);
865    
866            public int getPortalLocalPort(boolean secure);
867    
868            /**
869             * @deprecated As of 7.0.0, replaced by {@link
870             *             #getPortalServerPort(boolean)}
871             */
872            @Deprecated
873            public int getPortalPort(boolean secure);
874    
875            public Properties getPortalProperties();
876    
877            public InetAddress getPortalServerInetAddress(boolean secure);
878    
879            public int getPortalServerPort(boolean secure);
880    
881            public String getPortalURL(HttpServletRequest request);
882    
883            public String getPortalURL(HttpServletRequest request, boolean secure);
884    
885            public String getPortalURL(Layout layout, ThemeDisplay themeDisplay)
886                    throws PortalException;
887    
888            public String getPortalURL(PortletRequest portletRequest);
889    
890            public String getPortalURL(PortletRequest portletRequest, boolean secure);
891    
892            public String getPortalURL(
893                    String serverName, int serverPort, boolean secure);
894    
895            public String getPortalURL(ThemeDisplay themeDisplay)
896                    throws PortalException;
897    
898            public String getPortalWebDir();
899    
900            /**
901             * @deprecated As of 7.0.0, replaced by {@link
902             *             com.liferay.portal.kernel.servlet.taglib.ui.BreadcrumbUtil#getPortletBreadcrumbEntries(
903             *             HttpServletRequest)}
904             */
905            @Deprecated
906            public List<BreadcrumbEntry> getPortletBreadcrumbs(
907                    HttpServletRequest request);
908    
909            public PortletConfig getPortletConfig(
910                            long companyId, String portletId, ServletContext servletContext)
911                    throws PortletException;
912    
913            public String getPortletDescription(
914                    Portlet portlet, ServletContext servletContext, Locale locale);
915    
916            public String getPortletDescription(Portlet portlet, User user);
917    
918            public String getPortletDescription(String portletId, Locale locale);
919    
920            public String getPortletDescription(String portletId, String languageId);
921    
922            public String getPortletDescription(String portletId, User user);
923    
924            public String getPortletId(HttpServletRequest request);
925    
926            public String getPortletId(PortletRequest portletRequest);
927    
928            public String getPortletLongTitle(Portlet portlet, Locale locale);
929    
930            public String getPortletLongTitle(
931                    Portlet portlet, ServletContext servletContext, Locale locale);
932    
933            public String getPortletLongTitle(Portlet portlet, String languageId);
934    
935            public String getPortletLongTitle(Portlet portlet, User user);
936    
937            public String getPortletLongTitle(String portletId, Locale locale);
938    
939            public String getPortletLongTitle(String portletId, String languageId);
940    
941            public String getPortletLongTitle(String portletId, User user);
942    
943            public String getPortletNamespace(String portletId);
944    
945            public String getPortletTitle(Portlet portlet, Locale locale);
946    
947            public String getPortletTitle(
948                    Portlet portlet, ServletContext servletContext, Locale locale);
949    
950            public String getPortletTitle(Portlet portlet, String languageId);
951    
952            public String getPortletTitle(Portlet portlet, User user);
953    
954            public String getPortletTitle(PortletRequest portletRequest);
955    
956            public String getPortletTitle(PortletResponse portletResponse);
957    
958            public String getPortletTitle(String portletId, Locale locale);
959    
960            public String getPortletTitle(
961                    String portletId, ResourceBundle resourceBundle);
962    
963            public String getPortletTitle(String portletId, String languageId);
964    
965            public String getPortletTitle(String portletId, User user);
966    
967            public String getPortletXmlFileName();
968    
969            public PortletPreferences getPreferences(HttpServletRequest request);
970    
971            public PreferencesValidator getPreferencesValidator(Portlet portlet);
972    
973            public String getRelativeHomeURL(HttpServletRequest request)
974                    throws PortalException;
975    
976            public ResourceBundle getResourceBundle(Locale locale);
977    
978            public long getScopeGroupId(HttpServletRequest request)
979                    throws PortalException;
980    
981            public long getScopeGroupId(HttpServletRequest request, String portletId)
982                    throws PortalException;
983    
984            public long getScopeGroupId(
985                            HttpServletRequest request, String portletId,
986                            boolean checkStagingGroup)
987                    throws PortalException;
988    
989            public long getScopeGroupId(Layout layout);
990    
991            public long getScopeGroupId(Layout layout, String portletId);
992    
993            public long getScopeGroupId(long plid);
994    
995            public long getScopeGroupId(PortletRequest portletRequest)
996                    throws PortalException;
997    
998            public User getSelectedUser(HttpServletRequest request)
999                    throws PortalException;
1000    
1001            public User getSelectedUser(
1002                            HttpServletRequest request, boolean checkPermission)
1003                    throws PortalException;
1004    
1005            public User getSelectedUser(PortletRequest portletRequest)
1006                    throws PortalException;
1007    
1008            public User getSelectedUser(
1009                            PortletRequest portletRequest, boolean checkPermission)
1010                    throws PortalException;
1011    
1012            public String getServletContextName();
1013    
1014            public long[] getSharedContentSiteGroupIds(
1015                            long companyId, long groupId, long userId)
1016                    throws PortalException;
1017    
1018            /**
1019             * @deprecated As of 7.0.0, replaced by {@link
1020             *             #getControlPanelPortletURL(PortletRequest, Group, String,
1021             *             long, String)}
1022             */
1023            @Deprecated
1024            public PortletURL getSiteAdministrationURL(
1025                    HttpServletRequest request, ThemeDisplay themeDisplay,
1026                    String portletId);
1027    
1028            /**
1029             * @deprecated As of 7.0.0, replaced by {@link
1030             *             #getControlPanelPortletURL(PortletRequest, Group, String,
1031             *             long, String)}
1032             */
1033            @Deprecated
1034            public PortletURL getSiteAdministrationURL(
1035                    PortletResponse portletResponse, ThemeDisplay themeDisplay,
1036                    String portletName);
1037    
1038            /**
1039             * @deprecated As of 7.0.0, replaced by {@link
1040             *             #getCurrentAndAncestorSiteGroupIds(long)}
1041             */
1042            @Deprecated
1043            public long[] getSiteAndCompanyGroupIds(long groupId)
1044                    throws PortalException;
1045    
1046            /**
1047             * @deprecated As of 7.0.0, replaced by {@link
1048             *             #getCurrentAndAncestorSiteGroupIds(long)}
1049             */
1050            @Deprecated
1051            public long[] getSiteAndCompanyGroupIds(ThemeDisplay themeDisplay)
1052                    throws PortalException;
1053    
1054            public Locale getSiteDefaultLocale(long groupId) throws PortalException;
1055    
1056            public long getSiteGroupId(long groupId);
1057    
1058            /**
1059             * Returns the URL of the login page for the current site if one is
1060             * available.
1061             *
1062             * @param  themeDisplay the theme display for the current page
1063             * @return the URL of the login page for the current site, or
1064             *         <code>null</code> if one is not available
1065             */
1066            public String getSiteLoginURL(ThemeDisplay themeDisplay)
1067                    throws PortalException;
1068    
1069            public String getStaticResourceURL(HttpServletRequest request, String uri);
1070    
1071            public String getStaticResourceURL(
1072                    HttpServletRequest request, String uri, long timestamp);
1073    
1074            public String getStaticResourceURL(
1075                    HttpServletRequest request, String uri, String queryString);
1076    
1077            public String getStaticResourceURL(
1078                    HttpServletRequest request, String uri, String queryString,
1079                    long timestamp);
1080    
1081            public String getStrutsAction(HttpServletRequest request);
1082    
1083            public String[] getSystemGroups();
1084    
1085            public String[] getSystemOrganizationRoles();
1086    
1087            public String[] getSystemRoles();
1088    
1089            public String[] getSystemSiteRoles();
1090    
1091            public String getUniqueElementId(
1092                    HttpServletRequest request, String namespace, String id);
1093    
1094            public String getUniqueElementId(
1095                    PortletRequest request, String namespace, String id);
1096    
1097            public UploadPortletRequest getUploadPortletRequest(
1098                    PortletRequest portletRequest);
1099    
1100            public UploadServletRequest getUploadServletRequest(
1101                    HttpServletRequest request);
1102    
1103            public Date getUptime();
1104    
1105            public String getURLWithSessionId(String url, String sessionId);
1106    
1107            public User getUser(HttpServletRequest request) throws PortalException;
1108    
1109            public User getUser(PortletRequest portletRequest) throws PortalException;
1110    
1111            public String getUserEmailAddress(long userId);
1112    
1113            public long getUserId(HttpServletRequest request);
1114    
1115            public long getUserId(PortletRequest portletRequest);
1116    
1117            public String getUserName(BaseModel<?> baseModel);
1118    
1119            public String getUserName(long userId, String defaultUserName);
1120    
1121            public String getUserName(
1122                    long userId, String defaultUserName, HttpServletRequest request);
1123    
1124            public String getUserName(
1125                    long userId, String defaultUserName, String userAttribute);
1126    
1127            public String getUserName(
1128                    long userId, String defaultUserName, String userAttribute,
1129                    HttpServletRequest request);
1130    
1131            public String getUserPassword(HttpServletRequest request);
1132    
1133            public String getUserPassword(HttpSession session);
1134    
1135            public String getUserPassword(PortletRequest portletRequest);
1136    
1137            /**
1138             * @deprecated As of 7.0.0, with no direct replacement
1139             */
1140            @Deprecated
1141            public String getUserValue(long userId, String param, String defaultValue);
1142    
1143            public String getValidPortalDomain(long companyId, String domain);
1144    
1145            public long getValidUserId(long companyId, long userId)
1146                    throws PortalException;
1147    
1148            public String getVirtualHostname(LayoutSet layoutSet);
1149    
1150            /**
1151             * @deprecated As of 7.0.0, with no direct replacement
1152             */
1153            @Deprecated
1154            public String getVirtualLayoutActualURL(
1155                            long groupId, boolean privateLayout, String mainPath,
1156                            String friendlyURL, Map<String, String[]> params,
1157                            Map<String, Object> requestContext)
1158                    throws PortalException;
1159    
1160            /**
1161             * @deprecated As of 7.0.0, with no direct replacement
1162             */
1163            @Deprecated
1164            public LayoutFriendlyURLComposite getVirtualLayoutFriendlyURLComposite(
1165                            boolean privateLayout, String friendlyURL,
1166                            Map<String, String[]> params, Map<String, Object> requestContext)
1167                    throws PortalException;
1168    
1169            public String getWidgetURL(Portlet portlet, ThemeDisplay themeDisplay)
1170                    throws PortalException;
1171    
1172            public void initCustomSQL();
1173    
1174            public User initUser(HttpServletRequest request) throws Exception;
1175    
1176            /**
1177             * @deprecated As of 7.0.0, with no direct replacement
1178             */
1179            @Deprecated
1180            public void invokeTaglibDiscussion(
1181                            PortletConfig portletConfig, ActionRequest actionRequest,
1182                            ActionResponse actionResponse)
1183                    throws Exception;
1184    
1185            /**
1186             * @deprecated As of 7.0.0, with no direct replacement
1187             */
1188            @Deprecated
1189            public void invokeTaglibDiscussionPagination(
1190                            PortletConfig portletConfig, ResourceRequest resourceRequest,
1191                            ResourceResponse resourceResponse)
1192                    throws IOException, PortletException;
1193    
1194            public boolean isCDNDynamicResourcesEnabled(HttpServletRequest request)
1195                    throws PortalException;
1196    
1197            public boolean isCDNDynamicResourcesEnabled(long companyId);
1198    
1199            public boolean isCompanyAdmin(User user) throws Exception;
1200    
1201            public boolean isCompanyControlPanelPortlet(
1202                            String portletId, String category, ThemeDisplay themeDisplay)
1203                    throws PortalException;
1204    
1205            public boolean isCompanyControlPanelPortlet(
1206                            String portletId, ThemeDisplay themeDisplay)
1207                    throws PortalException;
1208    
1209            public boolean isControlPanelPortlet(
1210                    String portletId, String category, ThemeDisplay themeDisplay);
1211    
1212            public boolean isControlPanelPortlet(
1213                    String portletId, ThemeDisplay themeDisplay);
1214    
1215            public boolean isGroupAdmin(User user, long groupId) throws Exception;
1216    
1217            public boolean isGroupFriendlyURL(
1218                    String fullURL, String groupFriendlyURL, String layoutFriendlyURL);
1219    
1220            public boolean isGroupOwner(User user, long groupId) throws Exception;
1221    
1222            public boolean isLayoutDescendant(Layout layout, long layoutId)
1223                    throws PortalException;
1224    
1225            public boolean isLayoutSitemapable(Layout layout);
1226    
1227            public boolean isLoginRedirectRequired(HttpServletRequest request);
1228    
1229            public boolean isMethodGet(PortletRequest portletRequest);
1230    
1231            public boolean isMethodPost(PortletRequest portletRequest);
1232    
1233            public boolean isMultipartRequest(HttpServletRequest request);
1234    
1235            public boolean isOmniadmin(long userId);
1236    
1237            public boolean isOmniadmin(User user);
1238    
1239            public boolean isReservedParameter(String name);
1240    
1241            public boolean isRightToLeft(HttpServletRequest request);
1242    
1243            public boolean isRSSFeedsEnabled();
1244    
1245            public boolean isSecure(HttpServletRequest request);
1246    
1247            public boolean isSkipPortletContentProcessing(
1248                            Group group, HttpServletRequest httpServletRequest,
1249                            LayoutTypePortlet layoutTypePortlet, PortletDisplay portletDisplay,
1250                            String portletName)
1251                    throws Exception;
1252    
1253            public boolean isSkipPortletContentRendering(
1254                    Group group, LayoutTypePortlet layoutTypePortlet,
1255                    PortletDisplay portletDisplay, String portletName);
1256    
1257            public boolean isSystemGroup(String groupName);
1258    
1259            public boolean isSystemRole(String roleName);
1260    
1261            public boolean isUpdateAvailable();
1262    
1263            public boolean isValidResourceId(String resourceId);
1264    
1265            public boolean removePortalInetSocketAddressEventListener(
1266                    PortalInetSocketAddressEventListener
1267                            portalInetSocketAddressEventListener);
1268    
1269            /**
1270             * @deprecated As of 7.0.0, replaced by {@link
1271             *             #removePortalInetSocketAddressEventListener(
1272             *             PortalInetSocketAddressEventListener)}
1273             */
1274            @Deprecated
1275            public void removePortalPortEventListener(
1276                    PortalPortEventListener portalPortEventListener);
1277    
1278            public void resetCDNHosts();
1279    
1280            public String resetPortletParameters(String url, String portletId);
1281    
1282            public void sendError(
1283                            Exception e, ActionRequest actionRequest,
1284                            ActionResponse actionResponse)
1285                    throws IOException;
1286    
1287            public void sendError(
1288                            Exception e, HttpServletRequest request,
1289                            HttpServletResponse response)
1290                    throws IOException, ServletException;
1291    
1292            public void sendError(
1293                            int status, Exception e, ActionRequest actionRequest,
1294                            ActionResponse actionResponse)
1295                    throws IOException;
1296    
1297            public void sendError(
1298                            int status, Exception e, HttpServletRequest request,
1299                            HttpServletResponse response)
1300                    throws IOException, ServletException;
1301    
1302            public void sendRSSFeedsDisabledError(
1303                            HttpServletRequest request, HttpServletResponse response)
1304                    throws IOException, ServletException;
1305    
1306            public void sendRSSFeedsDisabledError(
1307                            PortletRequest portletRequest, PortletResponse portletResponse)
1308                    throws IOException, ServletException;
1309    
1310            /**
1311             * Sets the description for the page, overriding the existing page
1312             * description.
1313             */
1314            public void setPageDescription(
1315                    String description, HttpServletRequest request);
1316    
1317            /**
1318             * Sets the keywords for the page, overriding the existing page keywords.
1319             */
1320            public void setPageKeywords(String keywords, HttpServletRequest request);
1321    
1322            /**
1323             * Sets the subtitle for the page, overriding the existing page subtitle.
1324             */
1325            public void setPageSubtitle(String subtitle, HttpServletRequest request);
1326    
1327            /**
1328             * Sets the whole title for the page, overriding the existing page whole
1329             * title.
1330             */
1331            public void setPageTitle(String title, HttpServletRequest request);
1332    
1333            public void setPortalInetSocketAddresses(HttpServletRequest request);
1334    
1335            /**
1336             * Sets the port obtained on the first request to the portal.
1337             *
1338             * @deprecated As of 7.0.0, replaced by {@link
1339             *             #setPortalInetSocketAddresses(HttpServletRequest)}
1340             */
1341            @Deprecated
1342            public void setPortalPort(HttpServletRequest request);
1343    
1344            public void storePreferences(PortletPreferences portletPreferences)
1345                    throws IOException, ValidatorException;
1346    
1347            public String[] stripURLAnchor(String url, String separator);
1348    
1349            public String transformCustomSQL(String sql);
1350    
1351            public String transformSQL(String sql);
1352    
1353            public void updateImageId(
1354                            BaseModel<?> baseModel, boolean image, byte[] bytes,
1355                            String fieldName, long maxSize, int maxHeight, int maxWidth)
1356                    throws PortalException;
1357    
1358            public PortletMode updatePortletMode(
1359                            String portletId, User user, Layout layout, PortletMode portletMode,
1360                            HttpServletRequest request)
1361                    throws PortalException;
1362    
1363            public String updateRedirect(
1364                    String redirect, String oldPath, String newPath);
1365    
1366            public WindowState updateWindowState(
1367                    String portletId, User user, Layout layout, WindowState windowState,
1368                    HttpServletRequest request);
1369    
1370    }