1
22
23 package com.liferay.portal.util;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portal.kernel.upload.UploadPortletRequest;
28 import com.liferay.portal.kernel.upload.UploadServletRequest;
29 import com.liferay.portal.model.Company;
30 import com.liferay.portal.model.Layout;
31 import com.liferay.portal.model.LayoutSet;
32 import com.liferay.portal.model.Portlet;
33 import com.liferay.portal.model.User;
34 import com.liferay.portal.theme.ThemeDisplay;
35 import com.liferay.portlet.expando.model.ExpandoBridge;
36
37 import java.io.IOException;
38 import java.io.Serializable;
39
40 import java.sql.SQLException;
41
42 import java.util.Date;
43 import java.util.List;
44 import java.util.Locale;
45 import java.util.Map;
46 import java.util.Properties;
47 import java.util.TimeZone;
48
49 import javax.portlet.ActionRequest;
50 import javax.portlet.ActionResponse;
51 import javax.portlet.PortletMode;
52 import javax.portlet.PortletPreferences;
53 import javax.portlet.PortletRequest;
54 import javax.portlet.PortletResponse;
55 import javax.portlet.PreferencesValidator;
56 import javax.portlet.RenderRequest;
57 import javax.portlet.ValidatorException;
58 import javax.portlet.WindowState;
59
60 import javax.servlet.ServletContext;
61 import javax.servlet.ServletException;
62 import javax.servlet.http.HttpServletRequest;
63 import javax.servlet.http.HttpServletResponse;
64 import javax.servlet.http.HttpSession;
65 import javax.servlet.jsp.PageContext;
66
67
73 public interface Portal {
74
75 public static final String FRIENDLY_URL_SEPARATOR = "/-/";
76
77 public static final String PATH_IMAGE = "/image";
78
79 public static final String PATH_MAIN = "/c";
80
81 public static final String PATH_PORTAL_LAYOUT = "/portal/layout";
82
83 public static final String PORTLET_XML_FILE_NAME_STANDARD = "portlet.xml";
84
85 public static final String PORTLET_XML_FILE_NAME_CUSTOM =
86 "portlet-custom.xml";
87
88 public static final Date UP_TIME = new Date();
89
90
97 public void addPageDescription(
98 String description, HttpServletRequest request);
99
100
106 public void addPageKeywords(String keywords, HttpServletRequest request);
107
108
114 public void addPageSubtitle(String subtitle, HttpServletRequest request);
115
116
123 public void addPageTitle(String title, HttpServletRequest request);
124
125 public void clearRequestParameters(RenderRequest renderRequest);
126
127 public void copyRequestParameters(
128 ActionRequest actionRequest, ActionResponse actionResponse);
129
130 public String getCDNHost();
131
132 public String getClassName(long classNameId);
133
134 public long getClassNameId(Class<?> classObj);
135
136 public long getClassNameId(String value);
137
138 public String getClassNamePortletId(String className);
139
140 public String getCommunityLoginURL(ThemeDisplay themeDisplay)
141 throws PortalException, SystemException;
142
143 public String[] getCommunityPermissions(HttpServletRequest request);
144
145 public String[] getCommunityPermissions(PortletRequest portletRequest);
146
147 public Company getCompany(HttpServletRequest request)
148 throws PortalException, SystemException;
149
150 public Company getCompany(PortletRequest portletRequest)
151 throws PortalException, SystemException;
152
153 public long getCompanyId(HttpServletRequest requestuest);
154
155 public long getCompanyId(PortletRequest portletRequest);
156
157 public long[] getCompanyIds();
158
159 public String getComputerAddress();
160
161 public String getComputerName();
162
163 public String getControlPanelCategory(
164 String portletId, ThemeDisplay themeDisplay)
165 throws SystemException;
166
167 public List<Portlet> getControlPanelPortlets(
168 String category, ThemeDisplay themeDisplay)
169 throws SystemException;
170
171 public String getCurrentCompleteURL(HttpServletRequest request);
172
173 public String getCurrentURL(HttpServletRequest request);
174
175 public String getCurrentURL(PortletRequest portletRequest);
176
177 public String getCustomSQLFunctionIsNotNull();
178
179 public String getCustomSQLFunctionIsNull();
180
181 public Date getDate(int month, int day, int year, PortalException pe)
182 throws PortalException;
183
184 public Date getDate(
185 int month, int day, int year, TimeZone timeZone, PortalException pe)
186 throws PortalException;
187
188 public Date getDate(
189 int month, int day, int year, int hour, int min, PortalException pe)
190 throws PortalException;
191
192 public Date getDate(
193 int month, int day, int year, int hour, int min, TimeZone timeZone,
194 PortalException pe)
195 throws PortalException;
196
197 public long getDefaultCompanyId();
198
199 public Map<String, Serializable> getExpandoBridgeAttributes(
200 ExpandoBridge expandoBridge, PortletRequest portletRequest)
201 throws PortalException, SystemException;
202
203 public String getFirstPageLayoutTypes(PageContext pageContext);
204
205 public String getGoogleGadgetURL(
206 Portlet portlet, ThemeDisplay themeDisplay);
207
208 public String[] getGuestPermissions(HttpServletRequest request);
209
210 public String[] getGuestPermissions(PortletRequest portletRequest);
211
212 public String getHomeURL(HttpServletRequest request)
213 throws PortalException, SystemException;
214
215 public String getHost(HttpServletRequest request);
216
217 public String getHost(PortletRequest portletRequest);
218
219 public HttpServletRequest getHttpServletRequest(
220 PortletRequest portletRequest);
221
222 public HttpServletResponse getHttpServletResponse(
223 PortletResponse portletResponse);
224
225 public String getLayoutEditPage(Layout layout);
226
227 public String getLayoutViewPage(Layout layout);
228
229 public String getLayoutURL(ThemeDisplay themeDisplay);
230
231 public String getLayoutURL(Layout layout, ThemeDisplay themeDisplay);
232
233 public String getLayoutURL(
234 Layout layout, ThemeDisplay themeDisplay, boolean doAsUser);
235
236 public String getLayoutActualURL(Layout layout);
237
238 public String getLayoutActualURL(Layout layout, String mainPath);
239
240 public String getLayoutActualURL(
241 long groupId, boolean privateLayout, String mainPath,
242 String friendlyURL)
243 throws PortalException, SystemException;
244
245 public String getLayoutActualURL(
246 long groupId, boolean privateLayout, String mainPath,
247 String friendlyURL, Map<String, String[]> params)
248 throws PortalException, SystemException;
249
250 public String getLayoutFriendlyURL(
251 Layout layout, ThemeDisplay themeDisplay);
252
253 public String getLayoutSetFriendlyURL(
254 LayoutSet layoutSet, ThemeDisplay themeDisplay)
255 throws PortalException, SystemException;
256
257 public String getLayoutTarget(Layout layout);
258
259 public String getJsSafePortletId(String portletId) ;
260
261 public Locale getLocale(HttpServletRequest request);
262
263 public Locale getLocale(RenderRequest renderRequest);
264
265 public String getNetvibesURL(Portlet portlet, ThemeDisplay themeDisplay);
266
267 public HttpServletRequest getOriginalServletRequest(
268 HttpServletRequest request);
269
270 public String getPathContext();
271
272 public String getPathFriendlyURLPrivateGroup();
273
274 public String getPathFriendlyURLPrivateUser();
275
276 public String getPathFriendlyURLPublic();
277
278 public String getPathImage();
279
280 public String getPathMain();
281
282 public long getPlidFromFriendlyURL(long companyId, String friendlyURL);
283
284 public long getPlidFromPortletId(long groupId, String portletId);
285
286 public long getPlidFromPortletId(
287 long groupId, boolean privateLayout, String portletId);
288
289 public String getPortalLibDir();
290
291 public int getPortalPort();
292
293 public Properties getPortalProperties();
294
295 public String getPortalURL(ThemeDisplay themeDisplay);
296
297 public String getPortalURL(HttpServletRequest request);
298
299 public String getPortalURL(HttpServletRequest request, boolean secure);
300
301 public String getPortalURL(PortletRequest portletRequest);
302
303 public String getPortalURL(PortletRequest portletRequest, boolean secure);
304
305 public String getPortalURL(
306 String serverName, int serverPort, boolean secure);
307
308 public String getPortalWebDir();
309
310 public Object[] getPortletFriendlyURLMapper(
311 long groupId, boolean privateLayout, String url)
312 throws PortalException, SystemException;
313
314 public Object[] getPortletFriendlyURLMapper(
315 long groupId, boolean privateLayout, String url,
316 Map<String, String[]> params)
317 throws PortalException, SystemException;
318
319
322 public long getPortletGroupId(long plid);
323
324
327 public long getPortletGroupId(Layout layout);
328
329
332 public long getPortletGroupId(HttpServletRequest request);
333
334
337 public long getPortletGroupId(ActionRequest actionRequest);
338
339
342 public long getPortletGroupId(RenderRequest renderRequest);
343
344 public String getPortletId(HttpServletRequest request);
345
346 public String getPortletId(PortletRequest portletRequest);
347
348 public String getPortletNamespace(String portletId);
349
350 public String getPortletTitle(
351 String portletId, long companyId, String languageId);
352
353 public String getPortletTitle(
354 String portletId, long companyId, Locale locale);
355
356 public String getPortletTitle(String portletId, User user);
357
358 public String getPortletTitle(
359 Portlet portlet, long companyId, String languageId);
360
361 public String getPortletTitle(
362 Portlet portlet, long companyId, Locale locale);
363
364 public String getPortletTitle(Portlet portlet, User user);
365
366 public String getPortletTitle(
367 Portlet portlet, ServletContext servletContext, Locale locale);
368
369 public String getPortletXmlFileName() throws SystemException;
370
371 public PortletPreferences getPreferences(HttpServletRequest request);
372
373 public PreferencesValidator getPreferencesValidator(
374 Portlet portlet);
375
376 public long getScopeGroupId(long plid);
377
378 public long getScopeGroupId(Layout layout);
379
380 public long getScopeGroupId(Layout layout, String portletId);
381
382 public long getScopeGroupId(HttpServletRequest request);
383
384 public long getScopeGroupId(HttpServletRequest request, String portletId);
385
386 public long getScopeGroupId(PortletRequest portletRequest);
387
388 public User getSelectedUser(HttpServletRequest request)
389 throws PortalException, SystemException;
390
391 public User getSelectedUser(
392 HttpServletRequest request, boolean checkPermission)
393 throws PortalException, SystemException;
394
395 public User getSelectedUser(PortletRequest portletRequest)
396 throws PortalException, SystemException;
397
398 public User getSelectedUser(
399 PortletRequest portletRequest, boolean checkPermission)
400 throws PortalException, SystemException;
401
402 public String getStaticResourceURL(
403 HttpServletRequest request, String uri);
404
405 public String getStaticResourceURL(
406 HttpServletRequest request, String uri, String queryString);
407
408 public String getStaticResourceURL(
409 HttpServletRequest request, String uri, long timestamp);
410
411 public String getStaticResourceURL(
412 HttpServletRequest request, String uri, String queryString,
413 long timestamp);
414
415 public String getStrutsAction(HttpServletRequest request);
416
417 public String[] getSystemCommunityRoles();
418
419 public String[] getSystemGroups();
420
421 public String[] getSystemOrganizationRoles();
422
423 public String[] getSystemRoles();
424
425 public String[] getTagsCategories(PortletRequest portletRequest);
426
427 public String[] getTagsEntries(PortletRequest portletRequest);
428
429 public UploadPortletRequest getUploadPortletRequest(
430 ActionRequest actionRequest);
431
432 public UploadServletRequest getUploadServletRequest(
433 HttpServletRequest request);
434
435 public Date getUptime();
436
437 public String getURLWithSessionId(String url, String sessionId);
438
439 public User getUser(HttpServletRequest request)
440 throws PortalException, SystemException;
441
442 public User getUser(PortletRequest portletRequest)
443 throws PortalException, SystemException;
444
445 public long getUserId(HttpServletRequest request);
446
447 public long getUserId(PortletRequest portletRequest);
448
449 public String getUserName(long userId, String defaultUserName);
450
451 public String getUserName(
452 long userId, String defaultUserName, String userAttribute);
453
454 public String getUserName(
455 long userId, String defaultUserName, HttpServletRequest request);
456
457 public String getUserName(
458 long userId, String defaultUserName, String userAttribute,
459 HttpServletRequest request);
460
461 public String getUserPassword(HttpSession session);
462
463 public String getUserPassword(HttpServletRequest request);
464
465 public String getUserPassword(PortletRequest portletRequest);
466
467 public String getUserValue(long userId, String param, String defaultValue)
468 throws SystemException;
469
470 public String getWidgetURL(Portlet portlet, ThemeDisplay themeDisplay);
471
472 public boolean isLayoutFirstPageable(String type);
473
474 public boolean isLayoutFriendliable(Layout layout);
475
476 public boolean isLayoutParentable(Layout layout);
477
478 public boolean isLayoutParentable(String type);
479
480 public boolean isLayoutSitemapable(Layout layout);
481
482 public boolean isMethodGet(PortletRequest portletRequest);
483
484 public boolean isMethodPost(PortletRequest portletRequest);
485
486 public boolean isReservedParameter(String name);
487
488 public boolean isSystemGroup(String groupName);
489
490 public boolean isSystemRole(String roleName);
491
492 public boolean isUpdateAvailable() throws SystemException;
493
494 public void renderPage(
495 StringBuilder sb, ServletContext servletContext,
496 HttpServletRequest request, HttpServletResponse response,
497 String path)
498 throws IOException, ServletException;
499
500 public void renderPortlet(
501 StringBuilder sb, ServletContext servletContext,
502 HttpServletRequest request, HttpServletResponse response,
503 Portlet portlet, String queryString)
504 throws IOException, ServletException;
505
506 public void renderPortlet(
507 StringBuilder sb, ServletContext servletContext,
508 HttpServletRequest request, HttpServletResponse response,
509 Portlet portlet, String queryString, String columnId,
510 Integer columnPos, Integer columnCount)
511 throws IOException, ServletException;
512
513 public void renderPortlet(
514 StringBuilder sb, ServletContext servletContext,
515 HttpServletRequest request, HttpServletResponse response,
516 Portlet portlet, String queryString, String columnId,
517 Integer columnPos, Integer columnCount, String path)
518 throws IOException, ServletException;
519
520 public void runSQL(String sql) throws IOException, SQLException;
521
522 public void sendError(
523 Exception e, HttpServletRequest request,
524 HttpServletResponse response)
525 throws IOException, ServletException;
526
527 public void sendError(
528 int status, Exception e, HttpServletRequest request,
529 HttpServletResponse response)
530 throws IOException, ServletException;
531
532 public void sendError(
533 Exception e, ActionRequest actionRequest,
534 ActionResponse actionResponse)
535 throws IOException;
536
537 public void sendError(
538 int status, Exception e, ActionRequest actionRequest,
539 ActionResponse actionResponse)
540 throws IOException;
541
542
549 public void setPageDescription(
550 String description, HttpServletRequest request);
551
552
558 public void setPageKeywords(String keywords, HttpServletRequest request);
559
560
566 public void setPageSubtitle(String subtitle, HttpServletRequest request);
567
568
575 public void setPageTitle(String title, HttpServletRequest request);
576
577
582 public void setPortalPort(HttpServletRequest request);
583
584 public void storePreferences(PortletPreferences preferences)
585 throws IOException, ValidatorException;
586
587 public String transformCustomSQL(String sql);
588
589 public PortletMode updatePortletMode(
590 String portletId, User user, Layout layout, PortletMode portletMode,
591 HttpServletRequest request);
592
593 public WindowState updateWindowState(
594 String portletId, User user, Layout layout, WindowState windowState,
595 HttpServletRequest request);
596
597 }