001
014
015 package com.liferay.portal.util;
016
017 import com.liferay.portal.kernel.dao.db.DB;
018 import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
019 import com.liferay.portal.kernel.exception.PortalException;
020 import com.liferay.portal.kernel.exception.SystemException;
021 import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
022 import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
023 import com.liferay.portal.kernel.servlet.taglib.ui.BreadcrumbEntry;
024 import com.liferay.portal.kernel.upload.UploadPortletRequest;
025 import com.liferay.portal.kernel.upload.UploadServletRequest;
026 import com.liferay.portal.model.BaseModel;
027 import com.liferay.portal.model.Company;
028 import com.liferay.portal.model.Group;
029 import com.liferay.portal.model.Layout;
030 import com.liferay.portal.model.LayoutSet;
031 import com.liferay.portal.model.Portlet;
032 import com.liferay.portal.model.Resource;
033 import com.liferay.portal.model.ResourcePermission;
034 import com.liferay.portal.model.User;
035 import com.liferay.portal.theme.ThemeDisplay;
036 import com.liferay.portlet.expando.model.ExpandoBridge;
037
038 import java.io.IOException;
039 import java.io.Serializable;
040
041 import java.sql.SQLException;
042
043 import java.util.Date;
044 import java.util.List;
045 import java.util.Locale;
046 import java.util.Map;
047 import java.util.Properties;
048 import java.util.Set;
049 import java.util.TimeZone;
050
051 import javax.portlet.ActionRequest;
052 import javax.portlet.ActionResponse;
053 import javax.portlet.PortletMode;
054 import javax.portlet.PortletPreferences;
055 import javax.portlet.PortletRequest;
056 import javax.portlet.PortletResponse;
057 import javax.portlet.PreferencesValidator;
058 import javax.portlet.RenderRequest;
059 import javax.portlet.RenderResponse;
060 import javax.portlet.ValidatorException;
061 import javax.portlet.WindowState;
062
063 import javax.servlet.ServletContext;
064 import javax.servlet.ServletException;
065 import javax.servlet.http.HttpServletRequest;
066 import javax.servlet.http.HttpServletResponse;
067 import javax.servlet.http.HttpSession;
068 import javax.servlet.jsp.PageContext;
069
070
075 public class PortalUtil {
076
077
081 public static void addPageDescription(
082 String description, HttpServletRequest request) {
083
084 getPortal().addPageDescription(description, request);
085 }
086
087
090 public static void addPageKeywords(
091 String keywords, HttpServletRequest request) {
092
093 getPortal().addPageKeywords(keywords, request);
094 }
095
096
099 public static void addPageSubtitle(
100 String subtitle, HttpServletRequest request) {
101
102 getPortal().addPageSubtitle(subtitle, request);
103 }
104
105
109 public static void addPageTitle(String title, HttpServletRequest request) {
110 getPortal().addPageTitle(title, request);
111 }
112
113 public static void addPortalPortEventListener(
114 PortalPortEventListener portalPortEventListener) {
115
116 getPortal().addPortalPortEventListener(portalPortEventListener);
117 }
118
119 public static void addPortletBreadcrumbEntry(
120 HttpServletRequest request, String title, String url) {
121
122 getPortal().addPortletBreadcrumbEntry(request, title, url);
123 }
124
125 public static void addPortletBreadcrumbEntry(
126 HttpServletRequest request, String title, String url,
127 Map<String, Object> data) {
128
129 getPortal().addPortletBreadcrumbEntry(request, title, url, data);
130 }
131
132 public static void addPortletDefaultResource(
133 HttpServletRequest request, Portlet portlet)
134 throws PortalException, SystemException {
135
136 getPortal().addPortletDefaultResource(request, portlet);
137 }
138
139
145 public static String addPreservedParameters(
146 ThemeDisplay themeDisplay, Layout layout, String url,
147 boolean doAsUser) {
148
149 return getPortal().addPreservedParameters(
150 themeDisplay, layout, url, doAsUser);
151 }
152
153
158 public static String addPreservedParameters(
159 ThemeDisplay themeDisplay, String url) {
160
161 return getPortal().addPreservedParameters(themeDisplay, url);
162 }
163
164 public static void clearRequestParameters(RenderRequest renderRequest) {
165 getPortal().clearRequestParameters(renderRequest);
166 }
167
168 public static void copyRequestParameters(
169 ActionRequest actionRequest, ActionResponse actionResponse) {
170
171 getPortal().copyRequestParameters(actionRequest, actionResponse);
172 }
173
174 public static String escapeRedirect(String url) {
175 return getPortal().escapeRedirect(url);
176 }
177
178 public static String generateRandomKey(
179 HttpServletRequest request, String input) {
180
181 return getPortal().generateRandomKey(request, input);
182 }
183
184 public static String getActualURL(
185 long groupId, boolean privateLayout, String mainPath,
186 String friendlyURL, Map<String, String[]> params,
187 Map<String, Object> requestContext)
188 throws PortalException, SystemException {
189
190 return getPortal().getActualURL(
191 groupId, privateLayout, mainPath, friendlyURL, params,
192 requestContext);
193 }
194
195 public static Set<String> getAuthTokenIgnoreActions() {
196 return getPortal().getAuthTokenIgnoreActions();
197 }
198
199 public static Set<String> getAuthTokenIgnorePortlets() {
200 return getPortal().getAuthTokenIgnorePortlets();
201 }
202
203 public static BaseModel<?> getBaseModel(Resource resource)
204 throws PortalException, SystemException {
205
206 return getPortal().getBaseModel(resource);
207 }
208
209 public static BaseModel<?> getBaseModel(
210 ResourcePermission resourcePermission)
211 throws PortalException, SystemException {
212
213 return getPortal().getBaseModel(resourcePermission);
214 }
215
216 public static BaseModel<?> getBaseModel(String modelName, String primKey)
217 throws PortalException, SystemException {
218
219 return getPortal().getBaseModel(modelName, primKey);
220 }
221
222 public static long getBasicAuthUserId(HttpServletRequest request)
223 throws PortalException, SystemException {
224
225 return getPortal().getBasicAuthUserId(request);
226 }
227
228 public static long getDigestAuthUserId(
229 HttpServletRequest request)
230 throws PortalException, SystemException {
231
232 return getPortal().getDigestAuthUserId(request);
233 }
234
235 public static long getBasicAuthUserId(
236 HttpServletRequest request, long companyId)
237 throws PortalException, SystemException {
238
239 return getPortal().getBasicAuthUserId(request, companyId);
240 }
241
242 public static String getCanonicalAlternateURL(
243 HttpServletRequest request, String url, Locale locale)
244 throws PortalException, SystemException{
245
246 return getPortal().getCanonicalAlternateURL(request, url, locale);
247 }
248
249 public static String getCanonicalURL(HttpServletRequest request)
250 throws PortalException, SystemException{
251
252 return getPortal().getCanonicalURL(request);
253 }
254
255
258 public static String getCDNHost() {
259 return getPortal().getCDNHost();
260 }
261
262 public static String getCDNHost(boolean secure) {
263 return getPortal().getCDNHost(secure);
264 }
265
266 public static String getCDNHostHttp(long companyId) {
267 return getPortal().getCDNHostHttp(companyId);
268 }
269
270 public static String getCDNHostHttps(long companyId) {
271 return getPortal().getCDNHostHttps(companyId);
272 }
273
274 public static String getClassName(long classNameId) {
275 return getPortal().getClassName(classNameId);
276 }
277
278 public static long getClassNameId(Class<?> clazz) {
279 return getPortal().getClassNameId(clazz);
280 }
281
282 public static long getClassNameId(String value) {
283 return getPortal().getClassNameId(value);
284 }
285
286 public static String getClassNamePortletId(String className) {
287 return getPortal().getClassNamePortletId(className);
288 }
289
290 public static Company getCompany(HttpServletRequest request)
291 throws PortalException, SystemException {
292
293 return getPortal().getCompany(request);
294 }
295
296 public static Company getCompany(PortletRequest portletRequest)
297 throws PortalException, SystemException {
298
299 return getPortal().getCompany(portletRequest);
300 }
301
302 public static long getCompanyId(HttpServletRequest request) {
303 return getPortal().getCompanyId(request);
304 }
305
306 public static long getCompanyId(PortletRequest portletRequest) {
307 return getPortal().getCompanyId(portletRequest);
308 }
309
310 public static long[] getCompanyIds() {
311 return getPortal().getCompanyIds();
312 }
313
314 public static String getComputerAddress() {
315 return getPortal().getComputerAddress();
316 }
317
318 public static String getComputerName() {
319 return getPortal().getComputerName();
320 }
321
322 public static String getControlPanelCategory(
323 String portletId, ThemeDisplay themeDisplay)
324 throws SystemException {
325
326 return getPortal().getControlPanelCategory(portletId, themeDisplay);
327 }
328
329 public static String getControlPanelFullURL(
330 long scopeGroupId, String ppid, Map<String, String[]> params)
331 throws PortalException, SystemException {
332
333 return getPortal().getControlPanelFullURL(scopeGroupId, ppid, params);
334 }
335
336 public static Set<Portlet> getControlPanelPortlets(
337 long companyId, String category)
338 throws SystemException {
339
340 return getPortal().getControlPanelPortlets(companyId, category);
341 }
342
343 public static List<Portlet> getControlPanelPortlets(
344 String category, ThemeDisplay themeDisplay)
345 throws SystemException {
346
347 return getPortal().getControlPanelPortlets(
348 category, themeDisplay);
349 }
350
351 public static String getCreateAccountURL(
352 HttpServletRequest request, ThemeDisplay themeDisplay)
353 throws Exception {
354
355 return getPortal().getCreateAccountURL(request, themeDisplay);
356 }
357
358 public static String getCurrentCompleteURL(HttpServletRequest request) {
359 return getPortal().getCurrentCompleteURL(request);
360 }
361
362 public static String getCurrentURL(HttpServletRequest request) {
363 return getPortal().getCurrentURL(request);
364 }
365
366 public static String getCurrentURL(PortletRequest portletRequest) {
367 return getPortal().getCurrentURL(portletRequest);
368 }
369
370 public static String getCustomSQLFunctionIsNotNull() {
371 return getPortal().getCustomSQLFunctionIsNotNull();
372 }
373
374 public static String getCustomSQLFunctionIsNull() {
375 return getPortal().getCustomSQLFunctionIsNull();
376 }
377
378 public static Date getDate(int month, int day, int year) {
379 return getPortal().getDate(month, day, year);
380 }
381
382 public static Date getDate(
383 int month, int day, int year, int hour, int min, PortalException pe)
384 throws PortalException {
385
386 return getPortal().getDate(month, day, year, hour, min, pe);
387 }
388
389 public static Date getDate(
390 int month, int day, int year, int hour, int min, TimeZone timeZone,
391 PortalException pe)
392 throws PortalException {
393
394 return getPortal().getDate(month, day, year, hour, min, timeZone, pe);
395 }
396
397 public static Date getDate(int month, int day, int year, PortalException pe)
398 throws PortalException {
399
400 return getPortal().getDate(month, day, year, pe);
401 }
402
403 public static Date getDate(
404 int month, int day, int year, TimeZone timeZone, PortalException pe)
405 throws PortalException {
406
407 return getPortal().getDate(month, day, year, timeZone, pe);
408 }
409
410
413 public static DB getDB() {
414 return DBFactoryUtil.getDB();
415 }
416
417 public static long getDefaultCompanyId() {
418 return getPortal().getDefaultCompanyId();
419 }
420
421 public static String getEmailFromAddress(
422 PortletPreferences preferences, long companyId, String defaultValue)
423 throws SystemException {
424
425 return getPortal().getEmailFromAddress(
426 preferences, companyId, defaultValue);
427 }
428
429 public static String getEmailFromName(
430 PortletPreferences preferences, long companyId, String defaultValue)
431 throws SystemException {
432
433 return getPortal().getEmailFromName(
434 preferences, companyId, defaultValue);
435 }
436
437 public static Map<String, Serializable> getExpandoBridgeAttributes(
438 ExpandoBridge expandoBridge, PortletRequest portletRequest)
439 throws PortalException, SystemException {
440
441 return getPortal().getExpandoBridgeAttributes(
442 expandoBridge, portletRequest);
443 }
444
445 public static Serializable getExpandoValue(
446 PortletRequest portletRequest, String name, int type,
447 String displayType)
448 throws PortalException, SystemException{
449
450 return getPortal().getExpandoValue(
451 portletRequest, name, type, displayType);
452 }
453
454 public static String getFacebookURL(
455 Portlet portlet, String facebookCanvasPageURL,
456 ThemeDisplay themeDisplay)
457 throws PortalException, SystemException {
458
459 return getPortal().getFacebookURL(
460 portlet, facebookCanvasPageURL, themeDisplay);
461 }
462
463 public static String getFirstPageLayoutTypes(PageContext pageContext) {
464 return getPortal().getFirstPageLayoutTypes(pageContext);
465 }
466
467 public static String getGlobalLibDir() {
468 return getPortal().getGlobalLibDir();
469 }
470
471 public static String getGoogleGadgetURL(
472 Portlet portlet, ThemeDisplay themeDisplay)
473 throws PortalException, SystemException {
474
475 return getPortal().getGoogleGadgetURL(portlet, themeDisplay);
476 }
477
478 public static String getGroupFriendlyURL(
479 Group group, boolean privateLayoutSet, ThemeDisplay themeDisplay)
480 throws PortalException, SystemException {
481
482 return getPortal().getGroupFriendlyURL(
483 group, privateLayoutSet, themeDisplay);
484 }
485
486 public static String[] getGroupPermissions(HttpServletRequest request) {
487 return getPortal().getGroupPermissions(request);
488 }
489
490 public static String[] getGroupPermissions(
491 PortletRequest portletRequest) {
492
493 return getPortal().getGroupPermissions(portletRequest);
494 }
495
496 public static String[] getGuestPermissions(HttpServletRequest request) {
497 return getPortal().getGuestPermissions(request);
498 }
499
500 public static String[] getGuestPermissions(PortletRequest portletRequest) {
501 return getPortal().getGuestPermissions(portletRequest);
502 }
503
504 public static String getHomeURL(HttpServletRequest request)
505 throws PortalException, SystemException {
506
507 return getPortal().getHomeURL(request);
508 }
509
510 public static String getHost(HttpServletRequest request) {
511 return getPortal().getHost(request);
512 }
513
514 public static String getHost(PortletRequest portletRequest) {
515 return getPortal().getHost(portletRequest);
516 }
517
518 public static HttpServletRequest getHttpServletRequest(
519 PortletRequest portletRequest) {
520
521 return getPortal().getHttpServletRequest(portletRequest);
522 }
523
524 public static HttpServletResponse getHttpServletResponse(
525 PortletResponse portletResponse) {
526
527 return getPortal().getHttpServletResponse(portletResponse);
528 }
529
530 public static String getJournalArticleActualURL(
531 long groupId, String mainPath, String friendlyURL,
532 Map<String, String[]> params, Map<String, Object> requestContext)
533 throws PortalException, SystemException {
534
535 return getPortal().getJournalArticleActualURL(
536 groupId, mainPath, friendlyURL, params, requestContext);
537 }
538
539 public static String getJsSafePortletId(String portletId) {
540 return getPortal().getJsSafePortletId(portletId);
541 }
542
543 public static String getLayoutActualURL(Layout layout) {
544 return getPortal().getLayoutActualURL(layout);
545 }
546
547 public static String getLayoutActualURL(Layout layout, String mainPath) {
548 return getPortal().getLayoutActualURL(layout, mainPath);
549 }
550
551 public static String getLayoutActualURL(
552 long groupId, boolean privateLayout, String mainPath,
553 String friendlyURL)
554 throws PortalException, SystemException {
555
556 return getPortal().getLayoutActualURL(
557 groupId, privateLayout, mainPath, friendlyURL);
558 }
559
560 public static String getLayoutActualURL(
561 long groupId, boolean privateLayout, String mainPath,
562 String friendlyURL, Map<String, String[]> params,
563 Map<String, Object> requestContext)
564 throws PortalException, SystemException {
565
566 return getPortal().getLayoutActualURL(
567 groupId, privateLayout, mainPath, friendlyURL, params,
568 requestContext);
569 }
570
571 public static String getLayoutEditPage(Layout layout) {
572 return getPortal().getLayoutEditPage(layout);
573 }
574
575 public static String getLayoutEditPage(String type) {
576 return getPortal().getLayoutEditPage(type);
577 }
578
579 public static String getLayoutFriendlyURL(
580 Layout layout, ThemeDisplay themeDisplay)
581 throws PortalException, SystemException {
582
583 return getPortal().getLayoutFriendlyURL(layout, themeDisplay);
584 }
585
586 public static String getLayoutFriendlyURL(
587 Layout layout, ThemeDisplay themeDisplay, Locale locale)
588 throws PortalException, SystemException {
589
590 return getPortal().getLayoutFriendlyURL(layout, themeDisplay, locale);
591 }
592
593 public static String getLayoutFullURL(
594 Layout layout, ThemeDisplay themeDisplay)
595 throws PortalException, SystemException {
596
597 return getPortal().getLayoutFullURL(layout, themeDisplay);
598 }
599
600 public static String getLayoutFullURL(
601 Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
602 throws PortalException, SystemException {
603
604 return getPortal().getLayoutFullURL(layout, themeDisplay, doAsUser);
605 }
606
607 public static String getLayoutFullURL(long groupId, String portletId)
608 throws PortalException, SystemException {
609
610 return getPortal().getLayoutFullURL(groupId, portletId);
611 }
612
613 public static String getLayoutFullURL(
614 long groupId, String portletId, boolean secure)
615 throws PortalException, SystemException {
616
617 return getPortal().getLayoutFullURL(groupId, portletId, secure);
618 }
619
620 public static String getLayoutFullURL(ThemeDisplay themeDisplay)
621 throws PortalException, SystemException {
622
623 return getPortal().getLayoutFullURL(themeDisplay);
624 }
625
626 public static String getLayoutSetFriendlyURL(
627 LayoutSet layoutSet, ThemeDisplay themeDisplay)
628 throws PortalException, SystemException {
629
630 return getPortal().getLayoutSetFriendlyURL(layoutSet, themeDisplay);
631 }
632
633 public static String getLayoutTarget(Layout layout) {
634 return getPortal().getLayoutTarget(layout);
635 }
636
637 public static String getLayoutURL(
638 Layout layout, ThemeDisplay themeDisplay)
639 throws PortalException, SystemException {
640
641 return getPortal().getLayoutURL(layout, themeDisplay);
642 }
643
644 public static String getLayoutURL(
645 Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
646 throws PortalException, SystemException {
647
648 return getPortal().getLayoutURL(layout, themeDisplay, doAsUser);
649 }
650
651 public static String getLayoutURL(ThemeDisplay themeDisplay)
652 throws PortalException, SystemException {
653
654 return getPortal().getLayoutURL(themeDisplay);
655 }
656
657 public static String getLayoutViewPage(Layout layout) {
658 return getPortal().getLayoutViewPage(layout);
659 }
660
661 public static String getLayoutViewPage(String type) {
662 return getPortal().getLayoutViewPage(type);
663 }
664
665 public static LiferayPortletRequest getLiferayPortletRequest(
666 PortletRequest portletRequest) {
667
668 return getPortal().getLiferayPortletRequest(portletRequest);
669 }
670
671 public static LiferayPortletResponse getLiferayPortletResponse(
672 PortletResponse portletResponse) {
673
674 return getPortal().getLiferayPortletResponse(portletResponse);
675 }
676
677 public static Locale getLocale(HttpServletRequest request) {
678 return getPortal().getLocale(request);
679 }
680
681 public static Locale getLocale(RenderRequest renderRequest) {
682 return getPortal().getLocale(renderRequest);
683 }
684
685 public static String getMailId(
686 String mx, String popPortletPrefix, Object... ids) {
687
688 return getPortal().getMailId(mx, popPortletPrefix, ids);
689 }
690
691
694 public static BaseModel<?> getModel(Resource resource)
695 throws PortalException, SystemException {
696
697 return getPortal().getBaseModel(resource);
698 }
699
700
703 public static BaseModel<?> getModel(ResourcePermission resourcePermission)
704 throws PortalException, SystemException {
705
706 return getPortal().getBaseModel(resourcePermission);
707 }
708
709
712 public static BaseModel<?> getModel(String modelName, String primKey)
713 throws PortalException, SystemException {
714
715 return getPortal().getBaseModel(modelName, primKey);
716 }
717
718 public static String getNetvibesURL(
719 Portlet portlet, ThemeDisplay themeDisplay)
720 throws PortalException, SystemException {
721
722 return getPortal().getNetvibesURL(portlet, themeDisplay);
723 }
724
725 public static String getNewPortletTitle(
726 String portletTitle, String oldScopeName, String newScopeName) {
727
728 return getPortal().getNewPortletTitle(
729 portletTitle, oldScopeName, newScopeName);
730 }
731
732 public static HttpServletRequest getOriginalServletRequest(
733 HttpServletRequest request) {
734
735 return getPortal().getOriginalServletRequest(request);
736 }
737
738 public static String getOuterPortletId(HttpServletRequest request) {
739 return getPortal().getOuterPortletId(request);
740 }
741
742 public static long getParentGroupId(long scopeGroupId)
743 throws PortalException, SystemException {
744
745 return getPortal().getParentGroupId(scopeGroupId);
746 }
747
748 public static String getPathContext() {
749 return getPortal().getPathContext();
750 }
751
752 public static String getPathFriendlyURLPrivateGroup() {
753 return getPortal().getPathFriendlyURLPrivateGroup();
754 }
755
756 public static String getPathFriendlyURLPrivateUser() {
757 return getPortal().getPathFriendlyURLPrivateUser();
758 }
759
760 public static String getPathFriendlyURLPublic() {
761 return getPortal().getPathFriendlyURLPublic();
762 }
763
764 public static String getPathImage() {
765 return getPortal().getPathImage();
766 }
767
768 public static String getPathMain() {
769 return getPortal().getPathMain();
770 }
771
772 public static String getPathProxy() {
773 return getPortal().getPathProxy();
774 }
775
776 public static long getPlidFromFriendlyURL(
777 long companyId, String friendlyURL) {
778
779 return getPortal().getPlidFromFriendlyURL(companyId, friendlyURL);
780 }
781
782 public static long getPlidFromPortletId(
783 long groupId, boolean privateLayout, String portletId)
784 throws PortalException, SystemException {
785
786 return getPortal().getPlidFromPortletId(
787 groupId, privateLayout, portletId);
788 }
789
790 public static long getPlidFromPortletId(long groupId, String portletId)
791 throws PortalException, SystemException {
792
793 return getPortal().getPlidFromPortletId(groupId, portletId);
794 }
795
796 public static Portal getPortal() {
797 return _portal;
798 }
799
800 public static String getPortalLibDir() {
801 return getPortal().getPortalLibDir();
802 }
803
804
807 public static int getPortalPort() {
808 return getPortal().getPortalPort();
809 }
810
811 public static int getPortalPort(boolean secure) {
812 return getPortal().getPortalPort(secure);
813 }
814
815 public static Properties getPortalProperties() {
816 return getPortal().getPortalProperties();
817 }
818
819 public static String getPortalURL(HttpServletRequest request) {
820 return getPortal().getPortalURL(request);
821 }
822
823 public static String getPortalURL(
824 HttpServletRequest request, boolean secure) {
825
826 return getPortal().getPortalURL(request, secure);
827 }
828
829 public static String getPortalURL(PortletRequest portletRequest) {
830 return getPortal().getPortalURL(portletRequest);
831 }
832
833 public static String getPortalURL(
834 PortletRequest portletRequest, boolean secure) {
835
836 return getPortal().getPortalURL(portletRequest, secure);
837 }
838
839 public static String getPortalURL(
840 String serverName, int serverPort, boolean secure) {
841
842 return getPortal().getPortalURL(serverName, serverPort, secure);
843 }
844
845 public static String getPortalURL(Layout layout, ThemeDisplay themeDisplay)
846 throws PortalException, SystemException {
847
848 return getPortal().getPortalURL(layout, themeDisplay);
849 }
850
851 public static String getPortalURL(ThemeDisplay themeDisplay)
852 throws PortalException, SystemException {
853
854 return getPortal().getPortalURL(themeDisplay);
855 }
856
857 public static String getPortalWebDir() {
858 return getPortal().getPortalWebDir();
859 }
860
861 public static Set<String> getPortletAddDefaultResourceCheckWhitelist() {
862 return getPortal().getPortletAddDefaultResourceCheckWhitelist();
863 }
864
865 public static Set<String>
866 getPortletAddDefaultResourceCheckWhitelistActions() {
867
868 return getPortal().getPortletAddDefaultResourceCheckWhitelistActions();
869 }
870
871
874 public static List<BreadcrumbEntry> getPortletBreadcrumbList(
875 HttpServletRequest request) {
876
877 return getPortal().getPortletBreadcrumbList(request);
878 }
879
880 public static List<BreadcrumbEntry> getPortletBreadcrumbs(
881 HttpServletRequest request) {
882
883 return getPortal().getPortletBreadcrumbs(request);
884 }
885
886 public static String getPortletDescription(
887 Portlet portlet, ServletContext servletContext, Locale locale) {
888
889 return getPortal().getPortletDescription(
890 portlet, servletContext, locale);
891 }
892
893 public static String getPortletDescription(Portlet portlet, User user) {
894 return getPortal().getPortletDescription(portlet, user);
895 }
896
897 public static String getPortletDescription(
898 String portletId, Locale locale) {
899
900 return getPortal().getPortletDescription(portletId, locale);
901 }
902
903 public static String getPortletDescription(
904 String portletId, String languageId) {
905
906 return getPortal().getPortletDescription(portletId, languageId);
907 }
908
909 public static String getPortletDescription(String portletId, User user) {
910 return getPortal().getPortletDescription(portletId, user);
911 }
912
913 public static String getPortletId(HttpServletRequest request) {
914 return getPortal().getPortletId(request);
915 }
916
917 public static String getPortletId(PortletRequest portletRequest) {
918 return getPortal().getPortletId(portletRequest);
919 }
920
921 public static String getPortletNamespace(String portletId) {
922 return getPortal().getPortletNamespace(portletId);
923 }
924
925 public static String getPortletTitle(Portlet portlet, Locale locale) {
926 return getPortal().getPortletTitle(portlet, locale);
927 }
928
929 public static String getPortletTitle(
930 Portlet portlet, ServletContext servletContext, Locale locale) {
931
932 return getPortal().getPortletTitle(portlet, servletContext, locale);
933 }
934
935 public static String getPortletTitle(Portlet portlet, String languageId) {
936 return getPortal().getPortletTitle(portlet, languageId);
937 }
938
939 public static String getPortletTitle(Portlet portlet, User user) {
940 return getPortal().getPortletTitle(portlet, user);
941 }
942
943 public static String getPortletTitle(RenderResponse renderResponse) {
944 return getPortal().getPortletTitle(renderResponse);
945 }
946
947 public static String getPortletTitle(String portletId, Locale locale) {
948 return getPortal().getPortletTitle(portletId, locale);
949 }
950
951 public static String getPortletTitle(String portletId, String languageId) {
952 return getPortal().getPortletTitle(portletId, languageId);
953 }
954
955 public static String getPortletTitle(String portletId, User user) {
956 return getPortal().getPortletTitle(portletId, user);
957 }
958
959 public static String getPortletXmlFileName() throws SystemException {
960 return getPortal().getPortletXmlFileName();
961 }
962
963 public static PortletPreferences getPreferences(
964 HttpServletRequest request) {
965
966 return getPortal().getPreferences(request);
967 }
968
969 public static PreferencesValidator getPreferencesValidator(
970 Portlet portlet) {
971
972 return getPortal().getPreferencesValidator(portlet);
973 }
974
975 public static String getRelativeHomeURL(HttpServletRequest request)
976 throws PortalException, SystemException {
977
978 return getPortal().getRelativeHomeURL(request);
979 }
980
981 public static long getScopeGroupId(HttpServletRequest request)
982 throws PortalException, SystemException {
983
984 return getPortal().getScopeGroupId(request);
985 }
986
987 public static long getScopeGroupId(
988 HttpServletRequest request, String portletId)
989 throws PortalException, SystemException {
990
991 return getPortal().getScopeGroupId(request, portletId);
992 }
993
994 public static long getScopeGroupId(Layout layout) {
995 return getPortal().getScopeGroupId(layout);
996 }
997
998 public static long getScopeGroupId(Layout layout, String portletId) {
999 return getPortal().getScopeGroupId(layout, portletId);
1000 }
1001
1002 public static long getScopeGroupId(long plid) {
1003 return getPortal().getScopeGroupId(plid);
1004 }
1005
1006 public static long getScopeGroupId(PortletRequest portletRequest)
1007 throws PortalException, SystemException {
1008
1009 return getPortal().getScopeGroupId(portletRequest);
1010 }
1011
1012 public static User getSelectedUser(HttpServletRequest request)
1013 throws PortalException, SystemException {
1014
1015 return getPortal().getSelectedUser(request);
1016 }
1017
1018 public static User getSelectedUser(
1019 HttpServletRequest request, boolean checkPermission)
1020 throws PortalException, SystemException {
1021
1022 return getPortal().getSelectedUser(request, checkPermission);
1023 }
1024
1025 public static User getSelectedUser(PortletRequest portletRequest)
1026 throws PortalException, SystemException {
1027
1028 return getPortal().getSelectedUser(portletRequest);
1029 }
1030
1031 public static User getSelectedUser(
1032 PortletRequest portletRequest, boolean checkPermission)
1033 throws PortalException, SystemException {
1034
1035 return getPortal().getSelectedUser(portletRequest, checkPermission);
1036 }
1037
1038 public static ServletContext getServletContext(
1039 Portlet portlet, ServletContext servletContext) {
1040
1041 return getPortal().getServletContext(portlet, servletContext);
1042 }
1043
1044 public static String getSiteLoginURL(ThemeDisplay themeDisplay)
1045 throws PortalException, SystemException {
1046
1047 return getPortal().getSiteLoginURL(themeDisplay);
1048 }
1049
1050 public static String getStaticResourceURL(
1051 HttpServletRequest request, String uri) {
1052
1053 return getPortal().getStaticResourceURL(request, uri);
1054 }
1055
1056 public static String getStaticResourceURL(
1057 HttpServletRequest request, String uri, long timestamp) {
1058
1059 return getPortal().getStaticResourceURL(request, uri, timestamp);
1060 }
1061
1062 public static String getStaticResourceURL(
1063 HttpServletRequest request, String uri, String queryString) {
1064
1065 return getPortal().getStaticResourceURL(request, uri, queryString);
1066 }
1067
1068 public static String getStaticResourceURL(
1069 HttpServletRequest request, String uri, String queryString,
1070 long timestamp) {
1071
1072 return getPortal().getStaticResourceURL(
1073 request, uri, queryString, timestamp);
1074 }
1075
1076 public static String getStrutsAction(HttpServletRequest request) {
1077 return getPortal().getStrutsAction(request);
1078 }
1079
1080 public static String[] getSystemGroups() {
1081 return getPortal().getSystemGroups();
1082 }
1083
1084 public static String[] getSystemOrganizationRoles() {
1085 return getPortal().getSystemOrganizationRoles();
1086 }
1087
1088 public static String[] getSystemRoles() {
1089 return getPortal().getSystemRoles();
1090 }
1091
1092 public static String[] getSystemSiteRoles() {
1093 return getPortal().getSystemSiteRoles();
1094 }
1095
1096 public static UploadServletRequest getUploadServletRequest(
1097 HttpServletRequest request) {
1098
1099 return getPortal().getUploadServletRequest(request);
1100 }
1101
1102 public static UploadPortletRequest getUploadPortletRequest(
1103 PortletRequest portletRequest) {
1104
1105 return getPortal().getUploadPortletRequest(portletRequest);
1106 }
1107
1108 public static Date getUptime() {
1109 return getPortal().getUptime();
1110 }
1111
1112 public static String getURLWithSessionId(String url, String sessionId) {
1113 return getPortal().getURLWithSessionId(url, sessionId);
1114 }
1115
1116 public static User getUser(HttpServletRequest request)
1117 throws PortalException, SystemException {
1118
1119 return getPortal().getUser(request);
1120 }
1121
1122 public static User getUser(PortletRequest portletRequest)
1123 throws PortalException, SystemException {
1124
1125 return getPortal().getUser(portletRequest);
1126 }
1127
1128 public static String getUserEmailAddress(long userId)
1129 throws SystemException {
1130
1131 return getPortal().getUserEmailAddress(userId);
1132 }
1133
1134 public static long getUserId(HttpServletRequest request) {
1135 return getPortal().getUserId(request);
1136 }
1137
1138 public static long getUserId(PortletRequest portletRequest) {
1139 return getPortal().getUserId(portletRequest);
1140 }
1141
1142 public static String getUserName(long userId, String defaultUserName) {
1143 return getPortal().getUserName(userId, defaultUserName);
1144 }
1145
1146 public static String getUserName(
1147 long userId, String defaultUserName, HttpServletRequest request) {
1148
1149 return getPortal().getUserName(userId, defaultUserName, request);
1150 }
1151
1152 public static String getUserName(
1153 long userId, String defaultUserName, String userAttribute) {
1154
1155 return getPortal().getUserName(userId, defaultUserName, userAttribute);
1156 }
1157
1158 public static String getUserName(
1159 long userId, String defaultUserName, String userAttribute,
1160 HttpServletRequest request) {
1161
1162 return getPortal().getUserName(
1163 userId, defaultUserName, userAttribute, request);
1164 }
1165
1166 public static String getUserPassword(HttpServletRequest request) {
1167 return getPortal().getUserPassword(request);
1168 }
1169
1170 public static String getUserPassword(HttpSession session) {
1171 return getPortal().getUserPassword(session);
1172 }
1173
1174 public static String getUserPassword(PortletRequest portletRequest) {
1175 return getPortal().getUserPassword(portletRequest);
1176 }
1177
1178 public static String getUserValue(
1179 long userId, String param, String defaultValue)
1180 throws SystemException {
1181
1182 return getPortal().getUserValue(userId, param, defaultValue);
1183 }
1184
1185 public static long getValidUserId(long companyId, long userId)
1186 throws PortalException, SystemException {
1187
1188 return getPortal().getValidUserId(companyId, userId);
1189 }
1190
1191 public static String getWidgetURL(
1192 Portlet portlet, ThemeDisplay themeDisplay)
1193 throws PortalException, SystemException {
1194
1195 return getPortal().getWidgetURL(portlet, themeDisplay);
1196 }
1197
1198 public static boolean isAllowAddPortletDefaultResource(
1199 HttpServletRequest request, Portlet portlet)
1200 throws PortalException, SystemException {
1201
1202 return getPortal().isAllowAddPortletDefaultResource(request, portlet);
1203 }
1204
1205
1208 public static boolean isCommunityAdmin(User user, long groupId)
1209 throws Exception {
1210
1211 return getPortal().isCommunityAdmin(user, groupId);
1212 }
1213
1214
1217 public static boolean isCommunityOwner(User user, long groupId)
1218 throws Exception {
1219
1220 return getPortal().isCommunityOwner(user, groupId);
1221 }
1222
1223 public static boolean isCompanyAdmin(User user) throws Exception {
1224 return getPortal().isCompanyAdmin(user);
1225 }
1226
1227 public static boolean isCompanyControlPanelPortlet(
1228 String portletId, String category, ThemeDisplay themeDisplay)
1229 throws PortalException, SystemException {
1230
1231 return getPortal().isCompanyControlPanelPortlet(
1232 portletId, category, themeDisplay);
1233 }
1234
1235 public static boolean isCompanyControlPanelPortlet(
1236 String portletId, ThemeDisplay themeDisplay)
1237 throws PortalException, SystemException {
1238
1239 return getPortal().isCompanyControlPanelPortlet(
1240 portletId, themeDisplay);
1241 }
1242
1243 public static boolean isCompanyControlPanelVisible(
1244 ThemeDisplay themeDisplay)
1245 throws PortalException, SystemException {
1246
1247 return getPortal().isCompanyControlPanelVisible(themeDisplay);
1248 }
1249
1250 public static boolean isControlPanelPortlet(
1251 String portletId, String category, ThemeDisplay themeDisplay)
1252 throws SystemException {
1253
1254 return getPortal().isControlPanelPortlet(
1255 portletId, category, themeDisplay);
1256 }
1257
1258 public static boolean isControlPanelPortlet(
1259 String portletId, ThemeDisplay themeDisplay)
1260 throws SystemException {
1261
1262 return getPortal().isControlPanelPortlet(portletId, themeDisplay);
1263 }
1264
1265 public static boolean isGroupAdmin(User user, long groupId)
1266 throws Exception {
1267
1268 return getPortal().isGroupAdmin(user, groupId);
1269 }
1270
1271 public static boolean isGroupOwner(User user, long groupId)
1272 throws Exception {
1273
1274 return getPortal().isGroupOwner(user, groupId);
1275 }
1276
1277 public static boolean isLayoutDescendant(Layout layout, long layoutId)
1278 throws PortalException, SystemException {
1279
1280 return getPortal().isLayoutDescendant(layout, layoutId);
1281 }
1282
1283 public static boolean isLayoutFirstPageable(Layout layout) {
1284 return getPortal().isLayoutFirstPageable(layout);
1285 }
1286
1287 public static boolean isLayoutFirstPageable(String type) {
1288 return getPortal().isLayoutFirstPageable(type);
1289 }
1290
1291 public static boolean isLayoutFriendliable(Layout layout) {
1292 return getPortal().isLayoutFriendliable(layout);
1293 }
1294
1295 public static boolean isLayoutFriendliable(String type) {
1296 return getPortal().isLayoutFriendliable(type);
1297 }
1298
1299 public static boolean isLayoutParentable(Layout layout) {
1300 return getPortal().isLayoutParentable(layout);
1301 }
1302
1303 public static boolean isLayoutParentable(String type) {
1304 return getPortal().isLayoutParentable(type);
1305 }
1306
1307 public static boolean isLayoutSitemapable(Layout layout) {
1308 return getPortal().isLayoutSitemapable(layout);
1309 }
1310
1311 public static boolean isMethodGet(PortletRequest portletRequest) {
1312 return getPortal().isMethodGet(portletRequest);
1313 }
1314
1315 public static boolean isMethodPost(PortletRequest portletRequest) {
1316 return getPortal().isMethodPost(portletRequest);
1317 }
1318
1319 public static boolean isMultipartRequest(HttpServletRequest request) {
1320 return getPortal().isMultipartRequest(request);
1321 }
1322
1323 public static boolean isOmniadmin(long userId) {
1324 return getPortal().isOmniadmin(userId);
1325 }
1326
1327 public static boolean isReservedParameter(String name) {
1328 return getPortal().isReservedParameter(name);
1329 }
1330
1331 public static boolean isSecure(HttpServletRequest request) {
1332 return getPortal().isSecure(request);
1333 }
1334
1335 public static boolean isSystemGroup(String groupName) {
1336 return getPortal().isSystemGroup(groupName);
1337 }
1338
1339 public static boolean isSystemRole(String roleName) {
1340 return getPortal().isSystemRole(roleName);
1341 }
1342
1343 public static boolean isUpdateAvailable() throws SystemException {
1344 return getPortal().isUpdateAvailable();
1345 }
1346
1347 public static boolean isValidResourceId(String resourceId) {
1348 return getPortal().isValidResourceId(resourceId);
1349 }
1350
1351 public void removePortalPortEventListener(
1352 PortalPortEventListener portalPortEventListener) {
1353
1354 getPortal().removePortalPortEventListener(portalPortEventListener);
1355 }
1356
1357 public static String renderPage(
1358 ServletContext servletContext, HttpServletRequest request,
1359 HttpServletResponse response, String path, boolean writeOutput)
1360 throws IOException, ServletException {
1361
1362 return getPortal().renderPage(servletContext, request, response, path);
1363 }
1364
1365 public static String renderPortlet(
1366 ServletContext servletContext, HttpServletRequest request,
1367 HttpServletResponse response, Portlet portlet, String queryString,
1368 boolean writeOutput)
1369 throws IOException, ServletException {
1370
1371 return getPortal().renderPortlet(
1372 servletContext, request, response, portlet, queryString,
1373 writeOutput);
1374 }
1375
1376 public static String renderPortlet(
1377 ServletContext servletContext, HttpServletRequest request,
1378 HttpServletResponse response, Portlet portlet, String queryString,
1379 String columnId, Integer columnPos, Integer columnCount,
1380 boolean writeOutput)
1381 throws IOException, ServletException {
1382
1383 return getPortal().renderPortlet(
1384 servletContext, request, response, portlet, queryString, columnId,
1385 columnPos, columnCount, writeOutput);
1386 }
1387
1388 public static String renderPortlet(
1389 ServletContext servletContext, HttpServletRequest request,
1390 HttpServletResponse response, Portlet portlet, String queryString,
1391 String columnId, Integer columnPos, Integer columnCount,
1392 String path, boolean writeOutput)
1393 throws IOException, ServletException {
1394
1395 return getPortal().renderPortlet(
1396 servletContext, request, response, portlet, queryString, columnId,
1397 columnPos, columnCount, path, writeOutput);
1398 }
1399
1400 public static void resetCDNHosts() {
1401 getPortal().resetCDNHosts();
1402 }
1403
1404 public static Set<String> resetPortletAddDefaultResourceCheckWhitelist() {
1405 return getPortal().resetPortletAddDefaultResourceCheckWhitelist();
1406 }
1407
1408 public static Set<String>
1409 resetPortletAddDefaultResourceCheckWhitelistActions() {
1410
1411 return getPortal().
1412 resetPortletAddDefaultResourceCheckWhitelistActions();
1413 }
1414
1415
1418 public static void runSQL(String sql) throws IOException, SQLException {
1419 DBFactoryUtil.getDB().runSQL(sql);
1420 }
1421
1422 public static void sendError(
1423 Exception e, ActionRequest actionRequest,
1424 ActionResponse actionResponse)
1425 throws IOException {
1426
1427 getPortal().sendError(e, actionRequest, actionResponse);
1428 }
1429
1430 public static void sendError(
1431 Exception e, HttpServletRequest request,
1432 HttpServletResponse response)
1433 throws IOException, ServletException {
1434
1435 getPortal().sendError(e, request, response);
1436 }
1437
1438 public static void sendError(
1439 int status, Exception e, ActionRequest actionRequest,
1440 ActionResponse actionResponse)
1441 throws IOException {
1442
1443 getPortal().sendError(status, e, actionRequest, actionResponse);
1444 }
1445
1446 public static void sendError(
1447 int status, Exception e, HttpServletRequest request,
1448 HttpServletResponse response)
1449 throws IOException, ServletException {
1450
1451 getPortal().sendError(status, e, request, response);
1452 }
1453
1454
1458 public static void setPageDescription(
1459 String description, HttpServletRequest request) {
1460
1461 getPortal().setPageDescription(description, request);
1462 }
1463
1464
1467 public static void setPageKeywords(
1468 String keywords, HttpServletRequest request) {
1469
1470 getPortal().setPageKeywords(keywords, request);
1471 }
1472
1473
1476 public static void setPageSubtitle(
1477 String subtitle, HttpServletRequest request) {
1478
1479 getPortal().setPageSubtitle(subtitle, request);
1480 }
1481
1482
1486 public static void setPageTitle(
1487 String title, HttpServletRequest request) {
1488
1489 getPortal().setPageTitle(title, request);
1490 }
1491
1492
1495 public static void setPortalPort(HttpServletRequest request) {
1496 getPortal().setPortalPort(request);
1497 }
1498
1499 public static void storePreferences(PortletPreferences portletPreferences)
1500 throws IOException, ValidatorException {
1501
1502 getPortal().storePreferences(portletPreferences);
1503 }
1504
1505 public static String[] stripURLAnchor(String url, String separator) {
1506 return getPortal().stripURLAnchor(url, separator);
1507 }
1508
1509 public static String transformCustomSQL(String sql) {
1510 return getPortal().transformCustomSQL(sql);
1511 }
1512
1513 public static PortletMode updatePortletMode(
1514 String portletId, User user, Layout layout, PortletMode portletMode,
1515 HttpServletRequest request) {
1516
1517 return getPortal().updatePortletMode(
1518 portletId, user, layout, portletMode, request);
1519 }
1520
1521 public static String updateRedirect(
1522 String redirect, String oldPath, String newPath) {
1523
1524 return getPortal().updateRedirect(redirect, oldPath, newPath);
1525 }
1526
1527 public static WindowState updateWindowState(
1528 String portletId, User user, Layout layout, WindowState windowState,
1529 HttpServletRequest request) {
1530
1531 return getPortal().updateWindowState(
1532 portletId, user, layout, windowState, request);
1533 }
1534
1535 public void setPortal(Portal portal) {
1536 _portal = portal;
1537 }
1538
1539 private static Portal _portal;
1540
1541 }