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