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