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