001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 getCreateAccountURL(
462                            HttpServletRequest request, ThemeDisplay themeDisplay)
463                    throws Exception;
464    
465            public String getCurrentCompleteURL(HttpServletRequest request);
466    
467            public String getCurrentURL(HttpServletRequest request);
468    
469            public String getCurrentURL(PortletRequest portletRequest);
470    
471            public String getCustomSQLFunctionIsNotNull();
472    
473            public String getCustomSQLFunctionIsNull();
474    
475            /**
476             * Returns the date object for the specified month, day, and year.
477             *
478             * @param  month the month (0-based, meaning 0 for January)
479             * @param  day the day of the month
480             * @param  year the year
481             * @return the date object
482             */
483            public Date getDate(int month, int day, int year);
484    
485            /**
486             * Returns the date object for the specified month, day, year, hour, and
487             * minute, optionally throwing an exception if the date is invalid.
488             *
489             * @param  month the month (0-based, meaning 0 for January)
490             * @param  day the day of the month
491             * @param  year the year
492             * @param  hour the hour (0-24)
493             * @param  min the minute of the hour
494             * @param  pe the exception to throw if the date is invalid. If
495             *         <code>null</code>, no exception will be thrown for an invalid
496             *         date.
497             * @return the date object, or <code>null</code> if the date is invalid and
498             *         no exception to throw was provided
499             * @throws PortalException if the date was invalid and <code>pe</code> was
500             *         not <code>null</code>
501             */
502            public Date getDate(
503                            int month, int day, int year, int hour, int min, PortalException pe)
504                    throws PortalException;
505    
506            /**
507             * Returns the date object for the specified month, day, year, hour,
508             * minute, and time zone, optionally throwing an exception if the date is
509             * invalid.
510             *
511             * @param  month the month (0-based, meaning 0 for January)
512             * @param  day the day of the month
513             * @param  year the year
514             * @param  hour the hour (0-24)
515             * @param  min the minute of the hour
516             * @param  timeZone the time zone of the date
517             * @param  pe the exception to throw if the date is invalid. If
518             *         <code>null</code>, no exception will be thrown for an invalid
519             *         date.
520             * @return the date object, or <code>null</code> if the date is invalid and
521             *         no exception to throw was provided
522             * @throws PortalException if the date was invalid and <code>pe</code> was
523             *         not <code>null</code>
524             */
525            public Date getDate(
526                            int month, int day, int year, int hour, int min, TimeZone timeZone,
527                            PortalException pe)
528                    throws PortalException;
529    
530            /**
531             * Returns the date object for the specified month, day, and year,
532             * optionally throwing an exception if the date is invalid.
533             *
534             * @param  month the month (0-based, meaning 0 for January)
535             * @param  day the day of the month
536             * @param  year the year
537             * @param  pe the exception to throw if the date is invalid. If
538             *         <code>null</code>, no exception will be thrown for an invalid
539             *         date.
540             * @return the date object, or <code>null</code> if the date is invalid and
541             *         no exception to throw was provided
542             * @throws PortalException if the date was invalid and <code>pe</code> was
543             *         not <code>null</code>
544             */
545            public Date getDate(int month, int day, int year, PortalException pe)
546                    throws PortalException;
547    
548            /**
549             * Returns the date object for the specified month, day, year, and time
550             * zone, optionally throwing an exception if the date is invalid.
551             *
552             * @param  month the month (0-based, meaning 0 for January)
553             * @param  day the day of the month
554             * @param  year the year
555             * @param  timeZone the time zone of the date
556             * @param  pe the exception to throw if the date is invalid. If
557             *         <code>null</code>, no exception will be thrown for an invalid
558             *         date.
559             * @return the date object, or <code>null</code> if the date is invalid and
560             *         no exception to throw was provided
561             * @throws PortalException if the date was invalid and <code>pe</code> was
562             *         not <code>null</code>
563             */
564            public Date getDate(
565                            int month, int day, int year, TimeZone timeZone, PortalException pe)
566                    throws PortalException;
567    
568            public long getDefaultCompanyId();
569    
570            public long getDigestAuthUserId(HttpServletRequest request)
571                    throws PortalException, SystemException;
572    
573            public String getEmailFromAddress(
574                            PortletPreferences preferences, long companyId, String defaultValue)
575                    throws SystemException;
576    
577            public String getEmailFromName(
578                            PortletPreferences preferences, long companyId, String defaultValue)
579                    throws SystemException;
580    
581            public Map<String, Serializable> getExpandoBridgeAttributes(
582                            ExpandoBridge expandoBridge, PortletRequest portletRequest)
583                    throws PortalException, SystemException;
584    
585            public Serializable getExpandoValue(
586                            PortletRequest portletRequest, String name, int type,
587                            String displayType)
588                    throws PortalException, SystemException;
589    
590            public String getFacebookURL(
591                            Portlet portlet, String facebookCanvasPageURL,
592                            ThemeDisplay themeDisplay)
593                    throws PortalException, SystemException;
594    
595            public String getFirstPageLayoutTypes(PageContext pageContext);
596    
597            public String getGlobalLibDir();
598    
599            public String getGoogleGadgetURL(
600                            Portlet portlet, ThemeDisplay themeDisplay)
601                    throws PortalException, SystemException;
602    
603            public String getGroupFriendlyURL(
604                            Group group, boolean privateLayoutSet, ThemeDisplay themeDisplay)
605                    throws PortalException, SystemException;
606    
607            public String[] getGroupPermissions(HttpServletRequest request);
608    
609            public String[] getGroupPermissions(PortletRequest portletRequest);
610    
611            public String[] getGuestPermissions(HttpServletRequest request);
612    
613            public String[] getGuestPermissions(PortletRequest portletRequest);
614    
615            public String getHomeURL(HttpServletRequest request)
616                    throws PortalException, SystemException;
617    
618            public String getHost(HttpServletRequest request);
619    
620            public String getHost(PortletRequest portletRequest);
621    
622            public HttpServletRequest getHttpServletRequest(
623                    PortletRequest portletRequest);
624    
625            public HttpServletResponse getHttpServletResponse(
626                    PortletResponse portletResponse);
627    
628            public String getJournalArticleActualURL(
629                            long groupId, String mainPath, String friendlyURL,
630                            Map<String, String[]> params, Map<String, Object> requestContext)
631                    throws PortalException, SystemException;
632    
633            public String getJsSafePortletId(String portletId) ;
634    
635            public String getLayoutActualURL(Layout layout);
636    
637            public String getLayoutActualURL(Layout layout, String mainPath);
638    
639            public String getLayoutActualURL(
640                            long groupId, boolean privateLayout, String mainPath,
641                            String friendlyURL)
642                    throws PortalException, SystemException;
643    
644            public String getLayoutActualURL(
645                            long groupId, boolean privateLayout, String mainPath,
646                            String friendlyURL, Map<String, String[]> params,
647                            Map<String, Object> requestContext)
648                    throws PortalException, SystemException;
649    
650            public String getLayoutEditPage(Layout layout);
651    
652            public String getLayoutEditPage(String type);
653    
654            public String getLayoutFriendlyURL(
655                            Layout layout, ThemeDisplay themeDisplay)
656                    throws PortalException, SystemException;
657    
658            public String getLayoutFriendlyURL(
659                            Layout layout, ThemeDisplay themeDisplay, Locale locale)
660                    throws PortalException, SystemException;
661    
662            public String getLayoutFullURL(Layout layout, ThemeDisplay themeDisplay)
663                    throws PortalException, SystemException;
664    
665            public String getLayoutFullURL(
666                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
667                    throws PortalException, SystemException;
668    
669            public String getLayoutFullURL(long groupId, String portletId)
670                    throws PortalException, SystemException;
671    
672            public String getLayoutFullURL(
673                            long groupId, String portletId, boolean secure)
674                    throws PortalException, SystemException;
675    
676            public String getLayoutFullURL(ThemeDisplay themeDisplay)
677                    throws PortalException, SystemException;
678    
679            public String getLayoutSetFriendlyURL(
680                            LayoutSet layoutSet, ThemeDisplay themeDisplay)
681                    throws PortalException, SystemException;
682    
683            public String getLayoutTarget(Layout layout);
684    
685            public String getLayoutURL(Layout layout, ThemeDisplay themeDisplay)
686                    throws PortalException, SystemException;
687    
688            public String getLayoutURL(
689                            Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
690                    throws PortalException, SystemException;
691    
692            public String getLayoutURL(ThemeDisplay themeDisplay)
693                    throws PortalException, SystemException;
694    
695            public String getLayoutViewPage(Layout layout);
696    
697            public String getLayoutViewPage(String type);
698    
699            public LiferayPortletRequest getLiferayPortletRequest(
700                    PortletRequest portletRequest);
701    
702            public LiferayPortletResponse getLiferayPortletResponse(
703                    PortletResponse portletResponse);
704    
705            public Locale getLocale(HttpServletRequest request);
706    
707            public Locale getLocale(RenderRequest renderRequest);
708    
709            public String getMailId(String mx, String popPortletPrefix, Object... ids);
710    
711            public String getNetvibesURL(Portlet portlet, ThemeDisplay themeDisplay)
712                    throws PortalException, SystemException;
713    
714            public String getNewPortletTitle(
715                    String portletTitle, String oldScopeName, String newScopeName);
716    
717            public HttpServletRequest getOriginalServletRequest(
718                    HttpServletRequest request);
719    
720            public String getOuterPortletId(HttpServletRequest request);
721    
722            public long getParentGroupId(long scopeGroupId)
723                    throws PortalException, SystemException;
724    
725            public String getPathContext();
726    
727            public String getPathFriendlyURLPrivateGroup();
728    
729            public String getPathFriendlyURLPrivateUser();
730    
731            public String getPathFriendlyURLPublic();
732    
733            public String getPathImage();
734    
735            public String getPathMain();
736    
737            public String getPathProxy();
738    
739            public long getPlidFromFriendlyURL(long companyId, String friendlyURL);
740    
741            public long getPlidFromPortletId(
742                            long groupId, boolean privateLayout, String portletId)
743                    throws PortalException, SystemException;
744    
745            public long getPlidFromPortletId(long groupId, String portletId)
746                    throws PortalException, SystemException;
747    
748            public String getPortalLibDir();
749    
750            /**
751             * @deprecated Replaced by the more general {@link #getPortalPort(boolean)}
752             */
753            public int getPortalPort();
754    
755            public int getPortalPort(boolean secure);
756    
757            public Properties getPortalProperties();
758    
759            public String getPortalURL(HttpServletRequest request);
760    
761            public String getPortalURL(HttpServletRequest request, boolean secure);
762    
763            public String getPortalURL(PortletRequest portletRequest);
764    
765            public String getPortalURL(PortletRequest portletRequest, boolean secure);
766    
767            public String getPortalURL(
768                    String serverName, int serverPort, boolean secure);
769    
770            public String getPortalURL(Layout layout, ThemeDisplay themeDisplay)
771                    throws PortalException, SystemException;
772    
773            public String getPortalURL(ThemeDisplay themeDisplay)
774                    throws PortalException, SystemException;
775    
776            public String getPortalWebDir();
777    
778            public Set<String> getPortletAddDefaultResourceCheckWhitelist();
779    
780            public Set<String> getPortletAddDefaultResourceCheckWhitelistActions();
781    
782            /**
783             * @deprecated Renamed to {@link #getPortletBreadcrumbs(HttpServletRequest)}
784             */
785            public List<BreadcrumbEntry> getPortletBreadcrumbList(
786                    HttpServletRequest request);
787    
788            public List<BreadcrumbEntry> getPortletBreadcrumbs(
789                    HttpServletRequest request);
790    
791            public String getPortletDescription(
792                    Portlet portlet, ServletContext servletContext, Locale locale);
793    
794            public String getPortletDescription(Portlet portlet, User user);
795    
796            public String getPortletDescription(String portletId, Locale locale);
797    
798            public String getPortletDescription(String portletId, String languageId);
799    
800            public String getPortletDescription(String portletId, User user);
801    
802            public String getPortletId(HttpServletRequest request);
803    
804            public String getPortletId(PortletRequest portletRequest);
805    
806            public String getPortletNamespace(String portletId);
807    
808            public String getPortletTitle(Portlet portlet, Locale locale);
809    
810            public String getPortletTitle(
811                    Portlet portlet, ServletContext servletContext, Locale locale);
812    
813            public String getPortletTitle(Portlet portlet, String languageId);
814    
815            public String getPortletTitle(Portlet portlet, User user);
816    
817            public String getPortletTitle(RenderResponse renderResponse);
818    
819            public String getPortletTitle(String portletId, Locale locale);
820    
821            public String getPortletTitle(String portletId, String languageId);
822    
823            public String getPortletTitle(String portletId, User user);
824    
825            public String getPortletXmlFileName() throws SystemException;
826    
827            public PortletPreferences getPreferences(HttpServletRequest request);
828    
829            public PreferencesValidator getPreferencesValidator(
830                    Portlet portlet);
831    
832            public String getRelativeHomeURL(HttpServletRequest request)
833                    throws PortalException, SystemException;
834    
835            public long getScopeGroupId(HttpServletRequest request)
836                    throws PortalException, SystemException;
837    
838            public long getScopeGroupId(HttpServletRequest request, String portletId)
839                    throws PortalException, SystemException;
840    
841            public long getScopeGroupId(Layout layout);
842    
843            public long getScopeGroupId(Layout layout, String portletId);
844    
845            public long getScopeGroupId(long plid);
846    
847            public long getScopeGroupId(PortletRequest portletRequest)
848                    throws PortalException, SystemException;
849    
850            public User getSelectedUser(HttpServletRequest request)
851                    throws PortalException, SystemException;
852    
853            public User getSelectedUser(
854                            HttpServletRequest request, boolean checkPermission)
855                    throws PortalException, SystemException;
856    
857            public User getSelectedUser(PortletRequest portletRequest)
858                    throws PortalException, SystemException;
859    
860            public User getSelectedUser(
861                            PortletRequest portletRequest, boolean checkPermission)
862                    throws PortalException, SystemException;
863    
864            public ServletContext getServletContext(
865                    Portlet portlet, ServletContext servletContext);
866    
867            /**
868             * Returns the URL of the login page for the current site if one is
869             * available.
870             *
871             * @param  themeDisplay the theme display for the current page
872             * @return the URL of the login page for the current site, or
873             *         <code>null</code> if one is not available
874             * @throws PortalException if a portal exception occurred
875             * @throws SystemException if a system exception occurred
876             */
877            public String getSiteLoginURL(ThemeDisplay themeDisplay)
878                    throws PortalException, SystemException;
879    
880            public String getStaticResourceURL(
881                    HttpServletRequest request, String uri);
882    
883            public String getStaticResourceURL(
884                    HttpServletRequest request, String uri, long timestamp);
885    
886            public String getStaticResourceURL(
887                    HttpServletRequest request, String uri, String queryString);
888    
889            public String getStaticResourceURL(
890                    HttpServletRequest request, String uri, String queryString,
891                    long timestamp);
892    
893            public String getStrutsAction(HttpServletRequest request);
894    
895            public String[] getSystemGroups();
896    
897            public String[] getSystemOrganizationRoles();
898    
899            public String[] getSystemRoles();
900    
901            public String[] getSystemSiteRoles();
902    
903            public UploadPortletRequest getUploadPortletRequest(
904                    PortletRequest portletRequest);
905    
906            public UploadServletRequest getUploadServletRequest(
907                    HttpServletRequest request);
908    
909            public Date getUptime();
910    
911            public String getURLWithSessionId(String url, String sessionId);
912    
913            public User getUser(HttpServletRequest request)
914                    throws PortalException, SystemException;
915    
916            public User getUser(PortletRequest portletRequest)
917                    throws PortalException, SystemException;
918    
919            public String getUserEmailAddress(long userId) throws SystemException;
920    
921            public long getUserId(HttpServletRequest request);
922    
923            public long getUserId(PortletRequest portletRequest);
924    
925            public String getUserName(long userId, String defaultUserName);
926    
927            public String getUserName(
928                    long userId, String defaultUserName, HttpServletRequest request);
929    
930            public String getUserName(
931                    long userId, String defaultUserName, String userAttribute);
932    
933            public String getUserName(
934                    long userId, String defaultUserName, String userAttribute,
935                    HttpServletRequest request);
936    
937            public String getUserPassword(HttpServletRequest request);
938    
939            public String getUserPassword(HttpSession session);
940    
941            public String getUserPassword(PortletRequest portletRequest);
942    
943            public String getUserValue(long userId, String param, String defaultValue)
944                    throws SystemException;
945    
946            public long getValidUserId(long companyId, long userId)
947                    throws PortalException, SystemException;
948    
949            public String getWidgetURL(Portlet portlet, ThemeDisplay themeDisplay)
950                    throws PortalException, SystemException;
951    
952            public boolean isAllowAddPortletDefaultResource(
953                            HttpServletRequest request, Portlet portlet)
954                    throws PortalException, SystemException;
955    
956            /**
957             * @deprecated As of 6.1, renamed to {@link #isGroupAdmin(User, long)}
958             */
959            public boolean isCommunityAdmin(User user, long groupId) throws Exception;
960    
961            /**
962             * @deprecated As of 6.1, renamed to {@link #isGroupOwner(User, long)}
963             */
964            public boolean isCommunityOwner(User user, long groupId) throws Exception;
965    
966            public boolean isCompanyAdmin(User user) throws Exception;
967    
968            public boolean isCompanyControlPanelPortlet(
969                            String portletId, String category, ThemeDisplay themeDisplay)
970                    throws PortalException, SystemException;
971    
972            public boolean isCompanyControlPanelPortlet(
973                            String portletId, ThemeDisplay themeDisplay)
974                    throws PortalException, SystemException;
975    
976            public boolean isCompanyControlPanelVisible(ThemeDisplay themeDisplay)
977                    throws PortalException, SystemException;
978    
979            public boolean isControlPanelPortlet(
980                            String portletId, String category, ThemeDisplay themeDisplay)
981                    throws SystemException;
982    
983            public boolean isControlPanelPortlet(
984                            String portletId, ThemeDisplay themeDisplay)
985                    throws SystemException;
986    
987            public boolean isGroupAdmin(User user, long groupId) throws Exception;
988    
989            public boolean isGroupOwner(User user, long groupId) throws Exception;
990    
991            public boolean isLayoutDescendant(Layout layout, long layoutId)
992                    throws PortalException, SystemException;
993    
994            public boolean isLayoutFirstPageable(Layout layout);
995    
996            public boolean isLayoutFirstPageable(String type);
997    
998            public boolean isLayoutFriendliable(Layout layout);
999    
1000            public boolean isLayoutFriendliable(String type);
1001    
1002            public boolean isLayoutParentable(Layout layout);
1003    
1004            public boolean isLayoutParentable(String type);
1005    
1006            public boolean isLayoutSitemapable(Layout layout);
1007    
1008            public boolean isMethodGet(PortletRequest portletRequest);
1009    
1010            public boolean isMethodPost(PortletRequest portletRequest);
1011    
1012            public boolean isMultipartRequest(HttpServletRequest request);
1013    
1014            public boolean isOmniadmin(long userId);
1015    
1016            public boolean isReservedParameter(String name);
1017    
1018            public boolean isSecure(HttpServletRequest request);
1019    
1020            public boolean isSystemGroup(String groupName);
1021    
1022            public boolean isSystemRole(String roleName);
1023    
1024            public boolean isUpdateAvailable() throws SystemException;
1025    
1026            public boolean isValidResourceId(String resourceId);
1027    
1028            public void removePortalPortEventListener(
1029                    PortalPortEventListener portalPortEventListener);
1030    
1031            public String renderPage(
1032                            ServletContext servletContext, HttpServletRequest request,
1033                            HttpServletResponse response, String path)
1034                    throws IOException, ServletException;
1035    
1036            public String renderPortlet(
1037                            ServletContext servletContext, HttpServletRequest request,
1038                            HttpServletResponse response, Portlet portlet, String queryString,
1039                            boolean writeOutput)
1040                    throws IOException, ServletException;
1041    
1042            public String renderPortlet(
1043                            ServletContext servletContext, HttpServletRequest request,
1044                            HttpServletResponse response, Portlet portlet, String queryString,
1045                            String columnId, Integer columnPos, Integer columnCount,
1046                            boolean writeOutput)
1047                    throws IOException, ServletException;
1048    
1049            public String renderPortlet(
1050                            ServletContext servletContext, HttpServletRequest request,
1051                            HttpServletResponse response, Portlet portlet, String queryString,
1052                            String columnId, Integer columnPos, Integer columnCount,
1053                            String path, boolean writeOutput)
1054                    throws IOException, ServletException;
1055    
1056            public void resetCDNHosts();
1057    
1058            public Set<String> resetPortletAddDefaultResourceCheckWhitelist();
1059    
1060            public Set<String> resetPortletAddDefaultResourceCheckWhitelistActions();
1061    
1062            public void sendError(
1063                            Exception e, ActionRequest actionRequest,
1064                            ActionResponse actionResponse)
1065                    throws IOException;
1066    
1067            public void sendError(
1068                            Exception e, HttpServletRequest request,
1069                            HttpServletResponse response)
1070                    throws IOException, ServletException;
1071    
1072            public void sendError(
1073                            int status, Exception e, ActionRequest actionRequest,
1074                            ActionResponse actionResponse)
1075                    throws IOException;
1076    
1077            public void sendError(
1078                            int status, Exception e, HttpServletRequest request,
1079                            HttpServletResponse response)
1080                    throws IOException, ServletException;
1081    
1082            /**
1083             * Sets the description for the page, overriding the existing page
1084             * description.
1085             */
1086            public void setPageDescription(
1087                    String description, HttpServletRequest request);
1088    
1089            /**
1090             * Sets the keywords for the page, overriding the existing page keywords.
1091             */
1092            public void setPageKeywords(String keywords, HttpServletRequest request);
1093    
1094            /**
1095             * Sets the subtitle for the page, overriding the existing page subtitle.
1096             */
1097            public void setPageSubtitle(String subtitle, HttpServletRequest request);
1098    
1099            /**
1100             * Sets the whole title for the page, overriding the existing page whole
1101             * title.
1102             */
1103            public void setPageTitle(String title, HttpServletRequest request);
1104    
1105            /**
1106             * Sets the port obtained on the first request to the portal.
1107             */
1108            public void setPortalPort(HttpServletRequest request);
1109    
1110            public void storePreferences(PortletPreferences portletPreferences)
1111                    throws IOException, ValidatorException;
1112    
1113            public String[] stripURLAnchor(String url, String separator);
1114    
1115            public String transformCustomSQL(String sql);
1116    
1117            public PortletMode updatePortletMode(
1118                    String portletId, User user, Layout layout, PortletMode portletMode,
1119                    HttpServletRequest request);
1120    
1121            public String updateRedirect(
1122                    String redirect, String oldPath, String newPath);
1123    
1124            public WindowState updateWindowState(
1125                    String portletId, User user, Layout layout, WindowState windowState,
1126                    HttpServletRequest request);
1127    
1128    }