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