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