1
22
23 package com.liferay.portal.model.impl;
24
25 import com.liferay.portal.kernel.job.Scheduler;
26 import com.liferay.portal.kernel.log.Log;
27 import com.liferay.portal.kernel.log.LogFactoryUtil;
28 import com.liferay.portal.kernel.plugin.PluginPackage;
29 import com.liferay.portal.kernel.poller.PollerProcessor;
30 import com.liferay.portal.kernel.pop.MessageListener;
31 import com.liferay.portal.kernel.portlet.ConfigurationAction;
32 import com.liferay.portal.kernel.portlet.FriendlyURLMapper;
33 import com.liferay.portal.kernel.portlet.PortletBag;
34 import com.liferay.portal.kernel.portlet.PortletBagPool;
35 import com.liferay.portal.kernel.portlet.PortletLayoutListener;
36 import com.liferay.portal.kernel.search.Indexer;
37 import com.liferay.portal.kernel.search.OpenSearch;
38 import com.liferay.portal.kernel.servlet.URLEncoder;
39 import com.liferay.portal.kernel.util.ContentTypes;
40 import com.liferay.portal.kernel.util.InstancePool;
41 import com.liferay.portal.kernel.util.StringPool;
42 import com.liferay.portal.kernel.util.StringUtil;
43 import com.liferay.portal.kernel.util.Validator;
44 import com.liferay.portal.kernel.xml.QName;
45 import com.liferay.portal.lar.PortletDataHandler;
46 import com.liferay.portal.model.Plugin;
47 import com.liferay.portal.model.PluginSetting;
48 import com.liferay.portal.model.Portlet;
49 import com.liferay.portal.model.PortletApp;
50 import com.liferay.portal.model.PortletConstants;
51 import com.liferay.portal.model.PortletFilter;
52 import com.liferay.portal.model.PortletInfo;
53 import com.liferay.portal.model.PublicRenderParameter;
54 import com.liferay.portal.model.RoleConstants;
55 import com.liferay.portal.model.User;
56 import com.liferay.portal.service.RoleLocalServiceUtil;
57 import com.liferay.portal.service.UserLocalServiceUtil;
58 import com.liferay.portal.util.PortalUtil;
59 import com.liferay.portal.util.PropsValues;
60 import com.liferay.portal.webdav.WebDAVStorage;
61 import com.liferay.portlet.ControlPanelEntry;
62 import com.liferay.portlet.PortletBagImpl;
63 import com.liferay.portlet.PortletQNameUtil;
64 import com.liferay.portlet.social.model.SocialActivityInterpreter;
65 import com.liferay.portlet.social.model.SocialRequestInterpreter;
66
67 import java.util.ArrayList;
68 import java.util.Arrays;
69 import java.util.HashMap;
70 import java.util.HashSet;
71 import java.util.Hashtable;
72 import java.util.Iterator;
73 import java.util.LinkedHashMap;
74 import java.util.List;
75 import java.util.Map;
76 import java.util.Set;
77 import java.util.TreeSet;
78
79 import javax.portlet.PortletMode;
80 import javax.portlet.WindowState;
81
82
87 public class PortletImpl extends PortletModelImpl implements Portlet {
88
89
92 public PortletImpl() {
93 }
94
95
98 public PortletImpl(long companyId, String portletId) {
99 setCompanyId(companyId);
100 setPortletId(portletId);
101 setStrutsPath(portletId);
102 setActive(true);
103 _headerPortalCss = new ArrayList<String>();
104 _headerPortletCss = new ArrayList<String>();
105 _headerPortalJavaScript = new ArrayList<String>();
106 _headerPortletJavaScript = new ArrayList<String>();
107 _footerPortalCss = new ArrayList<String>();
108 _footerPortletCss = new ArrayList<String>();
109 _footerPortalJavaScript = new ArrayList<String>();
110 _footerPortletJavaScript = new ArrayList<String>();
111 _unlinkedRoles = new HashSet<String>();
112 _roleMappers = new LinkedHashMap<String, String>();
113 _initParams = new HashMap<String, String>();
114 _portletModes = new HashMap<String, Set<String>>();
115 _windowStates = new HashMap<String, Set<String>>();
116 _supportedLocales = new HashSet<String>();
117 _portletFilters = new LinkedHashMap<String, PortletFilter>();
118 _processingEvents = new HashSet<QName>();
119 _publishingEvents = new HashSet<QName>();
120 _publicRenderParameters = new HashSet<PublicRenderParameter>();
121 }
122
123
126 public PortletImpl(
127 String portletId, PluginPackage pluginPackage,
128 PluginSetting pluginSetting, long companyId, long timestamp,
129 String icon, String virtualPath, String strutsPath, String portletName,
130 String displayName, String portletClass,
131 String configurationActionClass, String indexerClass,
132 String openSearchClass, String schedulerClass, String portletURLClass,
133 String friendlyURLMapperClass, String urlEncoderClass,
134 String portletDataHandlerClass, String portletLayoutListenerClass,
135 String pollerProcessorClass, String popMessageListenerClass,
136 String socialActivityInterpreterClass,
137 String socialRequestInterpreterClass, String webDAVStorageToken,
138 String webDAVStorageClass, String controlPanelEntryCategory,
139 double controlPanelEntryWeight, String controlPanelClass,
140 String defaultPreferences, String preferencesValidator,
141 boolean preferencesCompanyWide, boolean preferencesUniquePerLayout,
142 boolean preferencesOwnedByGroup, boolean useDefaultTemplate,
143 boolean showPortletAccessDenied, boolean showPortletInactive,
144 boolean actionURLRedirect, boolean restoreCurrentView,
145 boolean maximizeEdit, boolean maximizeHelp, boolean popUpPrint,
146 boolean layoutCacheable, boolean instanceable, boolean scopeable,
147 String userPrincipalStrategy, boolean privateRequestAttributes,
148 boolean privateSessionAttributes, int renderWeight, boolean ajaxable,
149 List<String> headerPortalCss, List<String> headerPortletCss,
150 List<String> headerPortalJavaScript,
151 List<String> headerPortletJavaScript, List<String> footerPortalCss,
152 List<String> footerPortletCss, List<String> footerPortalJavaScript,
153 List<String> footerPortletJavaScript, String cssClassWrapper,
154 String facebookIntegration, boolean addDefaultResource, String roles,
155 Set<String> unlinkedRoles, Map<String, String> roleMappers,
156 boolean system, boolean active, boolean include,
157 Map<String, String> initParams, Integer expCache,
158 Map<String, Set<String>> portletModes,
159 Map<String, Set<String>> windowStates, Set<String> supportedLocales,
160 String resourceBundle, PortletInfo portletInfo,
161 Map<String, PortletFilter> portletFilters, Set<QName> processingEvents,
162 Set<QName> publishingEvents,
163 Set<PublicRenderParameter> publicRenderParameters,
164 PortletApp portletApp) {
165
166 setPortletId(portletId);
167 _pluginPackage = pluginPackage;
168 _defaultPluginSetting = pluginSetting;
169 setCompanyId(companyId);
170 _timestamp = timestamp;
171 _icon = icon;
172 _virtualPath = virtualPath;
173 _strutsPath = strutsPath;
174 _portletName = portletName;
175 _displayName = displayName;
176 _portletClass = portletClass;
177 _configurationActionClass = configurationActionClass;
178 _indexerClass = indexerClass;
179 _openSearchClass = openSearchClass;
180 _schedulerClass = schedulerClass;
181 _portletURLClass = portletURLClass;
182 _friendlyURLMapperClass = friendlyURLMapperClass;
183 _urlEncoderClass = urlEncoderClass;
184 _portletDataHandlerClass = portletDataHandlerClass;
185 _portletLayoutListenerClass = portletLayoutListenerClass;
186 _pollerProcessorClass = pollerProcessorClass;
187 _popMessageListenerClass = popMessageListenerClass;
188 _socialActivityInterpreterClass = socialActivityInterpreterClass;
189 _socialRequestInterpreterClass = socialRequestInterpreterClass;
190 _webDAVStorageToken = webDAVStorageToken;
191 _webDAVStorageClass = webDAVStorageClass;
192 _controlPanelEntryCategory = controlPanelEntryCategory;
193 _controlPanelEntryWeight = controlPanelEntryWeight;
194 _controlPanelEntryClass = controlPanelClass;
195 _defaultPreferences = defaultPreferences;
196 _preferencesValidator = preferencesValidator;
197 _preferencesCompanyWide = preferencesCompanyWide;
198 _preferencesUniquePerLayout = preferencesUniquePerLayout;
199 _preferencesOwnedByGroup = preferencesOwnedByGroup;
200 _useDefaultTemplate = useDefaultTemplate;
201 _showPortletAccessDenied = showPortletAccessDenied;
202 _showPortletInactive = showPortletInactive;
203 _actionURLRedirect = actionURLRedirect;
204 _restoreCurrentView = restoreCurrentView;
205 _maximizeEdit = maximizeEdit;
206 _maximizeHelp = maximizeHelp;
207 _popUpPrint = popUpPrint;
208 _layoutCacheable = layoutCacheable;
209 _instanceable = instanceable;
210 _scopeable = scopeable;
211 _userPrincipalStrategy = userPrincipalStrategy;
212 _privateRequestAttributes = privateRequestAttributes;
213 _privateSessionAttributes = privateSessionAttributes;
214 _renderWeight = renderWeight;
215 _ajaxable = ajaxable;
216 _headerPortalCss = headerPortalCss;
217 _headerPortletCss = headerPortletCss;
218 _headerPortalJavaScript = headerPortalJavaScript;
219 _headerPortletJavaScript = headerPortletJavaScript;
220 _footerPortalCss = footerPortalCss;
221 _footerPortletCss = footerPortletCss;
222 _footerPortalJavaScript = footerPortalJavaScript;
223 _footerPortletJavaScript = footerPortletJavaScript;
224 _cssClassWrapper = cssClassWrapper;
225 _facebookIntegration = facebookIntegration;
226 _scopeable = scopeable;
227 _addDefaultResource = addDefaultResource;
228 setRoles(roles);
229 _unlinkedRoles = unlinkedRoles;
230 _roleMappers = roleMappers;
231 _system = system;
232 setActive(active);
233 _include = include;
234 _initParams = initParams;
235 _expCache = expCache;
236 _portletModes = portletModes;
237 _windowStates = windowStates;
238 _supportedLocales = supportedLocales;
239 _resourceBundle = resourceBundle;
240 _portletInfo = portletInfo;
241 _portletFilters = portletFilters;
242 setProcessingEvents(processingEvents);
243 setPublishingEvents(publishingEvents);
244 setPublicRenderParameters(publicRenderParameters);
245 _portletApp = portletApp;
246
247 if (_instanceable) {
248 _clonedInstances = new Hashtable<String, Portlet>();
249 }
250 }
251
252
257 public String getRootPortletId() {
258 return PortletConstants.getRootPortletId(getPortletId());
259 }
260
261
266 public String getInstanceId() {
267 return PortletConstants.getInstanceId(getPortletId());
268 }
269
270
275 public String getPluginId() {
276 return getRootPortletId();
277 }
278
279
284 public String getPluginType() {
285 return Plugin.TYPE_PORTLET;
286 }
287
288
293 public PluginPackage getPluginPackage() {
294 return _pluginPackage;
295 }
296
297
302 public void setPluginPackage(PluginPackage pluginPackage) {
303 _pluginPackage = pluginPackage;
304 }
305
306
311 public PluginSetting getDefaultPluginSetting() {
312 return _defaultPluginSetting;
313 }
314
315
320 public void setDefaultPluginSetting(PluginSetting pluginSetting) {
321 _defaultPluginSetting = pluginSetting;
322 }
323
324
329 public long getTimestamp() {
330 return _timestamp;
331 }
332
333
338 public void setTimestamp(long timestamp) {
339 _timestamp = timestamp;
340 }
341
342
347 public String getIcon() {
348 return _icon;
349 }
350
351
356 public void setIcon(String icon) {
357 _icon = icon;
358 }
359
360
365 public String getVirtualPath() {
366 return _virtualPath;
367 }
368
369
374 public void setVirtualPath(String virtualPath) {
375 if (_portletApp.isWARFile() && Validator.isNull(virtualPath)) {
376 virtualPath = PropsValues.PORTLET_VIRTUAL_PATH;
377 }
378
379 _virtualPath = virtualPath;
380 }
381
382
387 public String getStrutsPath() {
388 return _strutsPath;
389 }
390
391
396 public void setStrutsPath(String strutsPath) {
397 _strutsPath = strutsPath;
398 }
399
400
405 public String getPortletName() {
406 return _portletName;
407 }
408
409
414 public void setPortletName(String portletName) {
415 _portletName = portletName;
416 }
417
418
423 public String getDisplayName() {
424 return _displayName;
425 }
426
427
432 public void setDisplayName(String displayName) {
433 _displayName = displayName;
434 }
435
436
441 public String getPortletClass() {
442 return _portletClass;
443 }
444
445
450 public void setPortletClass(String portletClass) {
451 _portletClass = portletClass;
452 }
453
454
459 public String getConfigurationActionClass() {
460 return _configurationActionClass;
461 }
462
463
469 public void setConfigurationActionClass(String configurationActionClass) {
470 _configurationActionClass = configurationActionClass;
471 }
472
473
478 public ConfigurationAction getConfigurationActionInstance() {
479 if (Validator.isNull(getConfigurationActionClass())) {
480 return null;
481 }
482
483 if (_portletApp.isWARFile()) {
484 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
485
486 return portletBag.getConfigurationActionInstance();
487 }
488
489 return (ConfigurationAction)InstancePool.get(
490 getConfigurationActionClass());
491 }
492
493
498 public String getIndexerClass() {
499 return _indexerClass;
500 }
501
502
507 public void setIndexerClass(String indexerClass) {
508 _indexerClass = indexerClass;
509 }
510
511
516 public Indexer getIndexerInstance() {
517 if (Validator.isNull(getIndexerClass())) {
518 return null;
519 }
520
521 if (_portletApp.isWARFile()) {
522 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
523
524 return portletBag.getIndexerInstance();
525 }
526
527 return (Indexer)InstancePool.get(getIndexerClass());
528 }
529
530
535 public String getOpenSearchClass() {
536 return _openSearchClass;
537 }
538
539
544 public void setOpenSearchClass(String openSearchClass) {
545 _openSearchClass = openSearchClass;
546 }
547
548
553 public OpenSearch getOpenSearchInstance() {
554 if (Validator.isNull(getOpenSearchClass())) {
555 return null;
556 }
557
558 if (_portletApp.isWARFile()) {
559 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
560
561 return portletBag.getOpenSearchInstance();
562 }
563
564 return (OpenSearch)InstancePool.get(getOpenSearchClass());
565 }
566
567
572 public String getSchedulerClass() {
573 return _schedulerClass;
574 }
575
576
581 public void setSchedulerClass(String schedulerClass) {
582 _schedulerClass = schedulerClass;
583 }
584
585
590 public Scheduler getSchedulerInstance() {
591 if (Validator.isNull(getSchedulerClass())) {
592 return null;
593 }
594
595 if (_portletApp.isWARFile()) {
596 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
597
598 return portletBag.getSchedulerInstance();
599 }
600
601 return (Scheduler)InstancePool.get(getSchedulerClass());
602 }
603
604
609 public String getPortletURLClass() {
610 return _portletURLClass;
611 }
612
613
618 public void setPortletURLClass(String portletURLClass) {
619 _portletURLClass = portletURLClass;
620 }
621
622
627 public String getFriendlyURLMapperClass() {
628 return _friendlyURLMapperClass;
629 }
630
631
637 public void setFriendlyURLMapperClass(String friendlyURLMapperClass) {
638 _friendlyURLMapperClass = friendlyURLMapperClass;
639 }
640
641
646 public FriendlyURLMapper getFriendlyURLMapperInstance() {
647 if (Validator.isNull(getFriendlyURLMapperClass())) {
648 return null;
649 }
650
651 if (_portletApp.isWARFile()) {
652 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
653
654 return portletBag.getFriendlyURLMapperInstance();
655 }
656
657 return (FriendlyURLMapper)InstancePool.get(getFriendlyURLMapperClass());
658 }
659
660
665 public String getURLEncoderClass() {
666 return _urlEncoderClass;
667 }
668
669
674 public void setURLEncoderClass(String urlEncoderClass) {
675 _urlEncoderClass = urlEncoderClass;
676 }
677
678
683 public URLEncoder getURLEncoderInstance() {
684 if (Validator.isNull(getURLEncoderClass())) {
685 return null;
686 }
687
688 if (_portletApp.isWARFile()) {
689 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
690
691 return portletBag.getURLEncoderInstance();
692 }
693
694 return (URLEncoder)InstancePool.get(getURLEncoderClass());
695 }
696
697
702 public String getPortletDataHandlerClass() {
703 return _portletDataHandlerClass;
704 }
705
706
712 public void setPortletDataHandlerClass(String portletDataHandlerClass) {
713 _portletDataHandlerClass = portletDataHandlerClass;
714 }
715
716
721 public PortletDataHandler getPortletDataHandlerInstance() {
722 if (Validator.isNull(getPortletDataHandlerClass())) {
723 return null;
724 }
725
726 if (_portletApp.isWARFile()) {
727 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
728 getRootPortletId());
729
730 return portletBagImpl.getPortletDataHandlerInstance();
731 }
732
733 return (PortletDataHandler)InstancePool.get(
734 getPortletDataHandlerClass());
735 }
736
737
742 public PortletLayoutListener getPortletLayoutListener() {
743 if (Validator.isNull(getPortletLayoutListenerClass())) {
744 return null;
745 }
746
747 return (PortletLayoutListener)InstancePool.get(
748 getPortletLayoutListenerClass());
749 }
750
751
756 public String getPortletLayoutListenerClass() {
757 return _portletLayoutListenerClass;
758 }
759
760
766 public void setPortletLayoutListenerClass(
767 String portletLayoutListenerClass) {
768
769 _portletLayoutListenerClass = portletLayoutListenerClass;
770 }
771
772
777 public PortletLayoutListener getPortletLayoutListenerInstance() {
778 if (Validator.isNull(getPortletLayoutListenerClass())) {
779 return null;
780 }
781
782 if (_portletApp.isWARFile()) {
783 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
784
785 return portletBag.getPortletLayoutListenerInstance();
786 }
787
788 return (PortletLayoutListener)InstancePool.get(
789 getPortletLayoutListenerClass());
790 }
791
792
797 public String getPollerProcessorClass() {
798 return _pollerProcessorClass;
799 }
800
801
807 public void setPollerProcessorClass(String pollerProcessorClass) {
808 _pollerProcessorClass = pollerProcessorClass;
809 }
810
811
816 public PollerProcessor getPollerProcessorInstance() {
817 if (Validator.isNull(getPollerProcessorClass())) {
818 return null;
819 }
820
821 if (_portletApp.isWARFile()) {
822 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
823
824 return portletBag.getPollerProcessorInstance();
825 }
826
827 return (PollerProcessor)InstancePool.get(getPollerProcessorClass());
828 }
829
830
835 public String getPopMessageListenerClass() {
836 return _popMessageListenerClass;
837 }
838
839
845 public void setPopMessageListenerClass(String popMessageListenerClass) {
846 _popMessageListenerClass = popMessageListenerClass;
847 }
848
849
854 public MessageListener getPopMessageListenerInstance() {
855 if (Validator.isNull(getPopMessageListenerClass())) {
856 return null;
857 }
858
859 if (_portletApp.isWARFile()) {
860 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
861
862 return portletBag.getPopMessageListenerInstance();
863 }
864
865 return (MessageListener)InstancePool.get(getPopMessageListenerClass());
866 }
867
868
874 public String getSocialActivityInterpreterClass() {
875 return _socialActivityInterpreterClass;
876 }
877
878
884 public void setSocialActivityInterpreterClass(
885 String socialActivityInterpreterClass) {
886
887 _socialActivityInterpreterClass = socialActivityInterpreterClass;
888 }
889
890
896 public SocialActivityInterpreter getSocialActivityInterpreterInstance() {
897 if (Validator.isNull(getSocialActivityInterpreterClass())) {
898 return null;
899 }
900
901 if (_portletApp.isWARFile()) {
902 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
903 getRootPortletId());
904
905 return portletBagImpl.getSocialActivityInterpreterInstance();
906 }
907
908 return (SocialActivityInterpreter)InstancePool.get(
909 getSocialActivityInterpreterClass());
910 }
911
912
918 public String getSocialRequestInterpreterClass() {
919 return _socialRequestInterpreterClass;
920 }
921
922
928 public void setSocialRequestInterpreterClass(
929 String socialRequestInterpreterClass) {
930
931 _socialRequestInterpreterClass = socialRequestInterpreterClass;
932 }
933
934
940 public SocialRequestInterpreter getSocialRequestInterpreterInstance() {
941 if (Validator.isNull(getSocialRequestInterpreterClass())) {
942 return null;
943 }
944
945 if (_portletApp.isWARFile()) {
946 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
947 getRootPortletId());
948
949 return portletBagImpl.getSocialRequestInterpreterInstance();
950 }
951
952 return (SocialRequestInterpreter)InstancePool.get(
953 getSocialRequestInterpreterClass());
954 }
955
956
961 public String getWebDAVStorageToken() {
962 return _webDAVStorageToken;
963 }
964
965
971 public void setWebDAVStorageToken(String webDAVStorageToken) {
972 _webDAVStorageToken = webDAVStorageToken;
973 }
974
975
980 public String getWebDAVStorageClass() {
981 return _webDAVStorageClass;
982 }
983
984
990 public void setWebDAVStorageClass(String webDAVStorageClass) {
991 _webDAVStorageClass = webDAVStorageClass;
992 }
993
994
999 public WebDAVStorage getWebDAVStorageInstance() {
1000 if (Validator.isNull(getWebDAVStorageClass())) {
1001 return null;
1002 }
1003
1004 if (_portletApp.isWARFile()) {
1005 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
1006 getRootPortletId());
1007
1008 return portletBagImpl.getWebDAVStorageInstance();
1009 }
1010
1011 return (WebDAVStorage)InstancePool.get(
1012 getWebDAVStorageClass());
1013 }
1014
1015
1022 public String getControlPanelEntryCategory() {
1023 return _controlPanelEntryCategory;
1024 }
1025
1026
1033 public void setControlPanelEntryCategory(String controlPanelEntryCategory) {
1034 _controlPanelEntryCategory = controlPanelEntryCategory;
1035 }
1036
1037
1044 public double getControlPanelEntryWeight() {
1045 return _controlPanelEntryWeight;
1046 }
1047
1048
1056 public void setControlPanelEntryWeight(double controlPanelEntryWeight) {
1057 _controlPanelEntryWeight = controlPanelEntryWeight;
1058 }
1059
1060
1067 public String getControlPanelEntryClass() {
1068 return _controlPanelEntryClass;
1069 }
1070
1071
1078 public void setControlPanelEntryClass(String controlPanelEntryClass) {
1079 _controlPanelEntryClass = controlPanelEntryClass;
1080 }
1081
1082
1089 public ControlPanelEntry getControlPanelEntryInstance() {
1090 if (Validator.isNull(getControlPanelEntryClass())) {
1091 return null;
1092 }
1093
1094 if (_portletApp.isWARFile()) {
1095 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
1096 getRootPortletId());
1097
1098 return portletBagImpl.getControlPanelEntryInstance();
1099 }
1100
1101 return (ControlPanelEntry)InstancePool.get(getControlPanelEntryClass());
1102 }
1103
1104
1109 public String getDefaultPreferences() {
1110 if (Validator.isNull(_defaultPreferences)) {
1111 return PortletConstants.DEFAULT_PREFERENCES;
1112 }
1113 else {
1114 return _defaultPreferences;
1115 }
1116 }
1117
1118
1123 public void setDefaultPreferences(String defaultPreferences) {
1124 _defaultPreferences = defaultPreferences;
1125 }
1126
1127
1132 public String getPreferencesValidator() {
1133 return _preferencesValidator;
1134 }
1135
1136
1142 public void setPreferencesValidator(String preferencesValidator) {
1143 if (preferencesValidator != null) {
1144
1145
1148 _preferencesValidator = preferencesValidator.trim();
1149 }
1150 else {
1151 _preferencesValidator = null;
1152 }
1153 }
1154
1155
1160 public boolean getPreferencesCompanyWide() {
1161 return _preferencesCompanyWide;
1162 }
1163
1164
1169 public boolean isPreferencesCompanyWide() {
1170 return _preferencesCompanyWide;
1171 }
1172
1173
1179 public void setPreferencesCompanyWide(boolean preferencesCompanyWide) {
1180 _preferencesCompanyWide = preferencesCompanyWide;
1181 }
1182
1183
1188 public boolean getPreferencesUniquePerLayout() {
1189 return _preferencesUniquePerLayout;
1190 }
1191
1192
1197 public boolean isPreferencesUniquePerLayout() {
1198 return _preferencesUniquePerLayout;
1199 }
1200
1201
1207 public void setPreferencesUniquePerLayout(
1208 boolean preferencesUniquePerLayout) {
1209
1210 _preferencesUniquePerLayout = preferencesUniquePerLayout;
1211 }
1212
1213
1222 public boolean getPreferencesOwnedByGroup() {
1223 return _preferencesOwnedByGroup;
1224 }
1225
1226
1235 public boolean isPreferencesOwnedByGroup() {
1236 return _preferencesOwnedByGroup;
1237 }
1238
1239
1248 public void setPreferencesOwnedByGroup(boolean preferencesOwnedByGroup) {
1249 _preferencesOwnedByGroup = preferencesOwnedByGroup;
1250 }
1251
1252
1257 public boolean getUseDefaultTemplate() {
1258 return _useDefaultTemplate;
1259 }
1260
1261
1266 public boolean isUseDefaultTemplate() {
1267 return _useDefaultTemplate;
1268 }
1269
1270
1276 public void setUseDefaultTemplate(boolean useDefaultTemplate) {
1277 _useDefaultTemplate = useDefaultTemplate;
1278 }
1279
1280
1287 public boolean getShowPortletAccessDenied() {
1288 return _showPortletAccessDenied;
1289 }
1290
1291
1298 public boolean isShowPortletAccessDenied() {
1299 return _showPortletAccessDenied;
1300 }
1301
1302
1309 public void setShowPortletAccessDenied(boolean showPortletAccessDenied) {
1310 _showPortletAccessDenied = showPortletAccessDenied;
1311 }
1312
1313
1318 public boolean getShowPortletInactive() {
1319 return _showPortletInactive;
1320 }
1321
1322
1327 public boolean isShowPortletInactive() {
1328 return _showPortletInactive;
1329 }
1330
1331
1337 public void setShowPortletInactive(boolean showPortletInactive) {
1338 _showPortletInactive = showPortletInactive;
1339 }
1340
1341
1348 public boolean getActionURLRedirect() {
1349 return _actionURLRedirect;
1350 }
1351
1352
1359 public boolean isActionURLRedirect() {
1360 return _actionURLRedirect;
1361 }
1362
1363
1370 public void setActionURLRedirect(boolean actionURLRedirect) {
1371 _actionURLRedirect = actionURLRedirect;
1372 }
1373
1374
1381 public boolean getRestoreCurrentView() {
1382 return _restoreCurrentView;
1383 }
1384
1385
1392 public boolean isRestoreCurrentView() {
1393 return _restoreCurrentView;
1394 }
1395
1396
1403 public void setRestoreCurrentView(boolean restoreCurrentView) {
1404 _restoreCurrentView = restoreCurrentView;
1405 }
1406
1407
1414 public boolean getMaximizeEdit() {
1415 return _maximizeEdit;
1416 }
1417
1418
1425 public boolean isMaximizeEdit() {
1426 return _maximizeEdit;
1427 }
1428
1429
1436 public void setMaximizeEdit(boolean maximizeEdit) {
1437 _maximizeEdit = maximizeEdit;
1438 }
1439
1440
1447 public boolean getMaximizeHelp() {
1448 return _maximizeHelp;
1449 }
1450
1451
1458 public boolean isMaximizeHelp() {
1459 return _maximizeHelp;
1460 }
1461
1462
1469 public void setMaximizeHelp(boolean maximizeHelp) {
1470 _maximizeHelp = maximizeHelp;
1471 }
1472
1473
1480 public boolean getPopUpPrint() {
1481 return _popUpPrint;
1482 }
1483
1484
1491 public boolean isPopUpPrint() {
1492 return _popUpPrint;
1493 }
1494
1495
1502 public void setPopUpPrint(boolean popUpPrint) {
1503 _popUpPrint = popUpPrint;
1504 }
1505
1506
1511 public boolean getLayoutCacheable() {
1512 return _layoutCacheable;
1513 }
1514
1515
1520 public boolean isLayoutCacheable() {
1521 return _layoutCacheable;
1522 }
1523
1524
1530 public void setLayoutCacheable(boolean layoutCacheable) {
1531 _layoutCacheable = layoutCacheable;
1532 }
1533
1534
1539 public boolean getInstanceable() {
1540 return _instanceable;
1541 }
1542
1543
1548 public boolean isInstanceable() {
1549 return _instanceable;
1550 }
1551
1552
1558 public void setInstanceable(boolean instanceable) {
1559 _instanceable = instanceable;
1560 }
1561
1562
1567 public boolean getScopeable() {
1568 return _scopeable;
1569 }
1570
1571
1576 public boolean isScopeable() {
1577 return _scopeable;
1578 }
1579
1580
1586 public void setScopeable(boolean scopeable) {
1587 _scopeable = scopeable;
1588 }
1589
1590
1595 public String getUserPrincipalStrategy() {
1596 return _userPrincipalStrategy;
1597 }
1598
1599
1604 public void setUserPrincipalStrategy(String userPrincipalStrategy) {
1605 if (Validator.isNotNull(userPrincipalStrategy)) {
1606 _userPrincipalStrategy = userPrincipalStrategy;
1607 }
1608 }
1609
1610
1617 public boolean getPrivateRequestAttributes() {
1618 return _privateRequestAttributes;
1619 }
1620
1621
1628 public boolean isPrivateRequestAttributes() {
1629 return _privateRequestAttributes;
1630 }
1631
1632
1640 public void setPrivateRequestAttributes(boolean privateRequestAttributes) {
1641 _privateRequestAttributes = privateRequestAttributes;
1642 }
1643
1644
1651 public boolean getPrivateSessionAttributes() {
1652 return _privateSessionAttributes;
1653 }
1654
1655
1662 public boolean isPrivateSessionAttributes() {
1663 return _privateSessionAttributes;
1664 }
1665
1666
1673 public void setPrivateSessionAttributes(boolean privateSessionAttributes) {
1674 _privateSessionAttributes = privateSessionAttributes;
1675 }
1676
1677
1682 public int getRenderWeight() {
1683 return _renderWeight;
1684 }
1685
1686
1691 public void setRenderWeight(int renderWeight) {
1692 _renderWeight = renderWeight;
1693 }
1694
1695
1700 public boolean getAjaxable() {
1701 return _ajaxable;
1702 }
1703
1704
1709 public boolean isAjaxable() {
1710 return _ajaxable;
1711 }
1712
1713
1719 public void setAjaxable(boolean ajaxable) {
1720 _ajaxable = ajaxable;
1721 }
1722
1723
1730 public List<String> getHeaderPortalCss() {
1731 return _headerPortalCss;
1732 }
1733
1734
1741 public void setHeaderPortalCss(List<String> headerPortalCss) {
1742 _headerPortalCss = headerPortalCss;
1743 }
1744
1745
1752 public List<String> getHeaderPortletCss() {
1753 return _headerPortletCss;
1754 }
1755
1756
1763 public void setHeaderPortletCss(List<String> headerPortletCss) {
1764 _headerPortletCss = headerPortletCss;
1765 }
1766
1767
1774 public List<String> getHeaderPortalJavaScript() {
1775 return _headerPortalJavaScript;
1776 }
1777
1778
1786 public void setHeaderPortalJavaScript(List<String> headerPortalJavaScript) {
1787 _headerPortalJavaScript = headerPortalJavaScript;
1788 }
1789
1790
1797 public List<String> getHeaderPortletJavaScript() {
1798 return _headerPortletJavaScript;
1799 }
1800
1801
1809 public void setHeaderPortletJavaScript(
1810 List<String> headerPortletJavaScript) {
1811
1812 _headerPortletJavaScript = headerPortletJavaScript;
1813 }
1814
1815
1822 public List<String> getFooterPortalCss() {
1823 return _footerPortalCss;
1824 }
1825
1826
1833 public void setFooterPortalCss(List<String> footerPortalCss) {
1834 _footerPortalCss = footerPortalCss;
1835 }
1836
1837
1844 public List<String> getFooterPortletCss() {
1845 return _footerPortletCss;
1846 }
1847
1848
1855 public void setFooterPortletCss(List<String> footerPortletCss) {
1856 _footerPortletCss = footerPortletCss;
1857 }
1858
1859
1866 public List<String> getFooterPortalJavaScript() {
1867 return _footerPortalJavaScript;
1868 }
1869
1870
1878 public void setFooterPortalJavaScript(List<String> footerPortalJavaScript) {
1879 _footerPortalJavaScript = footerPortalJavaScript;
1880 }
1881
1882
1889 public List<String> getFooterPortletJavaScript() {
1890 return _footerPortletJavaScript;
1891 }
1892
1893
1901 public void setFooterPortletJavaScript(
1902 List<String> footerPortletJavaScript) {
1903
1904 _footerPortletJavaScript = footerPortletJavaScript;
1905 }
1906
1907
1914 public String getCssClassWrapper() {
1915 return _cssClassWrapper;
1916 }
1917
1918
1925 public void setCssClassWrapper(String cssClassWrapper) {
1926 _cssClassWrapper = cssClassWrapper;
1927 }
1928
1929
1934 public String getFacebookIntegration() {
1935 return _facebookIntegration;
1936 }
1937
1938
1943 public void setFacebookIntegration(String facebookIntegration) {
1944 if (Validator.isNotNull(facebookIntegration)) {
1945 _facebookIntegration = facebookIntegration;
1946 }
1947 }
1948
1949
1955 public boolean getAddDefaultResource() {
1956 return _addDefaultResource;
1957 }
1958
1959
1965 public boolean isAddDefaultResource() {
1966 return _addDefaultResource;
1967 }
1968
1969
1975 public void setAddDefaultResource(boolean addDefaultResource) {
1976 _addDefaultResource = addDefaultResource;
1977 }
1978
1979
1984 public void setRoles(String roles) {
1985 _rolesArray = StringUtil.split(roles);
1986
1987 super.setRoles(roles);
1988 }
1989
1990
1995 public String[] getRolesArray() {
1996 return _rolesArray;
1997 }
1998
1999
2004 public void setRolesArray(String[] rolesArray) {
2005 _rolesArray = rolesArray;
2006
2007 super.setRoles(StringUtil.merge(rolesArray));
2008 }
2009
2010
2015 public Set<String> getUnlinkedRoles() {
2016 return _unlinkedRoles;
2017 }
2018
2019
2024 public void setUnlinkedRoles(Set<String> unlinkedRoles) {
2025 _unlinkedRoles = unlinkedRoles;
2026 }
2027
2028
2033 public Map<String, String> getRoleMappers() {
2034 return _roleMappers;
2035 }
2036
2037
2042 public void setRoleMappers(Map<String, String> roleMappers) {
2043 _roleMappers = roleMappers;
2044 }
2045
2046
2050 public void linkRoles() {
2051 List<String> linkedRoles = new ArrayList<String>();
2052
2053 Iterator<String> itr = _unlinkedRoles.iterator();
2054
2055 while (itr.hasNext()) {
2056 String unlinkedRole = itr.next();
2057
2058 String roleLink = _roleMappers.get(unlinkedRole);
2059
2060 if (Validator.isNotNull(roleLink)) {
2061 if (_log.isDebugEnabled()) {
2062 _log.debug(
2063 "Linking role for portlet [" + getPortletId() +
2064 "] with role-name [" + unlinkedRole +
2065 "] to role-link [" + roleLink + "]");
2066 }
2067
2068 linkedRoles.add(roleLink);
2069 }
2070 else {
2071 _log.error(
2072 "Unable to link role for portlet [" + getPortletId() +
2073 "] with role-name [" + unlinkedRole +
2074 "] because role-link is null");
2075 }
2076 }
2077
2078 String[] array = linkedRoles.toArray(new String[linkedRoles.size()]);
2079
2080 Arrays.sort(array);
2081
2082 setRolesArray(array);
2083 }
2084
2085
2090 public boolean hasRoleWithName(String roleName) {
2091 if ((_rolesArray == null) || (_rolesArray.length == 0)) {
2092 return false;
2093 }
2094
2095 for (int i = 0; i < _rolesArray.length; i++) {
2096 if (_rolesArray[i].equalsIgnoreCase(roleName)) {
2097 return true;
2098 }
2099 }
2100
2101 return false;
2102 }
2103
2104
2111 public boolean hasAddPortletPermission(long userId) {
2112 try {
2113 if ((_rolesArray == null) || (_rolesArray.length == 0)) {
2114 return true;
2115 }
2116 else if (RoleLocalServiceUtil.hasUserRoles(
2117 userId, getCompanyId(), _rolesArray, true)) {
2118
2119 return true;
2120 }
2121 else if (RoleLocalServiceUtil.hasUserRole(
2122 userId, getCompanyId(), RoleConstants.ADMINISTRATOR,
2123 true)) {
2124
2125 return true;
2126 }
2127 else {
2128 User user = UserLocalServiceUtil.getUserById(userId);
2129
2130 if (user.isDefaultUser() &&
2131 hasRoleWithName(RoleConstants.GUEST)) {
2132
2133 return true;
2134 }
2135 }
2136 }
2137 catch (Exception e) {
2138 _log.error(e);
2139 }
2140
2141 return false;
2142 }
2143
2144
2151 public boolean getSystem() {
2152 return _system;
2153 }
2154
2155
2162 public boolean isSystem() {
2163 return _system;
2164 }
2165
2166
2173 public void setSystem(boolean system) {
2174 _system = system;
2175 }
2176
2177
2184 public boolean getInclude() {
2185 return _include;
2186 }
2187
2188
2195 public boolean isInclude() {
2196 return _include;
2197 }
2198
2199
2206 public void setInclude(boolean include) {
2207 _include = include;
2208 }
2209
2210
2215 public Map<String, String> getInitParams() {
2216 return _initParams;
2217 }
2218
2219
2224 public void setInitParams(Map<String, String> initParams) {
2225 _initParams = initParams;
2226 }
2227
2228
2233 public Integer getExpCache() {
2234 return _expCache;
2235 }
2236
2237
2242 public void setExpCache(Integer expCache) {
2243 _expCache = expCache;
2244 }
2245
2246
2251 public Map<String, Set<String>> getPortletModes() {
2252 return _portletModes;
2253 }
2254
2255
2260 public void setPortletModes(Map<String, Set<String>> portletModes) {
2261 _portletModes = portletModes;
2262 }
2263
2264
2271 public boolean hasPortletMode(String mimeType, PortletMode portletMode) {
2272 if (mimeType == null) {
2273 mimeType = ContentTypes.TEXT_HTML;
2274 }
2275
2276 Set<String> mimeTypePortletModes = _portletModes.get(mimeType);
2277
2278 if (mimeTypePortletModes == null) {
2279 return false;
2280 }
2281
2282 if (mimeTypePortletModes.contains(portletMode.toString())) {
2283 return true;
2284 }
2285 else {
2286 return false;
2287 }
2288 }
2289
2290
2295 public Set<String> getAllPortletModes() {
2296 Set<String> allPortletModes = new TreeSet<String>();
2297
2298 Iterator<Map.Entry <String, Set<String>>> itr1 =
2299 _portletModes.entrySet().iterator();
2300
2301 while (itr1.hasNext()) {
2302 Map.Entry<String, Set<String>> entry = itr1.next();
2303
2304 Set<String> mimeTypePortletModes = entry.getValue();
2305
2306 Iterator<String> itr2 = mimeTypePortletModes.iterator();
2307
2308 while (itr2.hasNext()) {
2309 String portletMode = itr2.next();
2310
2311 allPortletModes.add(portletMode);
2312 }
2313 }
2314
2315 return allPortletModes;
2316 }
2317
2318
2323 public boolean hasMultipleMimeTypes() {
2324 if (_portletModes.size() > 1) {
2325 return true;
2326 }
2327 else {
2328 return false;
2329 }
2330 }
2331
2332
2337 public Map<String, Set<String>> getWindowStates() {
2338 return _windowStates;
2339 }
2340
2341
2346 public void setWindowStates(Map<String, Set<String>> windowStates) {
2347 _windowStates = windowStates;
2348 }
2349
2350
2357 public boolean hasWindowState(String mimeType, WindowState windowState) {
2358 if (mimeType == null) {
2359 mimeType = ContentTypes.TEXT_HTML;
2360 }
2361
2362 Set<String> mimeTypeWindowStates = _windowStates.get(mimeType);
2363
2364 if (mimeTypeWindowStates == null) {
2365 return false;
2366 }
2367
2368 if (mimeTypeWindowStates.contains(windowState.toString())) {
2369 return true;
2370 }
2371 else {
2372 return false;
2373 }
2374 }
2375
2376
2381 public Set<String> getAllWindowStates() {
2382 Set<String> allWindowStates = new TreeSet<String>();
2383
2384 Iterator<Map.Entry <String, Set<String>>> itr1 =
2385 _windowStates.entrySet().iterator();
2386
2387 while (itr1.hasNext()) {
2388 Map.Entry<String, Set<String>> entry = itr1.next();
2389
2390 Set<String> mimeTypeWindowStates = entry.getValue();
2391
2392 Iterator<String> itr2 = mimeTypeWindowStates.iterator();
2393
2394 while (itr2.hasNext()) {
2395 String windowState = itr2.next();
2396
2397 allWindowStates.add(windowState);
2398 }
2399 }
2400
2401 return allWindowStates;
2402 }
2403
2404
2409 public Set<String> getSupportedLocales() {
2410 return _supportedLocales;
2411 }
2412
2413
2418 public void setSupportedLocales(Set<String> supportedLocales) {
2419 _supportedLocales = supportedLocales;
2420 }
2421
2422
2427 public String getResourceBundle() {
2428 return _resourceBundle;
2429 }
2430
2431
2436 public void setResourceBundle(String resourceBundle) {
2437 _resourceBundle = resourceBundle;
2438 }
2439
2440
2445 public PortletInfo getPortletInfo() {
2446 return _portletInfo;
2447 }
2448
2449
2454 public void setPortletInfo(PortletInfo portletInfo) {
2455 _portletInfo = portletInfo;
2456 }
2457
2458
2463 public Map<String, PortletFilter> getPortletFilters() {
2464 return _portletFilters;
2465 }
2466
2467
2472 public void setPortletFilters(Map<String, PortletFilter> portletFilters) {
2473 _portletFilters = portletFilters;
2474 }
2475
2476
2479 public void addProcessingEvent(QName processingEvent) {
2480 _processingEvents.add(processingEvent);
2481 _processingEventsByQName.put(
2482 PortletQNameUtil.getKey(processingEvent), processingEvent);
2483 }
2484
2485
2492 public QName getProcessingEvent(String uri, String localPart) {
2493 return _processingEventsByQName.get(
2494 PortletQNameUtil.getKey(uri, localPart));
2495 }
2496
2497
2502 public Set<QName> getProcessingEvents() {
2503 return _processingEvents;
2504 }
2505
2506
2511 public void setProcessingEvents(Set<QName> processingEvents) {
2512 for (QName processingEvent : processingEvents) {
2513 addProcessingEvent(processingEvent);
2514 }
2515 }
2516
2517
2520 public void addPublishingEvent(QName publishingEvent) {
2521 _publishingEvents.add(publishingEvent);
2522 }
2523
2524
2529 public Set<QName> getPublishingEvents() {
2530 return _publishingEvents;
2531 }
2532
2533
2538 public void setPublishingEvents(Set<QName> publishingEvents) {
2539 for (QName publishingEvent : publishingEvents) {
2540 addPublishingEvent(publishingEvent);
2541 }
2542 }
2543
2544
2549 public void addPublicRenderParameter(
2550 PublicRenderParameter publicRenderParameter) {
2551
2552 _publicRenderParameters.add(publicRenderParameter);
2553 _publicRenderParametersByIdentifier.put(
2554 publicRenderParameter.getIdentifier(), publicRenderParameter);
2555 _publicRenderParametersByQName.put(
2556 PortletQNameUtil.getKey(publicRenderParameter.getQName()),
2557 publicRenderParameter);
2558 }
2559
2560
2565 public PublicRenderParameter getPublicRenderParameter(String identifier) {
2566 return _publicRenderParametersByIdentifier.get(identifier);
2567 }
2568
2569
2576 public PublicRenderParameter getPublicRenderParameter(
2577 String uri, String localPart) {
2578
2579 return _publicRenderParametersByQName.get(
2580 PortletQNameUtil.getKey(uri, localPart));
2581 }
2582
2583
2588 public Set<PublicRenderParameter> getPublicRenderParameters() {
2589 return _publicRenderParameters;
2590 }
2591
2592
2598 public void setPublicRenderParameters(
2599 Set<PublicRenderParameter> publicRenderParameters) {
2600
2601 for (PublicRenderParameter publicRenderParameter :
2602 publicRenderParameters) {
2603
2604 addPublicRenderParameter(publicRenderParameter);
2605 }
2606 }
2607
2608
2613 public String getContextPath() {
2614 String virtualPath = getVirtualPath();
2615
2616 if (Validator.isNotNull(virtualPath)) {
2617 return virtualPath;
2618 }
2619
2620 if (_portletApp.isWARFile()) {
2621 StringBuilder sb = new StringBuilder();
2622
2623 sb.append(StringPool.SLASH);
2624 sb.append(_portletApp.getServletContextName());
2625
2626 return sb.toString();
2627 }
2628 else {
2629 return PortalUtil.getPathContext();
2630 }
2631 }
2632
2633
2638 public PortletApp getPortletApp() {
2639 return _portletApp;
2640 }
2641
2642
2647 public void setPortletApp(PortletApp portletApp) {
2648 _portletApp = portletApp;
2649 }
2650
2651
2657 public Portlet getClonedInstance(String portletId) {
2658 if (_clonedInstances == null) {
2659
2660
2662 return null;
2663 }
2664
2665 Portlet clonedInstance = _clonedInstances.get(portletId);
2666
2667 if (clonedInstance == null) {
2668 clonedInstance = (Portlet)clone();
2669
2670 clonedInstance.setPortletId(portletId);
2671
2672
2679 }
2681
2682 return clonedInstance;
2683 }
2684
2685
2691 public boolean getStatic() {
2692 return _staticPortlet;
2693 }
2694
2695
2701 public boolean isStatic() {
2702 return _staticPortlet;
2703 }
2704
2705
2711 public void setStatic(boolean staticPortlet) {
2712 _staticPortlet = staticPortlet;
2713 }
2714
2715
2722 public boolean getStaticStart() {
2723 return _staticPortletStart;
2724 }
2725
2726
2733 public boolean isStaticStart() {
2734 return _staticPortletStart;
2735 }
2736
2737
2744 public void setStaticStart(boolean staticPortletStart) {
2745 _staticPortletStart = staticPortletStart;
2746 }
2747
2748
2755 public boolean getStaticEnd() {
2756 return !_staticPortletStart;
2757 }
2758
2759
2766 public boolean isStaticEnd() {
2767 return !_staticPortletStart;
2768 }
2769
2770
2776 public boolean getUndeployedPortlet() {
2777 return _undeployedPortlet;
2778 }
2779
2780
2786 public boolean isUndeployedPortlet() {
2787 return _undeployedPortlet;
2788 }
2789
2790
2796 public void setUndeployedPortlet(boolean undeployedPortlet) {
2797 _undeployedPortlet = undeployedPortlet;
2798 }
2799
2800
2805 public Object clone() {
2806 Portlet portlet = new PortletImpl(
2807 getPortletId(), getPluginPackage(), getDefaultPluginSetting(),
2808 getCompanyId(), getTimestamp(), getIcon(), getVirtualPath(),
2809 getStrutsPath(), getPortletName(), getDisplayName(),
2810 getPortletClass(), getConfigurationActionClass(), getIndexerClass(),
2811 getOpenSearchClass(), getSchedulerClass(), getPortletURLClass(),
2812 getFriendlyURLMapperClass(), getURLEncoderClass(),
2813 getPortletDataHandlerClass(), getPortletLayoutListenerClass(),
2814 getPollerProcessorClass(), getPopMessageListenerClass(),
2815 getSocialActivityInterpreterClass(),
2816 getSocialRequestInterpreterClass(), getWebDAVStorageToken(),
2817 getWebDAVStorageClass(), getControlPanelEntryCategory(),
2818 getControlPanelEntryWeight(), getControlPanelEntryClass(),
2819 getDefaultPreferences(), getPreferencesValidator(),
2820 isPreferencesCompanyWide(), isPreferencesUniquePerLayout(),
2821 isPreferencesOwnedByGroup(), isUseDefaultTemplate(),
2822 isShowPortletAccessDenied(), isShowPortletInactive(),
2823 isActionURLRedirect(), isRestoreCurrentView(), isMaximizeEdit(),
2824 isMaximizeHelp(), isPopUpPrint(), isLayoutCacheable(),
2825 isInstanceable(), isScopeable(), getUserPrincipalStrategy(),
2826 isPrivateRequestAttributes(), isPrivateSessionAttributes(),
2827 getRenderWeight(), isAjaxable(), getHeaderPortalCss(),
2828 getHeaderPortletCss(), getHeaderPortalJavaScript(),
2829 getHeaderPortletJavaScript(), getFooterPortalCss(),
2830 getFooterPortletCss(), getFooterPortalJavaScript(),
2831 getFooterPortletJavaScript(), getCssClassWrapper(),
2832 getFacebookIntegration(), isAddDefaultResource(), getRoles(),
2833 getUnlinkedRoles(), getRoleMappers(), isSystem(), isActive(),
2834 isInclude(), getInitParams(), getExpCache(), getPortletModes(),
2835 getWindowStates(), getSupportedLocales(), getResourceBundle(),
2836 getPortletInfo(), getPortletFilters(), getProcessingEvents(),
2837 getPublishingEvents(), getPublicRenderParameters(),
2838 getPortletApp());
2839
2840 portlet.setId(getId());
2841
2842 return portlet;
2843 }
2844
2845
2854 public int compareTo(Portlet portlet) {
2855 return getPortletId().compareTo(portlet.getPortletId());
2856 }
2857
2858
2864 public boolean equals(Object obj) {
2865 Portlet portlet = (Portlet)obj;
2866
2867 return getPortletId().equals(portlet.getPortletId());
2868 }
2869
2870
2873 private static Log _log = LogFactoryUtil.getLog(PortletImpl.class);
2874
2875
2878 private PluginPackage _pluginPackage;
2879
2880
2883 private PluginSetting _defaultPluginSetting;
2884
2885
2888 private long _timestamp;
2889
2890
2893 private String _icon;
2894
2895
2898 private String _virtualPath;
2899
2900
2903 private String _strutsPath;
2904
2905
2908 private String _portletName;
2909
2910
2913 private String _displayName;
2914
2915
2918 private String _portletClass;
2919
2920
2923 private String _configurationActionClass;
2924
2925
2928 private String _indexerClass;
2929
2930
2933 private String _openSearchClass;
2934
2935
2938 private String _schedulerClass;
2939
2940
2943 private String _portletURLClass;
2944
2945
2948 private String _friendlyURLMapperClass;
2949
2950
2953 private String _urlEncoderClass;
2954
2955
2958 private String _portletDataHandlerClass;
2959
2960
2963 private String _portletLayoutListenerClass;
2964
2965
2968 private String _pollerProcessorClass;
2969
2970
2973 private String _popMessageListenerClass;
2974
2975
2978 private String _socialActivityInterpreterClass;
2979
2980
2983 private String _socialRequestInterpreterClass;
2984
2985
2988 private String _webDAVStorageToken;
2989
2990
2993 private String _webDAVStorageClass;
2994
2995
2998 private String _defaultPreferences;
2999
3000
3003 private String _preferencesValidator;
3004
3005
3008 private boolean _preferencesCompanyWide;
3009
3010
3013 private boolean _preferencesUniquePerLayout = true;
3014
3015
3019 private boolean _preferencesOwnedByGroup = true;
3020
3021
3025 private String _controlPanelEntryCategory;
3026
3027
3031 private double _controlPanelEntryWeight = 100;
3032
3033
3037 private String _controlPanelEntryClass;
3038
3039
3042 private boolean _useDefaultTemplate = true;
3043
3044
3047 private boolean _showPortletAccessDenied =
3048 PropsValues.LAYOUT_SHOW_PORTLET_ACCESS_DENIED;
3049
3050
3053 private boolean _showPortletInactive =
3054 PropsValues.LAYOUT_SHOW_PORTLET_INACTIVE;
3055
3056
3059 private boolean _actionURLRedirect;
3060
3061
3065 private boolean _restoreCurrentView = true;
3066
3067
3071 private boolean _maximizeEdit;
3072
3073
3077 private boolean _maximizeHelp;
3078
3079
3083 private boolean _popUpPrint = true;
3084
3085
3088 private boolean _layoutCacheable;
3089
3090
3093 private boolean _instanceable;
3094
3095
3098 private boolean _scopeable;
3099
3100
3103 private String _userPrincipalStrategy =
3104 PortletConstants.USER_PRINCIPAL_STRATEGY_USER_ID;
3105
3106
3110 private boolean _privateRequestAttributes = true;
3111
3112
3115 private boolean _privateSessionAttributes = true;
3116
3117
3120 private int _renderWeight = 1;
3121
3122
3125 private boolean _ajaxable = true;
3126
3127
3131 private List<String> _headerPortalCss;
3132
3133
3137 private List<String> _headerPortletCss;
3138
3139
3143 private List<String> _headerPortalJavaScript;
3144
3145
3149 private List<String> _headerPortletJavaScript;
3150
3151
3155 private List<String> _footerPortalCss;
3156
3157
3161 private List<String> _footerPortletCss;
3162
3163
3167 private List<String> _footerPortalJavaScript;
3168
3169
3173 private List<String> _footerPortletJavaScript;
3174
3175
3179 private String _cssClassWrapper = StringPool.BLANK;
3180
3181
3184 private String _facebookIntegration =
3185 PortletConstants.FACEBOOK_INTEGRATION_IFRAME;
3186
3187
3190 private boolean _addDefaultResource;
3191
3192
3195 private String[] _rolesArray;
3196
3197
3200 private Set<String> _unlinkedRoles;
3201
3202
3205 private Map<String, String> _roleMappers;
3206
3207
3211 private boolean _system;
3212
3213
3216 private boolean _include = true;
3217
3218
3221 private Map<String, String> _initParams;
3222
3223
3226 private Integer _expCache;
3227
3228
3231 private Map<String, Set<String>> _portletModes;
3232
3233
3236 private Map<String, Set<String>> _windowStates;
3237
3238
3241 private Set<String> _supportedLocales;
3242
3243
3246 private String _resourceBundle;
3247
3248
3251 private PortletInfo _portletInfo;
3252
3253
3256 private Map<String, PortletFilter> _portletFilters;
3257
3258
3261 private Set<QName> _processingEvents = new HashSet<QName>();
3262
3263
3266 private Map<String, QName> _processingEventsByQName =
3267 new HashMap<String, QName>();
3268
3269
3272 private Set<QName> _publishingEvents = new HashSet<QName>();
3273
3274
3277 private Set<PublicRenderParameter> _publicRenderParameters =
3278 new HashSet<PublicRenderParameter>();
3279
3280
3284 private Map<String, PublicRenderParameter>
3285 _publicRenderParametersByIdentifier =
3286 new HashMap<String, PublicRenderParameter>();
3287
3288
3292 private Map<String, PublicRenderParameter>
3293 _publicRenderParametersByQName =
3294 new HashMap<String, PublicRenderParameter>();
3295
3296
3299 private PortletApp _portletApp;
3300
3301
3304 private Map<String, Portlet> _clonedInstances;
3305
3306
3309 private boolean _staticPortlet;
3310
3311
3315 private boolean _staticPortletStart;
3316
3317
3320 private boolean _undeployedPortlet = false;
3321
3322}