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