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