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