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
81
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 _supportedLocales = new HashSet<String>();
116 _portletFilters = new LinkedHashMap<String, PortletFilter>();
117 _processingEvents = new HashSet<QName>();
118 _publishingEvents = new HashSet<QName>();
119 _publicRenderParameters = new HashSet<PublicRenderParameter>();
120 }
121
122
125 public PortletImpl(
126 String portletId, PluginPackage pluginPackage,
127 PluginSetting pluginSetting, long companyId, long timestamp,
128 String icon, String virtualPath, String strutsPath, String portletName,
129 String displayName, String portletClass,
130 String configurationActionClass, String indexerClass,
131 String openSearchClass, String schedulerClass, String portletURLClass,
132 String friendlyURLMapperClass, String urlEncoderClass,
133 String portletDataHandlerClass, String portletLayoutListenerClass,
134 String pollerProcessorClass, String popMessageListenerClass,
135 String socialActivityInterpreterClass,
136 String socialRequestInterpreterClass, String webDAVStorageToken,
137 String webDAVStorageClass, String controlPanelEntryCategory,
138 double controlPanelEntryWeight, String controlPanelClass,
139 String defaultPreferences, String preferencesValidator,
140 boolean preferencesCompanyWide, boolean preferencesUniquePerLayout,
141 boolean preferencesOwnedByGroup, boolean useDefaultTemplate,
142 boolean showPortletAccessDenied, boolean showPortletInactive,
143 boolean actionURLRedirect, boolean restoreCurrentView,
144 boolean maximizeEdit, boolean maximizeHelp, boolean popUpPrint,
145 boolean layoutCacheable, boolean instanceable, boolean scopeable,
146 String userPrincipalStrategy, boolean privateRequestAttributes,
147 boolean privateSessionAttributes, int renderWeight, boolean ajaxable,
148 List<String> headerPortalCss, List<String> headerPortletCss,
149 List<String> headerPortalJavaScript,
150 List<String> headerPortletJavaScript, List<String> footerPortalCss,
151 List<String> footerPortletCss, List<String> footerPortalJavaScript,
152 List<String> footerPortletJavaScript, String cssClassWrapper,
153 String facebookIntegration, boolean addDefaultResource, String roles,
154 Set<String> unlinkedRoles, Map<String, String> roleMappers,
155 boolean system, boolean active, boolean include,
156 Map<String, String> initParams, Integer expCache,
157 Map<String, Set<String>> portletModes, Set<String> supportedLocales,
158 String resourceBundle, PortletInfo portletInfo,
159 Map<String, PortletFilter> portletFilters, Set<QName> processingEvents,
160 Set<QName> publishingEvents,
161 Set<PublicRenderParameter> publicRenderParameters, boolean remote,
162 String remoteConsumerId, String remoteProducerEntityId,
163 String remotePortletHandle, String remotePortletId,
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 _supportedLocales = supportedLocales;
238 _resourceBundle = resourceBundle;
239 _portletInfo = portletInfo;
240 _portletFilters = portletFilters;
241 setProcessingEvents(processingEvents);
242 setPublishingEvents(publishingEvents);
243 setPublicRenderParameters(publicRenderParameters);
244 _remote = remote;
245 _remoteConsumerId = remoteConsumerId;
246 _remoteProducerEntityId = remoteProducerEntityId;
247 _remotePortletHandle = remotePortletHandle;
248 _remotePortletId = remotePortletId;
249 _portletApp = portletApp;
250
251 if (_instanceable) {
252 _clonedInstances = new Hashtable<String, Portlet>();
253 }
254 }
255
256
261 public String getRootPortletId() {
262 return PortletConstants.getRootPortletId(getPortletId());
263 }
264
265
270 public String getInstanceId() {
271 return PortletConstants.getInstanceId(getPortletId());
272 }
273
274
279 public String getPluginId() {
280 return getRootPortletId();
281 }
282
283
288 public String getPluginType() {
289 return Plugin.TYPE_PORTLET;
290 }
291
292
297 public PluginPackage getPluginPackage() {
298 return _pluginPackage;
299 }
300
301
306 public void setPluginPackage(PluginPackage pluginPackage) {
307 _pluginPackage = pluginPackage;
308 }
309
310
315 public PluginSetting getDefaultPluginSetting() {
316 return _defaultPluginSetting;
317 }
318
319
324 public void setDefaultPluginSetting(PluginSetting pluginSetting) {
325 _defaultPluginSetting = pluginSetting;
326 }
327
328
333 public long getTimestamp() {
334 return _timestamp;
335 }
336
337
342 public void setTimestamp(long timestamp) {
343 _timestamp = timestamp;
344 }
345
346
351 public String getIcon() {
352 return _icon;
353 }
354
355
360 public void setIcon(String icon) {
361 _icon = icon;
362 }
363
364
369 public String getVirtualPath() {
370 return _virtualPath;
371 }
372
373
378 public void setVirtualPath(String virtualPath) {
379 if (_portletApp.isWARFile() && Validator.isNull(virtualPath)) {
380 virtualPath = PropsValues.PORTLET_VIRTUAL_PATH;
381 }
382
383 _virtualPath = virtualPath;
384 }
385
386
391 public String getStrutsPath() {
392 return _strutsPath;
393 }
394
395
400 public void setStrutsPath(String strutsPath) {
401 _strutsPath = strutsPath;
402 }
403
404
409 public String getPortletName() {
410 return _portletName;
411 }
412
413
418 public void setPortletName(String portletName) {
419 _portletName = portletName;
420 }
421
422
427 public String getDisplayName() {
428 return _displayName;
429 }
430
431
436 public void setDisplayName(String displayName) {
437 _displayName = displayName;
438 }
439
440
445 public String getPortletClass() {
446 return _portletClass;
447 }
448
449
454 public void setPortletClass(String portletClass) {
455 _portletClass = portletClass;
456 }
457
458
463 public String getConfigurationActionClass() {
464 return _configurationActionClass;
465 }
466
467
473 public void setConfigurationActionClass(String configurationActionClass) {
474 _configurationActionClass = configurationActionClass;
475 }
476
477
482 public ConfigurationAction getConfigurationActionInstance() {
483 if (Validator.isNull(getConfigurationActionClass())) {
484 return null;
485 }
486
487 if (_portletApp.isWARFile()) {
488 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
489
490 return portletBag.getConfigurationActionInstance();
491 }
492
493 return (ConfigurationAction)InstancePool.get(
494 getConfigurationActionClass());
495 }
496
497
502 public String getIndexerClass() {
503 return _indexerClass;
504 }
505
506
511 public void setIndexerClass(String indexerClass) {
512 _indexerClass = indexerClass;
513 }
514
515
520 public Indexer getIndexerInstance() {
521 if (Validator.isNull(getIndexerClass())) {
522 return null;
523 }
524
525 if (_portletApp.isWARFile()) {
526 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
527
528 return portletBag.getIndexerInstance();
529 }
530
531 return (Indexer)InstancePool.get(getIndexerClass());
532 }
533
534
539 public String getOpenSearchClass() {
540 return _openSearchClass;
541 }
542
543
549 public void setOpenSearchClass(String openSearchClass) {
550 _openSearchClass = openSearchClass;
551 }
552
553
558 public OpenSearch getOpenSearchInstance() {
559 if (Validator.isNull(getOpenSearchClass())) {
560 return null;
561 }
562
563 if (_portletApp.isWARFile()) {
564 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
565
566 return portletBag.getOpenSearchInstance();
567 }
568
569 return (OpenSearch)InstancePool.get(getOpenSearchClass());
570 }
571
572
577 public String getSchedulerClass() {
578 return _schedulerClass;
579 }
580
581
587 public void setSchedulerClass(String schedulerClass) {
588 _schedulerClass = schedulerClass;
589 }
590
591
596 public Scheduler getSchedulerInstance() {
597 if (Validator.isNull(getSchedulerClass())) {
598 return null;
599 }
600
601 if (_portletApp.isWARFile()) {
602 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
603
604 return portletBag.getSchedulerInstance();
605 }
606
607 return (Scheduler)InstancePool.get(getSchedulerClass());
608 }
609
610
615 public String getPortletURLClass() {
616 return _portletURLClass;
617 }
618
619
625 public void setPortletURLClass(String portletURLClass) {
626 _portletURLClass = portletURLClass;
627 }
628
629
634 public String getFriendlyURLMapperClass() {
635 return _friendlyURLMapperClass;
636 }
637
638
644 public void setFriendlyURLMapperClass(String friendlyURLMapperClass) {
645 _friendlyURLMapperClass = friendlyURLMapperClass;
646 }
647
648
653 public FriendlyURLMapper getFriendlyURLMapperInstance() {
654 if (Validator.isNull(getFriendlyURLMapperClass())) {
655 return null;
656 }
657
658 if (_portletApp.isWARFile()) {
659 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
660
661 return portletBag.getFriendlyURLMapperInstance();
662 }
663
664 return (FriendlyURLMapper)InstancePool.get(getFriendlyURLMapperClass());
665 }
666
667
672 public String getURLEncoderClass() {
673 return _urlEncoderClass;
674 }
675
676
682 public void setURLEncoderClass(String urlEncoderClass) {
683 _urlEncoderClass = urlEncoderClass;
684 }
685
686
691 public URLEncoder getURLEncoderInstance() {
692 if (Validator.isNull(getURLEncoderClass())) {
693 return null;
694 }
695
696 if (_portletApp.isWARFile()) {
697 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
698
699 return portletBag.getURLEncoderInstance();
700 }
701
702 return (URLEncoder)InstancePool.get(getURLEncoderClass());
703 }
704
705
710 public String getPortletDataHandlerClass() {
711 return _portletDataHandlerClass;
712 }
713
714
720 public void setPortletDataHandlerClass(String portletDataHandlerClass) {
721 _portletDataHandlerClass = portletDataHandlerClass;
722 }
723
724
729 public PortletDataHandler getPortletDataHandlerInstance() {
730 if (Validator.isNull(getPortletDataHandlerClass())) {
731 return null;
732 }
733
734 if (_portletApp.isWARFile()) {
735 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
736 getRootPortletId());
737
738 return portletBagImpl.getPortletDataHandlerInstance();
739 }
740
741 return (PortletDataHandler)InstancePool.get(
742 getPortletDataHandlerClass());
743 }
744
745
750 public PortletLayoutListener getPortletLayoutListener() {
751 if (Validator.isNull(getPortletLayoutListenerClass())) {
752 return null;
753 }
754
755 return (PortletLayoutListener)InstancePool.get(
756 getPortletLayoutListenerClass());
757 }
758
759
764 public String getPortletLayoutListenerClass() {
765 return _portletLayoutListenerClass;
766 }
767
768
774 public void setPortletLayoutListenerClass(
775 String portletLayoutListenerClass) {
776
777 _portletLayoutListenerClass = portletLayoutListenerClass;
778 }
779
780
785 public PortletLayoutListener getPortletLayoutListenerInstance() {
786 if (Validator.isNull(getPortletLayoutListenerClass())) {
787 return null;
788 }
789
790 if (_portletApp.isWARFile()) {
791 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
792
793 return portletBag.getPortletLayoutListenerInstance();
794 }
795
796 return (PortletLayoutListener)InstancePool.get(
797 getPortletLayoutListenerClass());
798 }
799
800
805 public String getPollerProcessorClass() {
806 return _pollerProcessorClass;
807 }
808
809
815 public void setPollerProcessorClass(String pollerProcessorClass) {
816 _pollerProcessorClass = pollerProcessorClass;
817 }
818
819
824 public PollerProcessor getPollerProcessorInstance() {
825 if (Validator.isNull(getPollerProcessorClass())) {
826 return null;
827 }
828
829 if (_portletApp.isWARFile()) {
830 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
831
832 return portletBag.getPollerProcessorInstance();
833 }
834
835 return (PollerProcessor)InstancePool.get(getPollerProcessorClass());
836 }
837
838
843 public String getPopMessageListenerClass() {
844 return _popMessageListenerClass;
845 }
846
847
853 public void setPopMessageListenerClass(String popMessageListenerClass) {
854 _popMessageListenerClass = popMessageListenerClass;
855 }
856
857
862 public MessageListener getPopMessageListenerInstance() {
863 if (Validator.isNull(getPopMessageListenerClass())) {
864 return null;
865 }
866
867 if (_portletApp.isWARFile()) {
868 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
869
870 return portletBag.getPopMessageListenerInstance();
871 }
872
873 return (MessageListener)InstancePool.get(getPopMessageListenerClass());
874 }
875
876
882 public String getSocialActivityInterpreterClass() {
883 return _socialActivityInterpreterClass;
884 }
885
886
892 public void setSocialActivityInterpreterClass(
893 String socialActivityInterpreterClass) {
894
895 _socialActivityInterpreterClass = socialActivityInterpreterClass;
896 }
897
898
904 public SocialActivityInterpreter getSocialActivityInterpreterInstance() {
905 if (Validator.isNull(getSocialActivityInterpreterClass())) {
906 return null;
907 }
908
909 if (_portletApp.isWARFile()) {
910 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
911 getRootPortletId());
912
913 return portletBagImpl.getSocialActivityInterpreterInstance();
914 }
915
916 return (SocialActivityInterpreter)InstancePool.get(
917 getSocialActivityInterpreterClass());
918 }
919
920
926 public String getSocialRequestInterpreterClass() {
927 return _socialRequestInterpreterClass;
928 }
929
930
936 public void setSocialRequestInterpreterClass(
937 String socialRequestInterpreterClass) {
938
939 _socialRequestInterpreterClass = socialRequestInterpreterClass;
940 }
941
942
948 public SocialRequestInterpreter getSocialRequestInterpreterInstance() {
949 if (Validator.isNull(getSocialRequestInterpreterClass())) {
950 return null;
951 }
952
953 if (_portletApp.isWARFile()) {
954 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
955 getRootPortletId());
956
957 return portletBagImpl.getSocialRequestInterpreterInstance();
958 }
959
960 return (SocialRequestInterpreter)InstancePool.get(
961 getSocialRequestInterpreterClass());
962 }
963
964
969 public String getWebDAVStorageToken() {
970 return _webDAVStorageToken;
971 }
972
973
979 public void setWebDAVStorageToken(String webDAVStorageToken) {
980 _webDAVStorageToken = webDAVStorageToken;
981 }
982
983
988 public String getWebDAVStorageClass() {
989 return _webDAVStorageClass;
990 }
991
992
998 public void setWebDAVStorageClass(String webDAVStorageClass) {
999 _webDAVStorageClass = webDAVStorageClass;
1000 }
1001
1002
1007 public WebDAVStorage getWebDAVStorageInstance() {
1008 if (Validator.isNull(getWebDAVStorageClass())) {
1009 return null;
1010 }
1011
1012 if (_portletApp.isWARFile()) {
1013 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
1014 getRootPortletId());
1015
1016 return portletBagImpl.getWebDAVStorageInstance();
1017 }
1018
1019 return (WebDAVStorage)InstancePool.get(
1020 getWebDAVStorageClass());
1021 }
1022
1023
1030 public String getControlPanelEntryCategory() {
1031 return _controlPanelEntryCategory;
1032 }
1033
1034
1041 public void setControlPanelEntryCategory(String controlPanelEntryCategory) {
1042 _controlPanelEntryCategory = controlPanelEntryCategory;
1043 }
1044
1045
1052 public double getControlPanelEntryWeight() {
1053 return _controlPanelEntryWeight;
1054 }
1055
1056
1064 public void setControlPanelEntryWeight(double controlPanelEntryWeight) {
1065 _controlPanelEntryWeight = controlPanelEntryWeight;
1066 }
1067
1068
1075 public String getControlPanelEntryClass() {
1076 return _controlPanelEntryClass;
1077 }
1078
1079
1086 public void setControlPanelEntryClass(String controlPanelEntryClass) {
1087 _controlPanelEntryClass = controlPanelEntryClass;
1088 }
1089
1090
1097 public ControlPanelEntry getControlPanelEntryInstance() {
1098 if (Validator.isNull(getControlPanelEntryClass())) {
1099 return null;
1100 }
1101
1102 if (_portletApp.isWARFile()) {
1103 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
1104 getRootPortletId());
1105
1106 return portletBagImpl.getControlPanelEntryInstance();
1107 }
1108
1109 return (ControlPanelEntry)InstancePool.get(getControlPanelEntryClass());
1110 }
1111
1112
1117 public String getDefaultPreferences() {
1118 if (Validator.isNull(_defaultPreferences)) {
1119 return PortletConstants.DEFAULT_PREFERENCES;
1120 }
1121 else {
1122 return _defaultPreferences;
1123 }
1124 }
1125
1126
1131 public void setDefaultPreferences(String defaultPreferences) {
1132 _defaultPreferences = defaultPreferences;
1133 }
1134
1135
1140 public String getPreferencesValidator() {
1141 return _preferencesValidator;
1142 }
1143
1144
1150 public void setPreferencesValidator(String preferencesValidator) {
1151 if (preferencesValidator != null) {
1152
1153
1156 _preferencesValidator = preferencesValidator.trim();
1157 }
1158 else {
1159 _preferencesValidator = null;
1160 }
1161 }
1162
1163
1168 public boolean getPreferencesCompanyWide() {
1169 return _preferencesCompanyWide;
1170 }
1171
1172
1177 public boolean isPreferencesCompanyWide() {
1178 return _preferencesCompanyWide;
1179 }
1180
1181
1187 public void setPreferencesCompanyWide(boolean preferencesCompanyWide) {
1188 _preferencesCompanyWide = preferencesCompanyWide;
1189 }
1190
1191
1196 public boolean getPreferencesUniquePerLayout() {
1197 return _preferencesUniquePerLayout;
1198 }
1199
1200
1205 public boolean isPreferencesUniquePerLayout() {
1206 return _preferencesUniquePerLayout;
1207 }
1208
1209
1215 public void setPreferencesUniquePerLayout(
1216 boolean preferencesUniquePerLayout) {
1217
1218 _preferencesUniquePerLayout = preferencesUniquePerLayout;
1219 }
1220
1221
1230 public boolean getPreferencesOwnedByGroup() {
1231 return _preferencesOwnedByGroup;
1232 }
1233
1234
1243 public boolean isPreferencesOwnedByGroup() {
1244 return _preferencesOwnedByGroup;
1245 }
1246
1247
1257 public void setPreferencesOwnedByGroup(boolean preferencesOwnedByGroup) {
1258 _preferencesOwnedByGroup = preferencesOwnedByGroup;
1259 }
1260
1261
1266 public boolean getUseDefaultTemplate() {
1267 return _useDefaultTemplate;
1268 }
1269
1270
1275 public boolean isUseDefaultTemplate() {
1276 return _useDefaultTemplate;
1277 }
1278
1279
1285 public void setUseDefaultTemplate(boolean useDefaultTemplate) {
1286 _useDefaultTemplate = useDefaultTemplate;
1287 }
1288
1289
1296 public boolean getShowPortletAccessDenied() {
1297 return _showPortletAccessDenied;
1298 }
1299
1300
1307 public boolean isShowPortletAccessDenied() {
1308 return _showPortletAccessDenied;
1309 }
1310
1311
1318 public void setShowPortletAccessDenied(boolean showPortletAccessDenied) {
1319 _showPortletAccessDenied = showPortletAccessDenied;
1320 }
1321
1322
1327 public boolean getShowPortletInactive() {
1328 return _showPortletInactive;
1329 }
1330
1331
1336 public boolean isShowPortletInactive() {
1337 return _showPortletInactive;
1338 }
1339
1340
1346 public void setShowPortletInactive(boolean showPortletInactive) {
1347 _showPortletInactive = showPortletInactive;
1348 }
1349
1350
1357 public boolean getActionURLRedirect() {
1358 return _actionURLRedirect;
1359 }
1360
1361
1368 public boolean isActionURLRedirect() {
1369 return _actionURLRedirect;
1370 }
1371
1372
1379 public void setActionURLRedirect(boolean actionURLRedirect) {
1380 _actionURLRedirect = actionURLRedirect;
1381 }
1382
1383
1390 public boolean getRestoreCurrentView() {
1391 return _restoreCurrentView;
1392 }
1393
1394
1401 public boolean isRestoreCurrentView() {
1402 return _restoreCurrentView;
1403 }
1404
1405
1412 public void setRestoreCurrentView(boolean restoreCurrentView) {
1413 _restoreCurrentView = restoreCurrentView;
1414 }
1415
1416
1423 public boolean getMaximizeEdit() {
1424 return _maximizeEdit;
1425 }
1426
1427
1434 public boolean isMaximizeEdit() {
1435 return _maximizeEdit;
1436 }
1437
1438
1445 public void setMaximizeEdit(boolean maximizeEdit) {
1446 _maximizeEdit = maximizeEdit;
1447 }
1448
1449
1456 public boolean getMaximizeHelp() {
1457 return _maximizeHelp;
1458 }
1459
1460
1467 public boolean isMaximizeHelp() {
1468 return _maximizeHelp;
1469 }
1470
1471
1478 public void setMaximizeHelp(boolean maximizeHelp) {
1479 _maximizeHelp = maximizeHelp;
1480 }
1481
1482
1489 public boolean getPopUpPrint() {
1490 return _popUpPrint;
1491 }
1492
1493
1500 public boolean isPopUpPrint() {
1501 return _popUpPrint;
1502 }
1503
1504
1511 public void setPopUpPrint(boolean popUpPrint) {
1512 _popUpPrint = popUpPrint;
1513 }
1514
1515
1520 public boolean getLayoutCacheable() {
1521 return _layoutCacheable;
1522 }
1523
1524
1529 public boolean isLayoutCacheable() {
1530 return _layoutCacheable;
1531 }
1532
1533
1539 public void setLayoutCacheable(boolean layoutCacheable) {
1540 _layoutCacheable = layoutCacheable;
1541 }
1542
1543
1548 public boolean getInstanceable() {
1549 return _instanceable;
1550 }
1551
1552
1557 public boolean isInstanceable() {
1558 return _instanceable;
1559 }
1560
1561
1567 public void setInstanceable(boolean instanceable) {
1568 _instanceable = instanceable;
1569 }
1570
1571
1576 public boolean getScopeable() {
1577 return _scopeable;
1578 }
1579
1580
1585 public boolean isScopeable() {
1586 return _scopeable;
1587 }
1588
1589
1595 public void setScopeable(boolean scopeable) {
1596 _scopeable = scopeable;
1597 }
1598
1599
1604 public String getUserPrincipalStrategy() {
1605 return _userPrincipalStrategy;
1606 }
1607
1608
1614 public void setUserPrincipalStrategy(String userPrincipalStrategy) {
1615 if (Validator.isNotNull(userPrincipalStrategy)) {
1616 _userPrincipalStrategy = userPrincipalStrategy;
1617 }
1618 }
1619
1620
1627 public boolean getPrivateRequestAttributes() {
1628 return _privateRequestAttributes;
1629 }
1630
1631
1638 public boolean isPrivateRequestAttributes() {
1639 return _privateRequestAttributes;
1640 }
1641
1642
1650 public void setPrivateRequestAttributes(boolean privateRequestAttributes) {
1651 _privateRequestAttributes = privateRequestAttributes;
1652 }
1653
1654
1661 public boolean getPrivateSessionAttributes() {
1662 return _privateSessionAttributes;
1663 }
1664
1665
1672 public boolean isPrivateSessionAttributes() {
1673 return _privateSessionAttributes;
1674 }
1675
1676
1683 public void setPrivateSessionAttributes(boolean privateSessionAttributes) {
1684 _privateSessionAttributes = privateSessionAttributes;
1685 }
1686
1687
1692 public int getRenderWeight() {
1693 return _renderWeight;
1694 }
1695
1696
1701 public void setRenderWeight(int renderWeight) {
1702 _renderWeight = renderWeight;
1703 }
1704
1705
1710 public boolean getAjaxable() {
1711 return _ajaxable;
1712 }
1713
1714
1719 public boolean isAjaxable() {
1720 return _ajaxable;
1721 }
1722
1723
1729 public void setAjaxable(boolean ajaxable) {
1730 _ajaxable = ajaxable;
1731 }
1732
1733
1740 public List<String> getHeaderPortalCss() {
1741 return _headerPortalCss;
1742 }
1743
1744
1751 public void setHeaderPortalCss(List<String> headerPortalCss) {
1752 _headerPortalCss = headerPortalCss;
1753 }
1754
1755
1762 public List<String> getHeaderPortletCss() {
1763 return _headerPortletCss;
1764 }
1765
1766
1774 public void setHeaderPortletCss(List<String> headerPortletCss) {
1775 _headerPortletCss = headerPortletCss;
1776 }
1777
1778
1785 public List<String> getHeaderPortalJavaScript() {
1786 return _headerPortalJavaScript;
1787 }
1788
1789
1797 public void setHeaderPortalJavaScript(List<String> headerPortalJavaScript) {
1798 _headerPortalJavaScript = headerPortalJavaScript;
1799 }
1800
1801
1808 public List<String> getHeaderPortletJavaScript() {
1809 return _headerPortletJavaScript;
1810 }
1811
1812
1820 public void setHeaderPortletJavaScript(
1821 List<String> headerPortletJavaScript) {
1822
1823 _headerPortletJavaScript = headerPortletJavaScript;
1824 }
1825
1826
1833 public List<String> getFooterPortalCss() {
1834 return _footerPortalCss;
1835 }
1836
1837
1844 public void setFooterPortalCss(List<String> footerPortalCss) {
1845 _footerPortalCss = footerPortalCss;
1846 }
1847
1848
1855 public List<String> getFooterPortletCss() {
1856 return _footerPortletCss;
1857 }
1858
1859
1867 public void setFooterPortletCss(List<String> footerPortletCss) {
1868 _footerPortletCss = footerPortletCss;
1869 }
1870
1871
1878 public List<String> getFooterPortalJavaScript() {
1879 return _footerPortalJavaScript;
1880 }
1881
1882
1890 public void setFooterPortalJavaScript(List<String> footerPortalJavaScript) {
1891 _footerPortalJavaScript = footerPortalJavaScript;
1892 }
1893
1894
1901 public List<String> getFooterPortletJavaScript() {
1902 return _footerPortletJavaScript;
1903 }
1904
1905
1913 public void setFooterPortletJavaScript(
1914 List<String> footerPortletJavaScript) {
1915
1916 _footerPortletJavaScript = footerPortletJavaScript;
1917 }
1918
1919
1926 public String getCssClassWrapper() {
1927 return _cssClassWrapper;
1928 }
1929
1930
1937 public void setCssClassWrapper(String cssClassWrapper) {
1938 _cssClassWrapper = cssClassWrapper;
1939 }
1940
1941
1946 public String getFacebookIntegration() {
1947 return _facebookIntegration;
1948 }
1949
1950
1956 public void setFacebookIntegration(String facebookIntegration) {
1957 if (Validator.isNotNull(facebookIntegration)) {
1958 _facebookIntegration = facebookIntegration;
1959 }
1960 }
1961
1962
1968 public boolean getAddDefaultResource() {
1969 return _addDefaultResource;
1970 }
1971
1972
1978 public boolean isAddDefaultResource() {
1979 return _addDefaultResource;
1980 }
1981
1982
1988 public void setAddDefaultResource(boolean addDefaultResource) {
1989 _addDefaultResource = addDefaultResource;
1990 }
1991
1992
1997 public void setRoles(String roles) {
1998 _rolesArray = StringUtil.split(roles);
1999
2000 super.setRoles(roles);
2001 }
2002
2003
2008 public String[] getRolesArray() {
2009 return _rolesArray;
2010 }
2011
2012
2017 public void setRolesArray(String[] rolesArray) {
2018 _rolesArray = rolesArray;
2019
2020 super.setRoles(StringUtil.merge(rolesArray));
2021 }
2022
2023
2028 public Set<String> getUnlinkedRoles() {
2029 return _unlinkedRoles;
2030 }
2031
2032
2037 public void setUnlinkedRoles(Set<String> unlinkedRoles) {
2038 _unlinkedRoles = unlinkedRoles;
2039 }
2040
2041
2046 public Map<String, String> getRoleMappers() {
2047 return _roleMappers;
2048 }
2049
2050
2055 public void setRoleMappers(Map<String, String> roleMappers) {
2056 _roleMappers = roleMappers;
2057 }
2058
2059
2063 public void linkRoles() {
2064 List<String> linkedRoles = new ArrayList<String>();
2065
2066 Iterator<String> itr = _unlinkedRoles.iterator();
2067
2068 while (itr.hasNext()) {
2069 String unlinkedRole = itr.next();
2070
2071 String roleLink = _roleMappers.get(unlinkedRole);
2072
2073 if (Validator.isNotNull(roleLink)) {
2074 if (_log.isDebugEnabled()) {
2075 _log.debug(
2076 "Linking role for portlet [" + getPortletId() +
2077 "] with role-name [" + unlinkedRole +
2078 "] to role-link [" + roleLink + "]");
2079 }
2080
2081 linkedRoles.add(roleLink);
2082 }
2083 else {
2084 _log.error(
2085 "Unable to link role for portlet [" + getPortletId() +
2086 "] with role-name [" + unlinkedRole +
2087 "] because role-link is null");
2088 }
2089 }
2090
2091 String[] array = linkedRoles.toArray(new String[linkedRoles.size()]);
2092
2093 Arrays.sort(array);
2094
2095 setRolesArray(array);
2096 }
2097
2098
2103 public boolean hasRoleWithName(String roleName) {
2104 if ((_rolesArray == null) || (_rolesArray.length == 0)) {
2105 return false;
2106 }
2107
2108 for (int i = 0; i < _rolesArray.length; i++) {
2109 if (_rolesArray[i].equalsIgnoreCase(roleName)) {
2110 return true;
2111 }
2112 }
2113
2114 return false;
2115 }
2116
2117
2124 public boolean hasAddPortletPermission(long userId) {
2125 try {
2126 if ((_rolesArray == null) || (_rolesArray.length == 0)) {
2127 return true;
2128 }
2129 else if (RoleLocalServiceUtil.hasUserRoles(
2130 userId, getCompanyId(), _rolesArray, true)) {
2131
2132 return true;
2133 }
2134 else if (RoleLocalServiceUtil.hasUserRole(
2135 userId, getCompanyId(), RoleConstants.ADMINISTRATOR,
2136 true)) {
2137
2138 return true;
2139 }
2140 else {
2141 User user = UserLocalServiceUtil.getUserById(userId);
2142
2143 if (user.isDefaultUser() &&
2144 hasRoleWithName(RoleConstants.GUEST)) {
2145
2146 return true;
2147 }
2148 }
2149 }
2150 catch (Exception e) {
2151 _log.error(e);
2152 }
2153
2154 return false;
2155 }
2156
2157
2164 public boolean getSystem() {
2165 return _system;
2166 }
2167
2168
2175 public boolean isSystem() {
2176 return _system;
2177 }
2178
2179
2186 public void setSystem(boolean system) {
2187 _system = system;
2188 }
2189
2190
2197 public boolean getInclude() {
2198 return _include;
2199 }
2200
2201
2208 public boolean isInclude() {
2209 return _include;
2210 }
2211
2212
2219 public void setInclude(boolean include) {
2220 _include = include;
2221 }
2222
2223
2228 public Map<String, String> getInitParams() {
2229 return _initParams;
2230 }
2231
2232
2237 public void setInitParams(Map<String, String> initParams) {
2238 _initParams = initParams;
2239 }
2240
2241
2246 public Integer getExpCache() {
2247 return _expCache;
2248 }
2249
2250
2255 public void setExpCache(Integer expCache) {
2256 _expCache = expCache;
2257 }
2258
2259
2264 public Map<String, Set<String>> getPortletModes() {
2265 return _portletModes;
2266 }
2267
2268
2273 public void setPortletModes(Map<String, Set<String>> portletModes) {
2274 _portletModes = portletModes;
2275 }
2276
2277
2284 public boolean hasPortletMode(String mimeType, PortletMode portletMode) {
2285 if (mimeType == null) {
2286 mimeType = ContentTypes.TEXT_HTML;
2287 }
2288
2289 Set<String> mimeTypeModes = _portletModes.get(mimeType);
2290
2291 if (mimeTypeModes == null) {
2292 return false;
2293 }
2294
2295 if (mimeTypeModes.contains(portletMode.toString())) {
2296 return true;
2297 }
2298 else {
2299 return false;
2300 }
2301 }
2302
2303
2308 public Set<String> getAllPortletModes() {
2309 Set<String> allPortletModes = new TreeSet<String>();
2310
2311 Iterator<Map.Entry <String, Set<String>>> itr1 =
2312 _portletModes.entrySet().iterator();
2313
2314 while (itr1.hasNext()) {
2315 Map.Entry<String, Set<String>> entry = itr1.next();
2316
2317 Set<String> mimeTypeModes = entry.getValue();
2318
2319 Iterator<String> itr2 = mimeTypeModes.iterator();
2320
2321 while (itr2.hasNext()) {
2322 String portletMode = itr2.next();
2323
2324 allPortletModes.add(portletMode);
2325 }
2326 }
2327
2328 return allPortletModes;
2329 }
2330
2331
2336 public boolean hasMultipleMimeTypes() {
2337 if (_portletModes.size() > 1) {
2338 return true;
2339 }
2340 else {
2341 return false;
2342 }
2343 }
2344
2345
2350 public Set<String> getSupportedLocales() {
2351 return _supportedLocales;
2352 }
2353
2354
2359 public void setSupportedLocales(Set<String> supportedLocales) {
2360 _supportedLocales = supportedLocales;
2361 }
2362
2363
2368 public String getResourceBundle() {
2369 return _resourceBundle;
2370 }
2371
2372
2377 public void setResourceBundle(String resourceBundle) {
2378 _resourceBundle = resourceBundle;
2379 }
2380
2381
2386 public PortletInfo getPortletInfo() {
2387 return _portletInfo;
2388 }
2389
2390
2395 public void setPortletInfo(PortletInfo portletInfo) {
2396 _portletInfo = portletInfo;
2397 }
2398
2399
2404 public Map<String, PortletFilter> getPortletFilters() {
2405 return _portletFilters;
2406 }
2407
2408
2413 public void setPortletFilters(Map<String, PortletFilter> portletFilters) {
2414 _portletFilters = portletFilters;
2415 }
2416
2417
2422 public void addProcessingEvent(QName processingEvent) {
2423 _processingEvents.add(processingEvent);
2424 _processingEventsByQName.put(
2425 PortletQNameUtil.getKey(processingEvent), processingEvent);
2426 }
2427
2428
2435 public QName getProcessingEvent(String uri, String localPart) {
2436 return _processingEventsByQName.get(
2437 PortletQNameUtil.getKey(uri, localPart));
2438 }
2439
2440
2445 public Set<QName> getProcessingEvents() {
2446 return _processingEvents;
2447 }
2448
2449
2455 public void setProcessingEvents(Set<QName> processingEvents) {
2456 for (QName processingEvent : processingEvents) {
2457 addProcessingEvent(processingEvent);
2458 }
2459 }
2460
2461
2466 public void addPublishingEvent(QName publishingEvent) {
2467 _publishingEvents.add(publishingEvent);
2468 }
2469
2470
2475 public Set<QName> getPublishingEvents() {
2476 return _publishingEvents;
2477 }
2478
2479
2485 public void setPublishingEvents(Set<QName> publishingEvents) {
2486 for (QName publishingEvent : publishingEvents) {
2487 addPublishingEvent(publishingEvent);
2488 }
2489 }
2490
2491
2496 public void addPublicRenderParameter(
2497 PublicRenderParameter publicRenderParameter) {
2498
2499 _publicRenderParameters.add(publicRenderParameter);
2500 _publicRenderParametersByIdentifier.put(
2501 publicRenderParameter.getIdentifier(), publicRenderParameter);
2502 _publicRenderParametersByQName.put(
2503 PortletQNameUtil.getKey(publicRenderParameter.getQName()),
2504 publicRenderParameter);
2505 }
2506
2507
2512 public PublicRenderParameter getPublicRenderParameter(String identifier) {
2513 return _publicRenderParametersByIdentifier.get(identifier);
2514 }
2515
2516
2523 public PublicRenderParameter getPublicRenderParameter(
2524 String uri, String localPart) {
2525
2526 return _publicRenderParametersByQName.get(
2527 PortletQNameUtil.getKey(uri, localPart));
2528 }
2529
2530
2535 public Set<PublicRenderParameter> getPublicRenderParameters() {
2536 return _publicRenderParameters;
2537 }
2538
2539
2545 public void setPublicRenderParameters(
2546 Set<PublicRenderParameter> publicRenderParameters) {
2547
2548 for (PublicRenderParameter publicRenderParameter :
2549 publicRenderParameters) {
2550
2551 addPublicRenderParameter(publicRenderParameter);
2552 }
2553 }
2554
2555
2560 public boolean isRemote() {
2561 return _remote;
2562 }
2563
2564
2569 public void setRemote(boolean remote) {
2570 _remote = remote;
2571 }
2572
2573
2578 public String getRemoteConsumerId() {
2579 return _remoteConsumerId;
2580 }
2581
2582
2587 public void setRemoteConsumerId(String remoteConsumerId) {
2588 _remoteConsumerId = remoteConsumerId;
2589 }
2590
2591
2596 public String getRemoteProducerEntityId() {
2597 return _remoteProducerEntityId;
2598 }
2599
2600
2606 public void setRemoteProducerEntityId(String remoteProducerEntityId) {
2607 _remoteProducerEntityId = remoteProducerEntityId;
2608 }
2609
2610
2615 public String getRemotePortletHandle() {
2616 return _remotePortletHandle;
2617 }
2618
2619
2624 public void setRemotePortletHandle(String remotePortletHandle) {
2625 _remotePortletHandle = remotePortletHandle;
2626 }
2627
2628
2633 public String getRemotePortletId() {
2634 return _remotePortletId;
2635 }
2636
2637
2642 public void setRemotePortletId(String remotePortletId) {
2643 _remotePortletId = remotePortletId;
2644 }
2645
2646
2651 public String getContextPath() {
2652 String virtualPath = getVirtualPath();
2653
2654 if (Validator.isNotNull(virtualPath)) {
2655 return virtualPath;
2656 }
2657
2658 if (_portletApp.isWARFile()) {
2659 StringBuilder sb = new StringBuilder();
2660
2661 sb.append(StringPool.SLASH);
2662 sb.append(_portletApp.getServletContextName());
2663
2664 return sb.toString();
2665 }
2666 else {
2667 return PortalUtil.getPathContext();
2668 }
2669 }
2670
2671
2676 public PortletApp getPortletApp() {
2677 return _portletApp;
2678 }
2679
2680
2685 public void setPortletApp(PortletApp portletApp) {
2686 _portletApp = portletApp;
2687 }
2688
2689
2695 public Portlet getClonedInstance(String portletId) {
2696 if (_clonedInstances == null) {
2697
2698
2700 return null;
2701 }
2702
2703 Portlet clonedInstance = _clonedInstances.get(portletId);
2704
2705 if (clonedInstance == null) {
2706 clonedInstance = (Portlet)clone();
2707
2708 clonedInstance.setPortletId(portletId);
2709
2710
2717 }
2719
2720 return clonedInstance;
2721 }
2722
2723
2729 public boolean getStatic() {
2730 return _staticPortlet;
2731 }
2732
2733
2739 public boolean isStatic() {
2740 return _staticPortlet;
2741 }
2742
2743
2749 public void setStatic(boolean staticPortlet) {
2750 _staticPortlet = staticPortlet;
2751 }
2752
2753
2760 public boolean getStaticStart() {
2761 return _staticPortletStart;
2762 }
2763
2764
2771 public boolean isStaticStart() {
2772 return _staticPortletStart;
2773 }
2774
2775
2782 public void setStaticStart(boolean staticPortletStart) {
2783 _staticPortletStart = staticPortletStart;
2784 }
2785
2786
2793 public boolean getStaticEnd() {
2794 return !_staticPortletStart;
2795 }
2796
2797
2804 public boolean isStaticEnd() {
2805 return !_staticPortletStart;
2806 }
2807
2808
2814 public boolean getUndeployedPortlet() {
2815 return _undeployedPortlet;
2816 }
2817
2818
2824 public boolean isUndeployedPortlet() {
2825 return _undeployedPortlet;
2826 }
2827
2828
2834 public void setUndeployedPortlet(boolean undeployedPortlet) {
2835 _undeployedPortlet = undeployedPortlet;
2836 }
2837
2838
2843 public Object clone() {
2844 Portlet portlet = new PortletImpl(
2845 getPortletId(), getPluginPackage(), getDefaultPluginSetting(),
2846 getCompanyId(), getTimestamp(), getIcon(), getVirtualPath(),
2847 getStrutsPath(), getPortletName(), getDisplayName(),
2848 getPortletClass(), getConfigurationActionClass(), getIndexerClass(),
2849 getOpenSearchClass(), getSchedulerClass(), getPortletURLClass(),
2850 getFriendlyURLMapperClass(), getURLEncoderClass(),
2851 getPortletDataHandlerClass(), getPortletLayoutListenerClass(),
2852 getPollerProcessorClass(), getPopMessageListenerClass(),
2853 getSocialActivityInterpreterClass(),
2854 getSocialRequestInterpreterClass(), getWebDAVStorageToken(),
2855 getWebDAVStorageClass(), getControlPanelEntryCategory(),
2856 getControlPanelEntryWeight(), getControlPanelEntryClass(),
2857 getDefaultPreferences(), getPreferencesValidator(),
2858 isPreferencesCompanyWide(), isPreferencesUniquePerLayout(),
2859 isPreferencesOwnedByGroup(), isUseDefaultTemplate(),
2860 isShowPortletAccessDenied(), isShowPortletInactive(),
2861 isActionURLRedirect(), isRestoreCurrentView(), isMaximizeEdit(),
2862 isMaximizeHelp(), isPopUpPrint(), isLayoutCacheable(),
2863 isInstanceable(), isScopeable(), getUserPrincipalStrategy(),
2864 isPrivateRequestAttributes(), isPrivateSessionAttributes(),
2865 getRenderWeight(), isAjaxable(), getHeaderPortalCss(),
2866 getHeaderPortletCss(), getHeaderPortalJavaScript(),
2867 getHeaderPortletJavaScript(), getFooterPortalCss(),
2868 getFooterPortletCss(), getFooterPortalJavaScript(),
2869 getFooterPortletJavaScript(), getCssClassWrapper(),
2870 getFacebookIntegration(), isAddDefaultResource(), getRoles(),
2871 getUnlinkedRoles(), getRoleMappers(), isSystem(), isActive(),
2872 isInclude(), getInitParams(), getExpCache(), getPortletModes(),
2873 getSupportedLocales(), getResourceBundle(), getPortletInfo(),
2874 getPortletFilters(), getProcessingEvents(), getPublishingEvents(),
2875 getPublicRenderParameters(), isRemote(), getRemoteConsumerId(),
2876 getRemoteProducerEntityId(), getRemotePortletHandle(),
2877 getRemotePortletId(), getPortletApp());
2878
2879 portlet.setId(getId());
2880
2881 return portlet;
2882 }
2883
2884
2893 public int compareTo(Portlet portlet) {
2894 return getPortletId().compareTo(portlet.getPortletId());
2895 }
2896
2897
2903 public boolean equals(Object obj) {
2904 Portlet portlet = (Portlet)obj;
2905
2906 return getPortletId().equals(portlet.getPortletId());
2907 }
2908
2909
2912 private static Log _log = LogFactoryUtil.getLog(PortletImpl.class);
2913
2914
2917 private PluginPackage _pluginPackage;
2918
2919
2922 private PluginSetting _defaultPluginSetting;
2923
2924
2927 private long _timestamp;
2928
2929
2932 private String _icon;
2933
2934
2937 private String _virtualPath;
2938
2939
2942 private String _strutsPath;
2943
2944
2947 private String _portletName;
2948
2949
2952 private String _displayName;
2953
2954
2957 private String _portletClass;
2958
2959
2962 private String _configurationActionClass;
2963
2964
2967 private String _indexerClass;
2968
2969
2972 private String _openSearchClass;
2973
2974
2977 private String _schedulerClass;
2978
2979
2982 private String _portletURLClass;
2983
2984
2987 private String _friendlyURLMapperClass;
2988
2989
2992 private String _urlEncoderClass;
2993
2994
2997 private String _portletDataHandlerClass;
2998
2999
3002 private String _portletLayoutListenerClass;
3003
3004
3007 private String _pollerProcessorClass;
3008
3009
3012 private String _popMessageListenerClass;
3013
3014
3017 private String _socialActivityInterpreterClass;
3018
3019
3022 private String _socialRequestInterpreterClass;
3023
3024
3027 private String _webDAVStorageToken;
3028
3029
3032 private String _webDAVStorageClass;
3033
3034
3037 private String _defaultPreferences;
3038
3039
3042 private String _preferencesValidator;
3043
3044
3047 private boolean _preferencesCompanyWide;
3048
3049
3052 private boolean _preferencesUniquePerLayout = true;
3053
3054
3058 private boolean _preferencesOwnedByGroup = true;
3059
3060
3064 private String _controlPanelEntryCategory;
3065
3066
3070 private double _controlPanelEntryWeight = 100;
3071
3072
3076 private String _controlPanelEntryClass;
3077
3078
3081 private boolean _useDefaultTemplate = true;
3082
3083
3086 private boolean _showPortletAccessDenied =
3087 PropsValues.LAYOUT_SHOW_PORTLET_ACCESS_DENIED;
3088
3089
3092 private boolean _showPortletInactive =
3093 PropsValues.LAYOUT_SHOW_PORTLET_INACTIVE;
3094
3095
3098 private boolean _actionURLRedirect;
3099
3100
3104 private boolean _restoreCurrentView = true;
3105
3106
3110 private boolean _maximizeEdit;
3111
3112
3116 private boolean _maximizeHelp;
3117
3118
3122 private boolean _popUpPrint = true;
3123
3124
3127 private boolean _layoutCacheable;
3128
3129
3132 private boolean _instanceable;
3133
3134
3137 private boolean _scopeable;
3138
3139
3142 private String _userPrincipalStrategy =
3143 PortletConstants.USER_PRINCIPAL_STRATEGY_USER_ID;
3144
3145
3149 private boolean _privateRequestAttributes = true;
3150
3151
3154 private boolean _privateSessionAttributes = true;
3155
3156
3159 private int _renderWeight = 1;
3160
3161
3164 private boolean _ajaxable = true;
3165
3166
3170 private List<String> _headerPortalCss;
3171
3172
3176 private List<String> _headerPortletCss;
3177
3178
3182 private List<String> _headerPortalJavaScript;
3183
3184
3188 private List<String> _headerPortletJavaScript;
3189
3190
3194 private List<String> _footerPortalCss;
3195
3196
3200 private List<String> _footerPortletCss;
3201
3202
3206 private List<String> _footerPortalJavaScript;
3207
3208
3212 private List<String> _footerPortletJavaScript;
3213
3214
3218 private String _cssClassWrapper = StringPool.BLANK;
3219
3220
3223 private String _facebookIntegration =
3224 PortletConstants.FACEBOOK_INTEGRATION_IFRAME;
3225
3226
3229 private boolean _addDefaultResource;
3230
3231
3234 private String[] _rolesArray;
3235
3236
3239 private Set<String> _unlinkedRoles;
3240
3241
3244 private Map<String, String> _roleMappers;
3245
3246
3250 private boolean _system;
3251
3252
3255 private boolean _include = true;
3256
3257
3260 private Map<String, String> _initParams;
3261
3262
3265 private Integer _expCache;
3266
3267
3270 private Map<String, Set<String>> _portletModes;
3271
3272
3275 private Set<String> _supportedLocales;
3276
3277
3280 private String _resourceBundle;
3281
3282
3285 private PortletInfo _portletInfo;
3286
3287
3290 private Map<String, PortletFilter> _portletFilters;
3291
3292
3295 private Set<QName> _processingEvents = new HashSet<QName>();
3296
3297
3300 private Map<String, QName> _processingEventsByQName =
3301 new HashMap<String, QName>();
3302
3303
3306 private Set<QName> _publishingEvents = new HashSet<QName>();
3307
3308
3311 private Set<PublicRenderParameter> _publicRenderParameters =
3312 new HashSet<PublicRenderParameter>();
3313
3314
3318 private Map<String, PublicRenderParameter>
3319 _publicRenderParametersByIdentifier =
3320 new HashMap<String, PublicRenderParameter>();
3321
3322
3326 private Map<String, PublicRenderParameter>
3327 _publicRenderParametersByQName =
3328 new HashMap<String, PublicRenderParameter>();
3329
3330
3333 private boolean _remote = false;
3334
3335
3338 private String _remoteConsumerId;
3339
3340
3343 private String _remoteProducerEntityId;
3344
3345
3348 private String _remotePortletHandle;
3349
3350
3353 private String _remotePortletId;
3354
3355
3358 private PortletApp _portletApp;
3359
3360
3363 private Map<String, Portlet> _clonedInstances;
3364
3365
3368 private boolean _staticPortlet;
3369
3370
3374 private boolean _staticPortletStart;
3375
3376
3379 private boolean _undeployedPortlet = false;
3380
3381}