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