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