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