001
014
015 package com.liferay.portal.util;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
020 import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
021 import com.liferay.portal.kernel.upload.UploadPortletRequest;
022 import com.liferay.portal.kernel.upload.UploadServletRequest;
023 import com.liferay.portal.kernel.util.KeyValuePair;
024 import com.liferay.portal.model.BaseModel;
025 import com.liferay.portal.model.Company;
026 import com.liferay.portal.model.Group;
027 import com.liferay.portal.model.Layout;
028 import com.liferay.portal.model.LayoutSet;
029 import com.liferay.portal.model.Portlet;
030 import com.liferay.portal.model.Resource;
031 import com.liferay.portal.model.ResourcePermission;
032 import com.liferay.portal.model.User;
033 import com.liferay.portal.theme.ThemeDisplay;
034 import com.liferay.portlet.expando.model.ExpandoBridge;
035
036 import java.io.IOException;
037 import java.io.Serializable;
038
039 import java.util.Date;
040 import java.util.List;
041 import java.util.Locale;
042 import java.util.Map;
043 import java.util.Properties;
044 import java.util.Set;
045 import java.util.TimeZone;
046
047 import javax.portlet.ActionRequest;
048 import javax.portlet.ActionResponse;
049 import javax.portlet.PortletMode;
050 import javax.portlet.PortletPreferences;
051 import javax.portlet.PortletRequest;
052 import javax.portlet.PortletResponse;
053 import javax.portlet.PreferencesValidator;
054 import javax.portlet.RenderRequest;
055 import javax.portlet.RenderResponse;
056 import javax.portlet.ValidatorException;
057 import javax.portlet.WindowState;
058
059 import javax.servlet.ServletContext;
060 import javax.servlet.ServletException;
061 import javax.servlet.http.HttpServletRequest;
062 import javax.servlet.http.HttpServletResponse;
063 import javax.servlet.http.HttpSession;
064 import javax.servlet.jsp.PageContext;
065
066
070 public interface Portal {
071
072 public static final String FRIENDLY_URL_SEPARATOR = "/-/";
073
074 public static final String PATH_IMAGE = "/image";
075
076 public static final String PATH_MAIN = "/c";
077
078 public static final String PATH_PORTAL_LAYOUT = "/portal/layout";
079
080 public static final String PORTAL_REALM = "PortalRealm";
081
082 public static final String PORTLET_XML_FILE_NAME_CUSTOM =
083 "portlet-custom.xml";
084
085 public static final String PORTLET_XML_FILE_NAME_STANDARD = "portlet.xml";
086
087 public static final String TEMP_OBFUSCATION_VALUE =
088 "TEMP_OBFUSCATION_VALUE";
089
090
097 public void addPageDescription(
098 String description, HttpServletRequest request);
099
100
107 public void addPageKeywords(String keywords, HttpServletRequest request);
108
109
115 public void addPageSubtitle(String subtitle, HttpServletRequest request);
116
117
123 public void addPageTitle(String title, HttpServletRequest request);
124
125
131 public void addPortalPortEventListener(
132 PortalPortEventListener portalPortEventListener);
133
134
141 public void addPortletBreadcrumbEntry(
142 HttpServletRequest request, String title, String url);
143
144
152 public void addPortletDefaultResource(
153 HttpServletRequest request, Portlet portlet)
154 throws PortalException, SystemException;
155
156
173 public String addPreservedParameters(
174 ThemeDisplay themeDisplay, Layout layout, String url, boolean doAsUser);
175
176
184 public String addPreservedParameters(
185 ThemeDisplay themeDisplay, String url);
186
187
193 public void clearRequestParameters(RenderRequest renderRequest);
194
195
202 public void copyRequestParameters(
203 ActionRequest actionRequest, ActionResponse actionResponse);
204
205
213 public String escapeRedirect(String url);
214
215
222 public String generateRandomKey(HttpServletRequest request, String input);
223
224
231 public Set<String> getAuthTokenIgnoreActions();
232
233
240 public Set<String> getAuthTokenIgnorePortlets();
241
242
252 public BaseModel<?> getBaseModel(Resource resource)
253 throws PortalException, SystemException;
254
255
267 public BaseModel<?> getBaseModel(ResourcePermission resourcePermission)
268 throws PortalException, SystemException;
269
270
281 public BaseModel<?> getBaseModel(String modelName, String primKey)
282 throws PortalException, SystemException;
283
284
295 public long getBasicAuthUserId(HttpServletRequest request)
296 throws PortalException, SystemException;
297
298
310 public long getBasicAuthUserId(HttpServletRequest request, long companyId)
311 throws PortalException, SystemException;
312
313
316 public String getCDNHost();
317
318
325 public String getCDNHost(boolean secure);
326
327
332 public String getCDNHostHttp();
333
334
339 public String getCDNHostHttps();
340
341
347 public String getClassName(long classNameId);
348
349
355 public long getClassNameId(Class<?> clazz);
356
357
363 public long getClassNameId(String value);
364
365
375 public String getClassNamePortletId(String className);
376
377
387 public String getCommunityLoginURL(ThemeDisplay themeDisplay)
388 throws PortalException, SystemException;
389
390 public String[] getCommunityPermissions(HttpServletRequest request);
391
392 public String[] getCommunityPermissions(PortletRequest portletRequest);
393
394 public Company getCompany(HttpServletRequest request)
395 throws PortalException, SystemException;
396
397 public Company getCompany(PortletRequest portletRequest)
398 throws PortalException, SystemException;
399
400 public long getCompanyId(HttpServletRequest requestuest);
401
402 public long getCompanyId(PortletRequest portletRequest);
403
404 public long[] getCompanyIds();
405
406 public String getComputerAddress();
407
408 public String getComputerName();
409
410 public String getControlPanelCategory(
411 String portletId, ThemeDisplay themeDisplay)
412 throws SystemException;
413
414 public String getControlPanelFullURL(
415 long scopeGroupId, String ppid, Map<String, String[]> params)
416 throws PortalException, SystemException;
417
418 public List<Portlet> getControlPanelPortlets(
419 String category, ThemeDisplay themeDisplay)
420 throws SystemException;
421
422 public String getCurrentCompleteURL(HttpServletRequest request);
423
424 public String getCurrentURL(HttpServletRequest request);
425
426 public String getCurrentURL(PortletRequest portletRequest);
427
428 public String getCustomSQLFunctionIsNotNull();
429
430 public String getCustomSQLFunctionIsNull();
431
432
440 public Date getDate(int month, int day, int year);
441
442
459 public Date getDate(
460 int month, int day, int year, int hour, int min, PortalException pe)
461 throws PortalException;
462
463
481 public Date getDate(
482 int month, int day, int year, int hour, int min, TimeZone timeZone,
483 PortalException pe)
484 throws PortalException;
485
486
501 public Date getDate(int month, int day, int year, PortalException pe)
502 throws PortalException;
503
504
520 public Date getDate(
521 int month, int day, int year, TimeZone timeZone, PortalException pe)
522 throws PortalException;
523
524 public long getDefaultCompanyId();
525
526 public long getDigestAuthUserId(HttpServletRequest request)
527 throws PortalException, SystemException;
528
529 public Map<String, Serializable> getExpandoBridgeAttributes(
530 ExpandoBridge expandoBridge, PortletRequest portletRequest)
531 throws PortalException, SystemException;
532
533 public Serializable getExpandoValue(
534 PortletRequest portletRequest, String name, int type,
535 String displayType)
536 throws PortalException, SystemException;
537
538 public String getFacebookURL(
539 Portlet portlet, String facebookCanvasPageURL,
540 ThemeDisplay themeDisplay)
541 throws PortalException, SystemException;
542
543 public String getFirstPageLayoutTypes(PageContext pageContext);
544
545 public String getGlobalLibDir();
546
547 public String getGoogleGadgetURL(
548 Portlet portlet, ThemeDisplay themeDisplay)
549 throws PortalException, SystemException;
550
551 public String getGroupFriendlyURL(
552 Group group, boolean privateLayoutSet, ThemeDisplay themeDisplay)
553 throws PortalException, SystemException;
554
555 public String[] getGuestPermissions(HttpServletRequest request);
556
557 public String[] getGuestPermissions(PortletRequest portletRequest);
558
559 public String getHomeURL(HttpServletRequest request)
560 throws PortalException, SystemException;
561
562 public String getHost(HttpServletRequest request);
563
564 public String getHost(PortletRequest portletRequest);
565
566 public HttpServletRequest getHttpServletRequest(
567 PortletRequest portletRequest);
568
569 public HttpServletResponse getHttpServletResponse(
570 PortletResponse portletResponse);
571
572 public String getJsSafePortletId(String portletId) ;
573
574 public String getLayoutActualURL(Layout layout);
575
576 public String getLayoutActualURL(Layout layout, String mainPath);
577
578 public String getLayoutActualURL(
579 long groupId, boolean privateLayout, String mainPath,
580 String friendlyURL)
581 throws PortalException, SystemException;
582
583 public String getLayoutActualURL(
584 long groupId, boolean privateLayout, String mainPath,
585 String friendlyURL, Map<String, String[]> params,
586 Map<String, Object> requestContext)
587 throws PortalException, SystemException;
588
589 public String getLayoutEditPage(Layout layout);
590
591 public String getLayoutEditPage(String type);
592
593 public String getLayoutFriendlyURL(
594 Layout layout, ThemeDisplay themeDisplay)
595 throws PortalException, SystemException;
596
597 public String getLayoutFriendlyURL(
598 Layout layout, ThemeDisplay themeDisplay, Locale locale)
599 throws PortalException, SystemException;
600
601 public String getLayoutFullURL(Layout layout, ThemeDisplay themeDisplay)
602 throws PortalException, SystemException;
603
604 public String getLayoutFullURL(
605 Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
606 throws PortalException, SystemException;
607
608 public String getLayoutFullURL(long groupId, String portletId)
609 throws PortalException, SystemException;
610
611 public String getLayoutFullURL(
612 long groupId, String portletId, boolean secure)
613 throws PortalException, SystemException;
614
615 public String getLayoutFullURL(ThemeDisplay themeDisplay)
616 throws PortalException, SystemException;
617
618 public String getLayoutSetFriendlyURL(
619 LayoutSet layoutSet, ThemeDisplay themeDisplay)
620 throws PortalException, SystemException;
621
622 public String getLayoutTarget(Layout layout);
623
624 public String getLayoutURL(Layout layout, ThemeDisplay themeDisplay)
625 throws PortalException, SystemException;
626
627 public String getLayoutURL(
628 Layout layout, ThemeDisplay themeDisplay, boolean doAsUser)
629 throws PortalException, SystemException;
630
631 public String getLayoutURL(ThemeDisplay themeDisplay)
632 throws PortalException, SystemException;
633
634 public String getLayoutViewPage(Layout layout);
635
636 public String getLayoutViewPage(String type);
637
638 public LiferayPortletRequest getLiferayPortletRequest(
639 PortletRequest portletRequest);
640
641 public LiferayPortletResponse getLiferayPortletResponse(
642 PortletResponse portletResponse);
643
644 public Locale getLocale(HttpServletRequest request);
645
646 public Locale getLocale(RenderRequest renderRequest);
647
648 public String getMailId(String mx, String popPortletPrefix, Object... ids);
649
650 public String getNetvibesURL(Portlet portlet, ThemeDisplay themeDisplay)
651 throws PortalException, SystemException;
652
653 public String getNewPortletTitle(
654 String portletTitle, String oldScopeName, String newScopeName);
655
656 public HttpServletRequest getOriginalServletRequest(
657 HttpServletRequest request);
658
659 public String getOuterPortletId(HttpServletRequest request);
660
661 public long getParentGroupId(long scopeGroupId)
662 throws PortalException, SystemException;
663
664 public String getPathContext();
665
666 public String getPathFriendlyURLPrivateGroup();
667
668 public String getPathFriendlyURLPrivateUser();
669
670 public String getPathFriendlyURLPublic();
671
672 public String getPathImage();
673
674 public String getPathMain();
675
676 public String getPathProxy();
677
678 public long getPlidFromFriendlyURL(long companyId, String friendlyURL);
679
680 public long getPlidFromPortletId(
681 long groupId, boolean privateLayout, String portletId)
682 throws PortalException, SystemException;
683
684 public long getPlidFromPortletId(long groupId, String portletId)
685 throws PortalException, SystemException;
686
687 public String getPortalLibDir();
688
689
692 public int getPortalPort();
693
694 public int getPortalPort(boolean secure);
695
696 public Properties getPortalProperties();
697
698 public String getPortalURL(HttpServletRequest request);
699
700 public String getPortalURL(HttpServletRequest request, boolean secure);
701
702 public String getPortalURL(PortletRequest portletRequest);
703
704 public String getPortalURL(PortletRequest portletRequest, boolean secure);
705
706 public String getPortalURL(
707 String serverName, int serverPort, boolean secure);
708
709 public String getPortalURL(ThemeDisplay themeDisplay)
710 throws PortalException, SystemException;
711
712 public String getPortalWebDir();
713
714 public Set<String> getPortletAddDefaultResourceCheckWhitelist();
715
716
719 public List<KeyValuePair> getPortletBreadcrumbList(
720 HttpServletRequest request);
721
722 public List<KeyValuePair> getPortletBreadcrumbs(HttpServletRequest request);
723
724 public String getPortletDescription(
725 Portlet portlet, ServletContext servletContext, Locale locale);
726
727 public String getPortletDescription(Portlet portlet, User user);
728
729 public String getPortletDescription(String portletId, Locale locale);
730
731 public String getPortletDescription(String portletId, String languageId);
732
733 public String getPortletDescription(String portletId, User user);
734
735 public String getPortletId(HttpServletRequest request);
736
737 public String getPortletId(PortletRequest portletRequest);
738
739 public String getPortletNamespace(String portletId);
740
741 public String getPortletTitle(Portlet portlet, Locale locale);
742
743 public String getPortletTitle(
744 Portlet portlet, ServletContext servletContext, Locale locale);
745
746 public String getPortletTitle(Portlet portlet, String languageId);
747
748 public String getPortletTitle(Portlet portlet, User user);
749
750 public String getPortletTitle(RenderResponse renderResponse);
751
752 public String getPortletTitle(String portletId, Locale locale);
753
754 public String getPortletTitle(String portletId, String languageId);
755
756 public String getPortletTitle(String portletId, User user);
757
758 public String getPortletXmlFileName() throws SystemException;
759
760 public PortletPreferences getPreferences(HttpServletRequest request);
761
762 public PreferencesValidator getPreferencesValidator(
763 Portlet portlet);
764
765 public String getRelativeHomeURL(HttpServletRequest request)
766 throws PortalException, SystemException;
767
768 public long getScopeGroupId(HttpServletRequest request)
769 throws PortalException, SystemException;
770
771 public long getScopeGroupId(HttpServletRequest request, String portletId)
772 throws PortalException, SystemException;
773
774 public long getScopeGroupId(Layout layout);
775
776 public long getScopeGroupId(Layout layout, String portletId);
777
778 public long getScopeGroupId(long plid);
779
780 public long getScopeGroupId(PortletRequest portletRequest)
781 throws PortalException, SystemException;
782
783 public User getSelectedUser(HttpServletRequest request)
784 throws PortalException, SystemException;
785
786 public User getSelectedUser(
787 HttpServletRequest request, boolean checkPermission)
788 throws PortalException, SystemException;
789
790 public User getSelectedUser(PortletRequest portletRequest)
791 throws PortalException, SystemException;
792
793 public User getSelectedUser(
794 PortletRequest portletRequest, boolean checkPermission)
795 throws PortalException, SystemException;
796
797 public ServletContext getServletContext(
798 Portlet portlet, ServletContext servletContext);
799
800 public String getStaticResourceURL(
801 HttpServletRequest request, String uri);
802
803 public String getStaticResourceURL(
804 HttpServletRequest request, String uri, long timestamp);
805
806 public String getStaticResourceURL(
807 HttpServletRequest request, String uri, String queryString);
808
809 public String getStaticResourceURL(
810 HttpServletRequest request, String uri, String queryString,
811 long timestamp);
812
813 public String getStrutsAction(HttpServletRequest request);
814
815 public String[] getSystemCommunityRoles();
816
817 public String[] getSystemGroups();
818
819 public String[] getSystemOrganizationRoles();
820
821 public String[] getSystemRoles();
822
823 public UploadServletRequest getUploadServletRequest(
824 HttpServletRequest request);
825
826 public UploadPortletRequest getUploadPortletRequest(
827 PortletRequest portletRequest);
828
829 public Date getUptime();
830
831 public String getURLWithSessionId(String url, String sessionId);
832
833 public User getUser(HttpServletRequest request)
834 throws PortalException, SystemException;
835
836 public User getUser(PortletRequest portletRequest)
837 throws PortalException, SystemException;
838
839 public String getUserEmailAddress(long userId) throws SystemException;
840
841 public long getUserId(HttpServletRequest request);
842
843 public long getUserId(PortletRequest portletRequest);
844
845 public String getUserName(long userId, String defaultUserName);
846
847 public String getUserName(
848 long userId, String defaultUserName, HttpServletRequest request);
849
850 public String getUserName(
851 long userId, String defaultUserName, String userAttribute);
852
853 public String getUserName(
854 long userId, String defaultUserName, String userAttribute,
855 HttpServletRequest request);
856
857 public String getUserPassword(HttpServletRequest request);
858
859 public String getUserPassword(HttpSession session);
860
861 public String getUserPassword(PortletRequest portletRequest);
862
863 public String getUserValue(long userId, String param, String defaultValue)
864 throws SystemException;
865
866 public long getValidUserId(long companyId, long userId)
867 throws PortalException, SystemException;
868
869 public String getWidgetURL(Portlet portlet, ThemeDisplay themeDisplay)
870 throws PortalException, SystemException;
871
872 public boolean isAllowAddPortletDefaultResource(
873 HttpServletRequest request, Portlet portlet)
874 throws PortalException, SystemException;
875
876 public boolean isCommunityAdmin(User user, long groupId) throws Exception;
877
878 public boolean isCommunityOwner(User user, long groupId) throws Exception;
879
880 public boolean isCompanyAdmin(User user) throws Exception;
881
882 public boolean isCompanyControlPanelPortlet(
883 String portletId, String category, ThemeDisplay themeDisplay)
884 throws PortalException, SystemException;
885
886 public boolean isCompanyControlPanelPortlet(
887 String portletId, ThemeDisplay themeDisplay)
888 throws PortalException, SystemException;
889
890 public boolean isCompanyControlPanelVisible(ThemeDisplay themeDisplay)
891 throws PortalException, SystemException;
892
893 public boolean isControlPanelPortlet(
894 String portletId, String category, ThemeDisplay themeDisplay)
895 throws SystemException;
896
897 public boolean isControlPanelPortlet(
898 String portletId, ThemeDisplay themeDisplay)
899 throws SystemException;
900
901 public boolean isLayoutDescendant(Layout layout, long layoutId)
902 throws PortalException, SystemException;
903
904 public boolean isLayoutFirstPageable(Layout layout);
905
906 public boolean isLayoutFirstPageable(String type);
907
908 public boolean isLayoutFriendliable(Layout layout);
909
910 public boolean isLayoutFriendliable(String type);
911
912 public boolean isLayoutParentable(Layout layout);
913
914 public boolean isLayoutParentable(String type);
915
916 public boolean isLayoutSitemapable(Layout layout);
917
918 public boolean isMethodGet(PortletRequest portletRequest);
919
920 public boolean isMethodPost(PortletRequest portletRequest);
921
922 public boolean isMultipartRequest(HttpServletRequest request);
923
924 public boolean isOmniadmin(long userId);
925
926 public boolean isReservedParameter(String name);
927
928 public boolean isSecure(HttpServletRequest request);
929
930 public boolean isSystemGroup(String groupName);
931
932 public boolean isSystemRole(String roleName);
933
934 public boolean isUpdateAvailable() throws SystemException;
935
936 public boolean isValidResourceId(String resourceId);
937
938 public void removePortalPortEventListener(
939 PortalPortEventListener portalPortEventListener);
940
941 public String renderPage(
942 ServletContext servletContext, HttpServletRequest request,
943 HttpServletResponse response, String path)
944 throws IOException, ServletException;
945
946 public String renderPortlet(
947 ServletContext servletContext, HttpServletRequest request,
948 HttpServletResponse response, Portlet portlet, String queryString,
949 boolean writeOutput)
950 throws IOException, ServletException;
951
952 public String renderPortlet(
953 ServletContext servletContext, HttpServletRequest request,
954 HttpServletResponse response, Portlet portlet, String queryString,
955 String columnId, Integer columnPos, Integer columnCount,
956 boolean writeOutput)
957 throws IOException, ServletException;
958
959 public String renderPortlet(
960 ServletContext servletContext, HttpServletRequest request,
961 HttpServletResponse response, Portlet portlet, String queryString,
962 String columnId, Integer columnPos, Integer columnCount,
963 String path, boolean writeOutput)
964 throws IOException, ServletException;
965
966 public void sendError(
967 Exception e, ActionRequest actionRequest,
968 ActionResponse actionResponse)
969 throws IOException;
970
971 public void sendError(
972 Exception e, HttpServletRequest request,
973 HttpServletResponse response)
974 throws IOException, ServletException;
975
976 public void sendError(
977 int status, Exception e, ActionRequest actionRequest,
978 ActionResponse actionResponse)
979 throws IOException;
980
981 public void sendError(
982 int status, Exception e, HttpServletRequest request,
983 HttpServletResponse response)
984 throws IOException, ServletException;
985
986
990 public void setPageDescription(
991 String description, HttpServletRequest request);
992
993
996 public void setPageKeywords(String keywords, HttpServletRequest request);
997
998
1001 public void setPageSubtitle(String subtitle, HttpServletRequest request);
1002
1003
1007 public void setPageTitle(String title, HttpServletRequest request);
1008
1009
1012 public void setPortalPort(HttpServletRequest request);
1013
1014 public void storePreferences(PortletPreferences portletPreferences)
1015 throws IOException, ValidatorException;
1016
1017 public String[] stripURLAnchor(String url, String separator);
1018
1019 public String transformCustomSQL(String sql);
1020
1021 public PortletMode updatePortletMode(
1022 String portletId, User user, Layout layout, PortletMode portletMode,
1023 HttpServletRequest request);
1024
1025 public WindowState updateWindowState(
1026 String portletId, User user, Layout layout, WindowState windowState,
1027 HttpServletRequest request);
1028
1029 }