1
14
15 package com.liferay.portal.model.impl;
16
17 import com.liferay.portal.kernel.lar.PortletDataHandler;
18 import com.liferay.portal.kernel.log.Log;
19 import com.liferay.portal.kernel.log.LogFactoryUtil;
20 import com.liferay.portal.kernel.plugin.PluginPackage;
21 import com.liferay.portal.kernel.poller.PollerProcessor;
22 import com.liferay.portal.kernel.pop.MessageListener;
23 import com.liferay.portal.kernel.portlet.ConfigurationAction;
24 import com.liferay.portal.kernel.portlet.FriendlyURLMapper;
25 import com.liferay.portal.kernel.portlet.PortletBag;
26 import com.liferay.portal.kernel.portlet.PortletBagPool;
27 import com.liferay.portal.kernel.portlet.PortletLayoutListener;
28 import com.liferay.portal.kernel.scheduler.SchedulerEntry;
29 import com.liferay.portal.kernel.search.Indexer;
30 import com.liferay.portal.kernel.search.OpenSearch;
31 import com.liferay.portal.kernel.servlet.URLEncoder;
32 import com.liferay.portal.kernel.util.ContentTypes;
33 import com.liferay.portal.kernel.util.StringPool;
34 import com.liferay.portal.kernel.util.StringUtil;
35 import com.liferay.portal.kernel.util.Validator;
36 import com.liferay.portal.kernel.webdav.WebDAVStorage;
37 import com.liferay.portal.kernel.workflow.WorkflowHandler;
38 import com.liferay.portal.kernel.xml.QName;
39 import com.liferay.portal.kernel.xmlrpc.Method;
40 import com.liferay.portal.model.Plugin;
41 import com.liferay.portal.model.PluginSetting;
42 import com.liferay.portal.model.Portlet;
43 import com.liferay.portal.model.PortletApp;
44 import com.liferay.portal.model.PortletConstants;
45 import com.liferay.portal.model.PortletFilter;
46 import com.liferay.portal.model.PortletInfo;
47 import com.liferay.portal.model.PublicRenderParameter;
48 import com.liferay.portal.model.User;
49 import com.liferay.portal.security.permission.ActionKeys;
50 import com.liferay.portal.security.permission.PermissionChecker;
51 import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil;
52 import com.liferay.portal.security.permission.PermissionThreadLocal;
53 import com.liferay.portal.service.UserLocalServiceUtil;
54 import com.liferay.portal.service.permission.PortletPermissionUtil;
55 import com.liferay.portal.util.PortalUtil;
56 import com.liferay.portal.util.PropsValues;
57 import com.liferay.portlet.ControlPanelEntry;
58 import com.liferay.portlet.PortletQNameUtil;
59 import com.liferay.portlet.asset.model.AssetRendererFactory;
60 import com.liferay.portlet.expando.model.CustomAttributesDisplay;
61 import com.liferay.portlet.social.model.SocialActivityInterpreter;
62 import com.liferay.portlet.social.model.SocialRequestInterpreter;
63
64 import java.util.ArrayList;
65 import java.util.Arrays;
66 import java.util.HashMap;
67 import java.util.HashSet;
68 import java.util.Hashtable;
69 import java.util.Iterator;
70 import java.util.LinkedHashMap;
71 import java.util.List;
72 import java.util.Map;
73 import java.util.Set;
74 import java.util.TreeSet;
75
76 import javax.portlet.PortletMode;
77 import javax.portlet.WindowState;
78
79
84 public class PortletImpl extends PortletModelImpl implements Portlet {
85
86
89 public PortletImpl() {
90 }
91
92
95 public PortletImpl(long companyId, String portletId) {
96 setCompanyId(companyId);
97 setPortletId(portletId);
98 setStrutsPath(portletId);
99 setActive(true);
100 _schedulerEntries = new ArrayList<SchedulerEntry>();
101 _assetRendererFactoryClasses = new ArrayList<String>();
102 _customAttributesDisplayClasses = new ArrayList<String>();
103 _workflowHandlerClasses = new ArrayList<String>();
104 _headerPortalCss = new ArrayList<String>();
105 _headerPortletCss = new ArrayList<String>();
106 _headerPortalJavaScript = new ArrayList<String>();
107 _headerPortletJavaScript = new ArrayList<String>();
108 _footerPortalCss = new ArrayList<String>();
109 _footerPortletCss = new ArrayList<String>();
110 _footerPortalJavaScript = new ArrayList<String>();
111 _footerPortletJavaScript = new ArrayList<String>();
112 _unlinkedRoles = new HashSet<String>();
113 _roleMappers = new LinkedHashMap<String, String>();
114 _initParams = new HashMap<String, String>();
115 _portletModes = new HashMap<String, Set<String>>();
116 _windowStates = new HashMap<String, Set<String>>();
117 _supportedLocales = new HashSet<String>();
118 _portletFilters = new LinkedHashMap<String, PortletFilter>();
119 _processingEvents = new HashSet<QName>();
120 _publishingEvents = new HashSet<QName>();
121 _publicRenderParameters = new HashSet<PublicRenderParameter>();
122 }
123
124
127 public PortletImpl(
128 String portletId, PluginPackage pluginPackage,
129 PluginSetting pluginSetting, long companyId, long timestamp,
130 String icon, String virtualPath, String strutsPath, String portletName,
131 String displayName, String portletClass,
132 String configurationActionClass, String indexerClass,
133 String openSearchClass, List<SchedulerEntry> schedulerEntries,
134 String portletURLClass, String friendlyURLMapperClass,
135 String friendlyURLRoutes, String urlEncoderClass,
136 String portletDataHandlerClass, String portletLayoutListenerClass,
137 String pollerProcessorClass, String popMessageListenerClass,
138 String socialActivityInterpreterClass,
139 String socialRequestInterpreterClass, String webDAVStorageToken,
140 String webDAVStorageClass, String xmlRpcMethodClass,
141 String controlPanelEntryCategory, double controlPanelEntryWeight,
142 String controlPanelClass, List<String> assetRendererFactoryClasses,
143 List<String> customAttributesDisplayClasses,
144 List<String> workflowHandlerClasses, String defaultPreferences,
145 String preferencesValidator, boolean preferencesCompanyWide,
146 boolean preferencesUniquePerLayout, boolean preferencesOwnedByGroup,
147 boolean useDefaultTemplate, boolean showPortletAccessDenied,
148 boolean showPortletInactive, boolean actionURLRedirect,
149 boolean restoreCurrentView, boolean maximizeEdit, boolean maximizeHelp,
150 boolean popUpPrint, boolean layoutCacheable, boolean instanceable,
151 boolean scopeable, String userPrincipalStrategy,
152 boolean privateRequestAttributes, boolean privateSessionAttributes,
153 int renderWeight, boolean ajaxable, List<String> headerPortalCss,
154 List<String> headerPortletCss, List<String> headerPortalJavaScript,
155 List<String> headerPortletJavaScript, List<String> footerPortalCss,
156 List<String> footerPortletCss, List<String> footerPortalJavaScript,
157 List<String> footerPortletJavaScript, String cssClassWrapper,
158 String facebookIntegration, boolean addDefaultResource, String roles,
159 Set<String> unlinkedRoles, Map<String, String> roleMappers,
160 boolean system, boolean active, boolean include,
161 Map<String, String> initParams, Integer expCache,
162 Map<String, Set<String>> portletModes,
163 Map<String, Set<String>> windowStates, Set<String> supportedLocales,
164 String resourceBundle, PortletInfo portletInfo,
165 Map<String, PortletFilter> portletFilters, Set<QName> processingEvents,
166 Set<QName> publishingEvents,
167 Set<PublicRenderParameter> publicRenderParameters,
168 PortletApp portletApp) {
169
170 setPortletId(portletId);
171 _pluginPackage = pluginPackage;
172 _defaultPluginSetting = pluginSetting;
173 setCompanyId(companyId);
174 _timestamp = timestamp;
175 _icon = icon;
176 _virtualPath = virtualPath;
177 _strutsPath = strutsPath;
178 _portletName = portletName;
179 _displayName = displayName;
180 _portletClass = portletClass;
181 _configurationActionClass = configurationActionClass;
182 _indexerClass = indexerClass;
183 _openSearchClass = openSearchClass;
184 _schedulerEntries = schedulerEntries;
185 _portletURLClass = portletURLClass;
186 _friendlyURLMapperClass = friendlyURLMapperClass;
187 _friendlyURLRoutes = friendlyURLRoutes;
188 _urlEncoderClass = urlEncoderClass;
189 _portletDataHandlerClass = portletDataHandlerClass;
190 _portletLayoutListenerClass = portletLayoutListenerClass;
191 _pollerProcessorClass = pollerProcessorClass;
192 _popMessageListenerClass = popMessageListenerClass;
193 _socialActivityInterpreterClass = socialActivityInterpreterClass;
194 _socialRequestInterpreterClass = socialRequestInterpreterClass;
195 _webDAVStorageToken = webDAVStorageToken;
196 _webDAVStorageClass = webDAVStorageClass;
197 _xmlRpcMethodClass = xmlRpcMethodClass;
198 _controlPanelEntryCategory = controlPanelEntryCategory;
199 _controlPanelEntryWeight = controlPanelEntryWeight;
200 _controlPanelEntryClass = controlPanelClass;
201 _assetRendererFactoryClasses = assetRendererFactoryClasses;
202 _customAttributesDisplayClasses = customAttributesDisplayClasses;
203 _workflowHandlerClasses = workflowHandlerClasses;
204 _defaultPreferences = defaultPreferences;
205 _preferencesValidator = preferencesValidator;
206 _preferencesCompanyWide = preferencesCompanyWide;
207 _preferencesUniquePerLayout = preferencesUniquePerLayout;
208 _preferencesOwnedByGroup = preferencesOwnedByGroup;
209 _useDefaultTemplate = useDefaultTemplate;
210 _showPortletAccessDenied = showPortletAccessDenied;
211 _showPortletInactive = showPortletInactive;
212 _actionURLRedirect = actionURLRedirect;
213 _restoreCurrentView = restoreCurrentView;
214 _maximizeEdit = maximizeEdit;
215 _maximizeHelp = maximizeHelp;
216 _popUpPrint = popUpPrint;
217 _layoutCacheable = layoutCacheable;
218 _instanceable = instanceable;
219 _scopeable = scopeable;
220 _userPrincipalStrategy = userPrincipalStrategy;
221 _privateRequestAttributes = privateRequestAttributes;
222 _privateSessionAttributes = privateSessionAttributes;
223 _renderWeight = renderWeight;
224 _ajaxable = ajaxable;
225 _headerPortalCss = headerPortalCss;
226 _headerPortletCss = headerPortletCss;
227 _headerPortalJavaScript = headerPortalJavaScript;
228 _headerPortletJavaScript = headerPortletJavaScript;
229 _footerPortalCss = footerPortalCss;
230 _footerPortletCss = footerPortletCss;
231 _footerPortalJavaScript = footerPortalJavaScript;
232 _footerPortletJavaScript = footerPortletJavaScript;
233 _cssClassWrapper = cssClassWrapper;
234 _facebookIntegration = facebookIntegration;
235 _scopeable = scopeable;
236 _addDefaultResource = addDefaultResource;
237 setRoles(roles);
238 _unlinkedRoles = unlinkedRoles;
239 _roleMappers = roleMappers;
240 _system = system;
241 setActive(active);
242 _include = include;
243 _initParams = initParams;
244 _expCache = expCache;
245 _portletModes = portletModes;
246 _windowStates = windowStates;
247 _supportedLocales = supportedLocales;
248 _resourceBundle = resourceBundle;
249 _portletInfo = portletInfo;
250 _portletFilters = portletFilters;
251 setProcessingEvents(processingEvents);
252 setPublishingEvents(publishingEvents);
253 setPublicRenderParameters(publicRenderParameters);
254 _portletApp = portletApp;
255
256 if (_instanceable) {
257 _clonedInstances = new Hashtable<String, Portlet>();
258 }
259 }
260
261
266 public String getRootPortletId() {
267 return PortletConstants.getRootPortletId(getPortletId());
268 }
269
270
275 public String getInstanceId() {
276 return PortletConstants.getInstanceId(getPortletId());
277 }
278
279
284 public String getPluginId() {
285 return getRootPortletId();
286 }
287
288
293 public String getPluginType() {
294 return Plugin.TYPE_PORTLET;
295 }
296
297
302 public PluginPackage getPluginPackage() {
303 return _pluginPackage;
304 }
305
306
311 public void setPluginPackage(PluginPackage pluginPackage) {
312 _pluginPackage = pluginPackage;
313 }
314
315
320 public PluginSetting getDefaultPluginSetting() {
321 return _defaultPluginSetting;
322 }
323
324
329 public void setDefaultPluginSetting(PluginSetting pluginSetting) {
330 _defaultPluginSetting = pluginSetting;
331 }
332
333
338 public long getTimestamp() {
339 return _timestamp;
340 }
341
342
347 public void setTimestamp(long timestamp) {
348 _timestamp = timestamp;
349 }
350
351
356 public String getIcon() {
357 return _icon;
358 }
359
360
365 public void setIcon(String icon) {
366 _icon = icon;
367 }
368
369
374 public String getVirtualPath() {
375 return _virtualPath;
376 }
377
378
383 public void setVirtualPath(String virtualPath) {
384 if (_portletApp.isWARFile() && Validator.isNull(virtualPath)) {
385 virtualPath = PropsValues.PORTLET_VIRTUAL_PATH;
386 }
387
388 _virtualPath = virtualPath;
389 }
390
391
396 public String getStrutsPath() {
397 return _strutsPath;
398 }
399
400
405 public void setStrutsPath(String strutsPath) {
406 _strutsPath = strutsPath;
407 }
408
409
414 public String getPortletName() {
415 return _portletName;
416 }
417
418
423 public void setPortletName(String portletName) {
424 _portletName = portletName;
425 }
426
427
432 public String getDisplayName() {
433 return _displayName;
434 }
435
436
441 public void setDisplayName(String displayName) {
442 _displayName = displayName;
443 }
444
445
450 public String getPortletClass() {
451 return _portletClass;
452 }
453
454
459 public void setPortletClass(String portletClass) {
460 _portletClass = portletClass;
461 }
462
463
468 public String getConfigurationActionClass() {
469 return _configurationActionClass;
470 }
471
472
478 public void setConfigurationActionClass(String configurationActionClass) {
479 _configurationActionClass = configurationActionClass;
480 }
481
482
487 public ConfigurationAction getConfigurationActionInstance() {
488 if (Validator.isNull(getConfigurationActionClass())) {
489 return null;
490 }
491
492 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
493
494 return portletBag.getConfigurationActionInstance();
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 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
526
527 return portletBag.getIndexerInstance();
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 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
559
560 return portletBag.getOpenSearchInstance();
561 }
562
563
566 public void addSchedulerEntry(SchedulerEntry schedulerEntry) {
567 _schedulerEntries.add(schedulerEntry);
568 }
569
570
575 public List<SchedulerEntry> getSchedulerEntries() {
576 return _schedulerEntries;
577 }
578
579
584 public void setSchedulerEntries(List<SchedulerEntry> schedulerEntries) {
585 for (SchedulerEntry schedulerEntry : schedulerEntries) {
586 addSchedulerEntry(schedulerEntry);
587 }
588 }
589
590
595 public String getPortletURLClass() {
596 return _portletURLClass;
597 }
598
599
604 public void setPortletURLClass(String portletURLClass) {
605 _portletURLClass = portletURLClass;
606 }
607
608
613 public String getFriendlyURLMapperClass() {
614 return _friendlyURLMapperClass;
615 }
616
617
623 public void setFriendlyURLMapperClass(String friendlyURLMapperClass) {
624 _friendlyURLMapperClass = friendlyURLMapperClass;
625 }
626
627
632 public FriendlyURLMapper getFriendlyURLMapperInstance() {
633 if (Validator.isNull(getFriendlyURLMapperClass())) {
634 return null;
635 }
636
637 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
638
639 return portletBag.getFriendlyURLMapperInstance();
640 }
641
642
649 public String getFriendlyURLRoutes() {
650 return _friendlyURLRoutes;
651 }
652
653
660 public void setFriendlyURLRoutes(String friendlyURLRoutes) {
661 _friendlyURLRoutes = friendlyURLRoutes;
662 }
663
664
669 public String getURLEncoderClass() {
670 return _urlEncoderClass;
671 }
672
673
678 public void setURLEncoderClass(String urlEncoderClass) {
679 _urlEncoderClass = urlEncoderClass;
680 }
681
682
687 public URLEncoder getURLEncoderInstance() {
688 if (Validator.isNull(getURLEncoderClass())) {
689 return null;
690 }
691
692 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
693
694 return portletBag.getURLEncoderInstance();
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 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
727
728 return portletBag.getPortletDataHandlerInstance();
729 }
730
731
736 public String getPortletLayoutListenerClass() {
737 return _portletLayoutListenerClass;
738 }
739
740
746 public void setPortletLayoutListenerClass(
747 String portletLayoutListenerClass) {
748
749 _portletLayoutListenerClass = portletLayoutListenerClass;
750 }
751
752
757 public PortletLayoutListener getPortletLayoutListenerInstance() {
758 if (Validator.isNull(getPortletLayoutListenerClass())) {
759 return null;
760 }
761
762 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
763
764 return portletBag.getPortletLayoutListenerInstance();
765 }
766
767
772 public String getPollerProcessorClass() {
773 return _pollerProcessorClass;
774 }
775
776
782 public void setPollerProcessorClass(String pollerProcessorClass) {
783 _pollerProcessorClass = pollerProcessorClass;
784 }
785
786
791 public PollerProcessor getPollerProcessorInstance() {
792 if (Validator.isNull(getPollerProcessorClass())) {
793 return null;
794 }
795
796 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
797
798 return portletBag.getPollerProcessorInstance();
799 }
800
801
806 public String getPopMessageListenerClass() {
807 return _popMessageListenerClass;
808 }
809
810
816 public void setPopMessageListenerClass(String popMessageListenerClass) {
817 _popMessageListenerClass = popMessageListenerClass;
818 }
819
820
825 public MessageListener getPopMessageListenerInstance() {
826 if (Validator.isNull(getPopMessageListenerClass())) {
827 return null;
828 }
829
830 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
831
832 return portletBag.getPopMessageListenerInstance();
833 }
834
835
840 public String getSocialActivityInterpreterClass() {
841 return _socialActivityInterpreterClass;
842 }
843
844
850 public void setSocialActivityInterpreterClass(
851 String socialActivityInterpreterClass) {
852
853 _socialActivityInterpreterClass = socialActivityInterpreterClass;
854 }
855
856
862 public SocialActivityInterpreter getSocialActivityInterpreterInstance() {
863 if (Validator.isNull(getSocialActivityInterpreterClass())) {
864 return null;
865 }
866
867 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
868
869 return portletBag.getSocialActivityInterpreterInstance();
870 }
871
872
877 public String getSocialRequestInterpreterClass() {
878 return _socialRequestInterpreterClass;
879 }
880
881
887 public void setSocialRequestInterpreterClass(
888 String socialRequestInterpreterClass) {
889
890 _socialRequestInterpreterClass = socialRequestInterpreterClass;
891 }
892
893
899 public SocialRequestInterpreter getSocialRequestInterpreterInstance() {
900 if (Validator.isNull(getSocialRequestInterpreterClass())) {
901 return null;
902 }
903
904 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
905
906 return portletBag.getSocialRequestInterpreterInstance();
907 }
908
909
914 public String getWebDAVStorageToken() {
915 return _webDAVStorageToken;
916 }
917
918
924 public void setWebDAVStorageToken(String webDAVStorageToken) {
925 _webDAVStorageToken = webDAVStorageToken;
926 }
927
928
933 public String getWebDAVStorageClass() {
934 return _webDAVStorageClass;
935 }
936
937
943 public void setWebDAVStorageClass(String webDAVStorageClass) {
944 _webDAVStorageClass = webDAVStorageClass;
945 }
946
947
952 public WebDAVStorage getWebDAVStorageInstance() {
953 if (Validator.isNull(getWebDAVStorageClass())) {
954 return null;
955 }
956
957 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
958
959 return portletBag.getWebDAVStorageInstance();
960 }
961
962
967 public String getXmlRpcMethodClass() {
968 return _xmlRpcMethodClass;
969 }
970
971
977 public void setXmlRpcMethodClass(String xmlRpcMethodClass) {
978 _xmlRpcMethodClass = xmlRpcMethodClass;
979 }
980
981
986 public Method getXmlRpcMethodInstance() {
987 if (Validator.isNull(getXmlRpcMethodClass())) {
988 return null;
989 }
990
991 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
992
993 return portletBag.getXmlRpcMethodInstance();
994 }
995
996
1003 public String getControlPanelEntryCategory() {
1004 return _controlPanelEntryCategory;
1005 }
1006
1007
1014 public void setControlPanelEntryCategory(String controlPanelEntryCategory) {
1015 _controlPanelEntryCategory = controlPanelEntryCategory;
1016 }
1017
1018
1025 public double getControlPanelEntryWeight() {
1026 return _controlPanelEntryWeight;
1027 }
1028
1029
1037 public void setControlPanelEntryWeight(double controlPanelEntryWeight) {
1038 _controlPanelEntryWeight = controlPanelEntryWeight;
1039 }
1040
1041
1048 public String getControlPanelEntryClass() {
1049 return _controlPanelEntryClass;
1050 }
1051
1052
1059 public void setControlPanelEntryClass(String controlPanelEntryClass) {
1060 _controlPanelEntryClass = controlPanelEntryClass;
1061 }
1062
1063
1070 public ControlPanelEntry getControlPanelEntryInstance() {
1071 if (Validator.isNull(getControlPanelEntryClass())) {
1072 return null;
1073 }
1074
1075 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1076
1077 return portletBag.getControlPanelEntryInstance();
1078 }
1079
1080
1087 public List<String> getAssetRendererFactoryClasses() {
1088 return _assetRendererFactoryClasses;
1089 }
1090
1091
1098 public void setAssetRendererFactoryClasses(
1099 List<String> assetRendererFactoryClasses) {
1100
1101 _assetRendererFactoryClasses = assetRendererFactoryClasses;
1102 }
1103
1104
1109 public List<AssetRendererFactory> getAssetRendererFactoryInstances() {
1110 if (getAssetRendererFactoryClasses().isEmpty()) {
1111 return null;
1112 }
1113
1114 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1115
1116 return portletBag.getAssetRendererFactoryInstances();
1117 }
1118
1119
1126 public List<String> getCustomAttributesDisplayClasses() {
1127 return _customAttributesDisplayClasses;
1128 }
1129
1130
1137 public void setCustomAttributesDisplayClasses(
1138 List<String> customAttributesDisplayClasses) {
1139
1140 _customAttributesDisplayClasses = customAttributesDisplayClasses;
1141 }
1142
1143
1148 public List<CustomAttributesDisplay> getCustomAttributesDisplayInstances() {
1149 if (getCustomAttributesDisplayClasses().isEmpty()) {
1150 return null;
1151 }
1152
1153 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1154
1155 return portletBag.getCustomAttributesDisplayInstances();
1156 }
1157
1158
1165 public List<String> getWorkflowHandlerClasses() {
1166 return _workflowHandlerClasses;
1167 }
1168
1169
1176 public void setWorkflowHandlerClasses(List<String> workflowHandlerClasses) {
1177 _workflowHandlerClasses = workflowHandlerClasses;
1178 }
1179
1180
1185 public List<WorkflowHandler> getWorkflowHandlerInstances() {
1186 if (getWorkflowHandlerClasses().isEmpty()) {
1187 return null;
1188 }
1189
1190 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1191
1192 return portletBag.getWorkflowHandlerInstances();
1193 }
1194
1195
1200 public String getDefaultPreferences() {
1201 if (Validator.isNull(_defaultPreferences)) {
1202 return PortletConstants.DEFAULT_PREFERENCES;
1203 }
1204 else {
1205 return _defaultPreferences;
1206 }
1207 }
1208
1209
1214 public void setDefaultPreferences(String defaultPreferences) {
1215 _defaultPreferences = defaultPreferences;
1216 }
1217
1218
1223 public String getPreferencesValidator() {
1224 return _preferencesValidator;
1225 }
1226
1227
1233 public void setPreferencesValidator(String preferencesValidator) {
1234 if (preferencesValidator != null) {
1235
1236
1239 _preferencesValidator = preferencesValidator.trim();
1240 }
1241 else {
1242 _preferencesValidator = null;
1243 }
1244 }
1245
1246
1251 public boolean getPreferencesCompanyWide() {
1252 return _preferencesCompanyWide;
1253 }
1254
1255
1260 public boolean isPreferencesCompanyWide() {
1261 return _preferencesCompanyWide;
1262 }
1263
1264
1270 public void setPreferencesCompanyWide(boolean preferencesCompanyWide) {
1271 _preferencesCompanyWide = preferencesCompanyWide;
1272 }
1273
1274
1279 public boolean getPreferencesUniquePerLayout() {
1280 return _preferencesUniquePerLayout;
1281 }
1282
1283
1288 public boolean isPreferencesUniquePerLayout() {
1289 return _preferencesUniquePerLayout;
1290 }
1291
1292
1298 public void setPreferencesUniquePerLayout(
1299 boolean preferencesUniquePerLayout) {
1300
1301 _preferencesUniquePerLayout = preferencesUniquePerLayout;
1302 }
1303
1304
1313 public boolean getPreferencesOwnedByGroup() {
1314 return _preferencesOwnedByGroup;
1315 }
1316
1317
1326 public boolean isPreferencesOwnedByGroup() {
1327 return _preferencesOwnedByGroup;
1328 }
1329
1330
1339 public void setPreferencesOwnedByGroup(boolean preferencesOwnedByGroup) {
1340 _preferencesOwnedByGroup = preferencesOwnedByGroup;
1341 }
1342
1343
1348 public boolean getUseDefaultTemplate() {
1349 return _useDefaultTemplate;
1350 }
1351
1352
1357 public boolean isUseDefaultTemplate() {
1358 return _useDefaultTemplate;
1359 }
1360
1361
1367 public void setUseDefaultTemplate(boolean useDefaultTemplate) {
1368 _useDefaultTemplate = useDefaultTemplate;
1369 }
1370
1371
1378 public boolean getShowPortletAccessDenied() {
1379 return _showPortletAccessDenied;
1380 }
1381
1382
1389 public boolean isShowPortletAccessDenied() {
1390 return _showPortletAccessDenied;
1391 }
1392
1393
1400 public void setShowPortletAccessDenied(boolean showPortletAccessDenied) {
1401 _showPortletAccessDenied = showPortletAccessDenied;
1402 }
1403
1404
1409 public boolean getShowPortletInactive() {
1410 return _showPortletInactive;
1411 }
1412
1413
1418 public boolean isShowPortletInactive() {
1419 return _showPortletInactive;
1420 }
1421
1422
1428 public void setShowPortletInactive(boolean showPortletInactive) {
1429 _showPortletInactive = showPortletInactive;
1430 }
1431
1432
1439 public boolean getActionURLRedirect() {
1440 return _actionURLRedirect;
1441 }
1442
1443
1450 public boolean isActionURLRedirect() {
1451 return _actionURLRedirect;
1452 }
1453
1454
1461 public void setActionURLRedirect(boolean actionURLRedirect) {
1462 _actionURLRedirect = actionURLRedirect;
1463 }
1464
1465
1472 public boolean getRestoreCurrentView() {
1473 return _restoreCurrentView;
1474 }
1475
1476
1483 public boolean isRestoreCurrentView() {
1484 return _restoreCurrentView;
1485 }
1486
1487
1494 public void setRestoreCurrentView(boolean restoreCurrentView) {
1495 _restoreCurrentView = restoreCurrentView;
1496 }
1497
1498
1505 public boolean getMaximizeEdit() {
1506 return _maximizeEdit;
1507 }
1508
1509
1516 public boolean isMaximizeEdit() {
1517 return _maximizeEdit;
1518 }
1519
1520
1527 public void setMaximizeEdit(boolean maximizeEdit) {
1528 _maximizeEdit = maximizeEdit;
1529 }
1530
1531
1538 public boolean getMaximizeHelp() {
1539 return _maximizeHelp;
1540 }
1541
1542
1549 public boolean isMaximizeHelp() {
1550 return _maximizeHelp;
1551 }
1552
1553
1560 public void setMaximizeHelp(boolean maximizeHelp) {
1561 _maximizeHelp = maximizeHelp;
1562 }
1563
1564
1571 public boolean getPopUpPrint() {
1572 return _popUpPrint;
1573 }
1574
1575
1582 public boolean isPopUpPrint() {
1583 return _popUpPrint;
1584 }
1585
1586
1593 public void setPopUpPrint(boolean popUpPrint) {
1594 _popUpPrint = popUpPrint;
1595 }
1596
1597
1602 public boolean getLayoutCacheable() {
1603 return _layoutCacheable;
1604 }
1605
1606
1611 public boolean isLayoutCacheable() {
1612 return _layoutCacheable;
1613 }
1614
1615
1621 public void setLayoutCacheable(boolean layoutCacheable) {
1622 _layoutCacheable = layoutCacheable;
1623 }
1624
1625
1630 public boolean getInstanceable() {
1631 return _instanceable;
1632 }
1633
1634
1639 public boolean isInstanceable() {
1640 return _instanceable;
1641 }
1642
1643
1649 public void setInstanceable(boolean instanceable) {
1650 _instanceable = instanceable;
1651 }
1652
1653
1658 public boolean getScopeable() {
1659 return _scopeable;
1660 }
1661
1662
1667 public boolean isScopeable() {
1668 return _scopeable;
1669 }
1670
1671
1677 public void setScopeable(boolean scopeable) {
1678 _scopeable = scopeable;
1679 }
1680
1681
1686 public String getUserPrincipalStrategy() {
1687 return _userPrincipalStrategy;
1688 }
1689
1690
1695 public void setUserPrincipalStrategy(String userPrincipalStrategy) {
1696 if (Validator.isNotNull(userPrincipalStrategy)) {
1697 _userPrincipalStrategy = userPrincipalStrategy;
1698 }
1699 }
1700
1701
1708 public boolean getPrivateRequestAttributes() {
1709 return _privateRequestAttributes;
1710 }
1711
1712
1719 public boolean isPrivateRequestAttributes() {
1720 return _privateRequestAttributes;
1721 }
1722
1723
1731 public void setPrivateRequestAttributes(boolean privateRequestAttributes) {
1732 _privateRequestAttributes = privateRequestAttributes;
1733 }
1734
1735
1742 public boolean getPrivateSessionAttributes() {
1743 return _privateSessionAttributes;
1744 }
1745
1746
1753 public boolean isPrivateSessionAttributes() {
1754 return _privateSessionAttributes;
1755 }
1756
1757
1764 public void setPrivateSessionAttributes(boolean privateSessionAttributes) {
1765 _privateSessionAttributes = privateSessionAttributes;
1766 }
1767
1768
1773 public int getRenderWeight() {
1774 return _renderWeight;
1775 }
1776
1777
1782 public void setRenderWeight(int renderWeight) {
1783 _renderWeight = renderWeight;
1784 }
1785
1786
1791 public boolean getAjaxable() {
1792 return _ajaxable;
1793 }
1794
1795
1800 public boolean isAjaxable() {
1801 return _ajaxable;
1802 }
1803
1804
1810 public void setAjaxable(boolean ajaxable) {
1811 _ajaxable = ajaxable;
1812 }
1813
1814
1821 public List<String> getHeaderPortalCss() {
1822 return _headerPortalCss;
1823 }
1824
1825
1832 public void setHeaderPortalCss(List<String> headerPortalCss) {
1833 _headerPortalCss = headerPortalCss;
1834 }
1835
1836
1843 public List<String> getHeaderPortletCss() {
1844 return _headerPortletCss;
1845 }
1846
1847
1854 public void setHeaderPortletCss(List<String> headerPortletCss) {
1855 _headerPortletCss = headerPortletCss;
1856 }
1857
1858
1865 public List<String> getHeaderPortalJavaScript() {
1866 return _headerPortalJavaScript;
1867 }
1868
1869
1877 public void setHeaderPortalJavaScript(List<String> headerPortalJavaScript) {
1878 _headerPortalJavaScript = headerPortalJavaScript;
1879 }
1880
1881
1888 public List<String> getHeaderPortletJavaScript() {
1889 return _headerPortletJavaScript;
1890 }
1891
1892
1900 public void setHeaderPortletJavaScript(
1901 List<String> headerPortletJavaScript) {
1902
1903 _headerPortletJavaScript = headerPortletJavaScript;
1904 }
1905
1906
1913 public List<String> getFooterPortalCss() {
1914 return _footerPortalCss;
1915 }
1916
1917
1924 public void setFooterPortalCss(List<String> footerPortalCss) {
1925 _footerPortalCss = footerPortalCss;
1926 }
1927
1928
1935 public List<String> getFooterPortletCss() {
1936 return _footerPortletCss;
1937 }
1938
1939
1946 public void setFooterPortletCss(List<String> footerPortletCss) {
1947 _footerPortletCss = footerPortletCss;
1948 }
1949
1950
1957 public List<String> getFooterPortalJavaScript() {
1958 return _footerPortalJavaScript;
1959 }
1960
1961
1969 public void setFooterPortalJavaScript(List<String> footerPortalJavaScript) {
1970 _footerPortalJavaScript = footerPortalJavaScript;
1971 }
1972
1973
1980 public List<String> getFooterPortletJavaScript() {
1981 return _footerPortletJavaScript;
1982 }
1983
1984
1992 public void setFooterPortletJavaScript(
1993 List<String> footerPortletJavaScript) {
1994
1995 _footerPortletJavaScript = footerPortletJavaScript;
1996 }
1997
1998
2005 public String getCssClassWrapper() {
2006 return _cssClassWrapper;
2007 }
2008
2009
2016 public void setCssClassWrapper(String cssClassWrapper) {
2017 _cssClassWrapper = cssClassWrapper;
2018 }
2019
2020
2025 public String getFacebookIntegration() {
2026 return _facebookIntegration;
2027 }
2028
2029
2034 public void setFacebookIntegration(String facebookIntegration) {
2035 if (Validator.isNotNull(facebookIntegration)) {
2036 _facebookIntegration = facebookIntegration;
2037 }
2038 }
2039
2040
2045 public boolean getAddDefaultResource() {
2046 return _addDefaultResource;
2047 }
2048
2049
2054 public boolean isAddDefaultResource() {
2055 return _addDefaultResource;
2056 }
2057
2058
2064 public void setAddDefaultResource(boolean addDefaultResource) {
2065 _addDefaultResource = addDefaultResource;
2066 }
2067
2068
2073 public void setRoles(String roles) {
2074 _rolesArray = StringUtil.split(roles);
2075
2076 super.setRoles(roles);
2077 }
2078
2079
2084 public String[] getRolesArray() {
2085 return _rolesArray;
2086 }
2087
2088
2093 public void setRolesArray(String[] rolesArray) {
2094 _rolesArray = rolesArray;
2095
2096 super.setRoles(StringUtil.merge(rolesArray));
2097 }
2098
2099
2104 public Set<String> getUnlinkedRoles() {
2105 return _unlinkedRoles;
2106 }
2107
2108
2113 public void setUnlinkedRoles(Set<String> unlinkedRoles) {
2114 _unlinkedRoles = unlinkedRoles;
2115 }
2116
2117
2122 public Map<String, String> getRoleMappers() {
2123 return _roleMappers;
2124 }
2125
2126
2131 public void setRoleMappers(Map<String, String> roleMappers) {
2132 _roleMappers = roleMappers;
2133 }
2134
2135
2139 public void linkRoles() {
2140 List<String> linkedRoles = new ArrayList<String>();
2141
2142 Iterator<String> itr = _unlinkedRoles.iterator();
2143
2144 while (itr.hasNext()) {
2145 String unlinkedRole = itr.next();
2146
2147 String roleLink = _roleMappers.get(unlinkedRole);
2148
2149 if (Validator.isNotNull(roleLink)) {
2150 if (_log.isDebugEnabled()) {
2151 _log.debug(
2152 "Linking role for portlet [" + getPortletId() +
2153 "] with role-name [" + unlinkedRole +
2154 "] to role-link [" + roleLink + "]");
2155 }
2156
2157 linkedRoles.add(roleLink);
2158 }
2159 else {
2160 _log.error(
2161 "Unable to link role for portlet [" + getPortletId() +
2162 "] with role-name [" + unlinkedRole +
2163 "] because role-link is null");
2164 }
2165 }
2166
2167 String[] array = linkedRoles.toArray(new String[linkedRoles.size()]);
2168
2169 Arrays.sort(array);
2170
2171 setRolesArray(array);
2172 }
2173
2174
2179 public boolean hasRoleWithName(String roleName) {
2180 if ((_rolesArray == null) || (_rolesArray.length == 0)) {
2181 return false;
2182 }
2183
2184 for (int i = 0; i < _rolesArray.length; i++) {
2185 if (_rolesArray[i].equalsIgnoreCase(roleName)) {
2186 return true;
2187 }
2188 }
2189
2190 return false;
2191 }
2192
2193
2200 public boolean hasAddPortletPermission(long userId) {
2201 PermissionChecker permissionChecker =
2202 PermissionThreadLocal.getPermissionChecker();
2203
2204 try {
2205 if ((permissionChecker == null) ||
2206 (permissionChecker.getUserId() != userId)) {
2207
2208 User user = UserLocalServiceUtil.getUser(userId);
2209
2210 permissionChecker = PermissionCheckerFactoryUtil.create(
2211 user, true);
2212 }
2213
2214 if (PortletPermissionUtil.contains(
2215 permissionChecker, getPortletId(),
2216 ActionKeys.ADD_TO_PAGE)) {
2217
2218 return true;
2219 }
2220 }
2221 catch (Exception e) {
2222 _log.error(e, e);
2223 }
2224
2225 return false;
2226 }
2227
2228
2235 public boolean getSystem() {
2236 return _system;
2237 }
2238
2239
2246 public boolean isSystem() {
2247 return _system;
2248 }
2249
2250
2257 public void setSystem(boolean system) {
2258 _system = system;
2259 }
2260
2261
2268 public boolean getInclude() {
2269 return _include;
2270 }
2271
2272
2279 public boolean isInclude() {
2280 return _include;
2281 }
2282
2283
2290 public void setInclude(boolean include) {
2291 _include = include;
2292 }
2293
2294
2299 public Map<String, String> getInitParams() {
2300 return _initParams;
2301 }
2302
2303
2308 public void setInitParams(Map<String, String> initParams) {
2309 _initParams = initParams;
2310 }
2311
2312
2317 public Integer getExpCache() {
2318 return _expCache;
2319 }
2320
2321
2326 public void setExpCache(Integer expCache) {
2327 _expCache = expCache;
2328 }
2329
2330
2335 public Map<String, Set<String>> getPortletModes() {
2336 return _portletModes;
2337 }
2338
2339
2344 public void setPortletModes(Map<String, Set<String>> portletModes) {
2345 _portletModes = portletModes;
2346 }
2347
2348
2355 public boolean hasPortletMode(String mimeType, PortletMode portletMode) {
2356 if (mimeType == null) {
2357 mimeType = ContentTypes.TEXT_HTML;
2358 }
2359
2360 Set<String> mimeTypePortletModes = _portletModes.get(mimeType);
2361
2362 if (mimeTypePortletModes == null) {
2363 return false;
2364 }
2365
2366 if (mimeTypePortletModes.contains(portletMode.toString())) {
2367 return true;
2368 }
2369 else {
2370 return false;
2371 }
2372 }
2373
2374
2379 public Set<String> getAllPortletModes() {
2380 Set<String> allPortletModes = new TreeSet<String>();
2381
2382 Iterator<Map.Entry <String, Set<String>>> itr1 =
2383 _portletModes.entrySet().iterator();
2384
2385 while (itr1.hasNext()) {
2386 Map.Entry<String, Set<String>> entry = itr1.next();
2387
2388 Set<String> mimeTypePortletModes = entry.getValue();
2389
2390 Iterator<String> itr2 = mimeTypePortletModes.iterator();
2391
2392 while (itr2.hasNext()) {
2393 String portletMode = itr2.next();
2394
2395 allPortletModes.add(portletMode);
2396 }
2397 }
2398
2399 return allPortletModes;
2400 }
2401
2402
2407 public boolean hasMultipleMimeTypes() {
2408 if (_portletModes.size() > 1) {
2409 return true;
2410 }
2411 else {
2412 return false;
2413 }
2414 }
2415
2416
2421 public Map<String, Set<String>> getWindowStates() {
2422 return _windowStates;
2423 }
2424
2425
2430 public void setWindowStates(Map<String, Set<String>> windowStates) {
2431 _windowStates = windowStates;
2432 }
2433
2434
2441 public boolean hasWindowState(String mimeType, WindowState windowState) {
2442 if (mimeType == null) {
2443 mimeType = ContentTypes.TEXT_HTML;
2444 }
2445
2446 Set<String> mimeTypeWindowStates = _windowStates.get(mimeType);
2447
2448 if (mimeTypeWindowStates == null) {
2449 return false;
2450 }
2451
2452 if (mimeTypeWindowStates.contains(windowState.toString())) {
2453 return true;
2454 }
2455 else {
2456 return false;
2457 }
2458 }
2459
2460
2465 public Set<String> getAllWindowStates() {
2466 Set<String> allWindowStates = new TreeSet<String>();
2467
2468 Iterator<Map.Entry <String, Set<String>>> itr1 =
2469 _windowStates.entrySet().iterator();
2470
2471 while (itr1.hasNext()) {
2472 Map.Entry<String, Set<String>> entry = itr1.next();
2473
2474 Set<String> mimeTypeWindowStates = entry.getValue();
2475
2476 Iterator<String> itr2 = mimeTypeWindowStates.iterator();
2477
2478 while (itr2.hasNext()) {
2479 String windowState = itr2.next();
2480
2481 allWindowStates.add(windowState);
2482 }
2483 }
2484
2485 return allWindowStates;
2486 }
2487
2488
2493 public Set<String> getSupportedLocales() {
2494 return _supportedLocales;
2495 }
2496
2497
2502 public void setSupportedLocales(Set<String> supportedLocales) {
2503 _supportedLocales = supportedLocales;
2504 }
2505
2506
2511 public String getResourceBundle() {
2512 return _resourceBundle;
2513 }
2514
2515
2520 public void setResourceBundle(String resourceBundle) {
2521 _resourceBundle = resourceBundle;
2522 }
2523
2524
2529 public PortletInfo getPortletInfo() {
2530 return _portletInfo;
2531 }
2532
2533
2538 public void setPortletInfo(PortletInfo portletInfo) {
2539 _portletInfo = portletInfo;
2540 }
2541
2542
2547 public Map<String, PortletFilter> getPortletFilters() {
2548 return _portletFilters;
2549 }
2550
2551
2556 public void setPortletFilters(Map<String, PortletFilter> portletFilters) {
2557 _portletFilters = portletFilters;
2558 }
2559
2560
2563 public void addProcessingEvent(QName processingEvent) {
2564 _processingEvents.add(processingEvent);
2565 _processingEventsByQName.put(
2566 PortletQNameUtil.getKey(processingEvent), processingEvent);
2567 }
2568
2569
2576 public QName getProcessingEvent(String uri, String localPart) {
2577 return _processingEventsByQName.get(
2578 PortletQNameUtil.getKey(uri, localPart));
2579 }
2580
2581
2586 public Set<QName> getProcessingEvents() {
2587 return _processingEvents;
2588 }
2589
2590
2595 public void setProcessingEvents(Set<QName> processingEvents) {
2596 for (QName processingEvent : processingEvents) {
2597 addProcessingEvent(processingEvent);
2598 }
2599 }
2600
2601
2604 public void addPublishingEvent(QName publishingEvent) {
2605 _publishingEvents.add(publishingEvent);
2606 }
2607
2608
2613 public Set<QName> getPublishingEvents() {
2614 return _publishingEvents;
2615 }
2616
2617
2622 public void setPublishingEvents(Set<QName> publishingEvents) {
2623 for (QName publishingEvent : publishingEvents) {
2624 addPublishingEvent(publishingEvent);
2625 }
2626 }
2627
2628
2633 public void addPublicRenderParameter(
2634 PublicRenderParameter publicRenderParameter) {
2635
2636 _publicRenderParameters.add(publicRenderParameter);
2637 _publicRenderParametersByIdentifier.put(
2638 publicRenderParameter.getIdentifier(), publicRenderParameter);
2639 _publicRenderParametersByQName.put(
2640 PortletQNameUtil.getKey(publicRenderParameter.getQName()),
2641 publicRenderParameter);
2642 }
2643
2644
2649 public PublicRenderParameter getPublicRenderParameter(String identifier) {
2650 return _publicRenderParametersByIdentifier.get(identifier);
2651 }
2652
2653
2660 public PublicRenderParameter getPublicRenderParameter(
2661 String uri, String localPart) {
2662
2663 return _publicRenderParametersByQName.get(
2664 PortletQNameUtil.getKey(uri, localPart));
2665 }
2666
2667
2672 public Set<PublicRenderParameter> getPublicRenderParameters() {
2673 return _publicRenderParameters;
2674 }
2675
2676
2682 public void setPublicRenderParameters(
2683 Set<PublicRenderParameter> publicRenderParameters) {
2684
2685 for (PublicRenderParameter publicRenderParameter :
2686 publicRenderParameters) {
2687
2688 addPublicRenderParameter(publicRenderParameter);
2689 }
2690 }
2691
2692
2697 public String getContextPath() {
2698 String virtualPath = getVirtualPath();
2699
2700 if (Validator.isNotNull(virtualPath)) {
2701 return virtualPath;
2702 }
2703
2704 if (_portletApp.isWARFile()) {
2705 return StringPool.SLASH.concat(_portletApp.getServletContextName());
2706 }
2707 else {
2708 return PortalUtil.getPathContext();
2709 }
2710 }
2711
2712
2717 public PortletApp getPortletApp() {
2718 return _portletApp;
2719 }
2720
2721
2726 public void setPortletApp(PortletApp portletApp) {
2727 _portletApp = portletApp;
2728 }
2729
2730
2736 public Portlet getClonedInstance(String portletId) {
2737 if (_clonedInstances == null) {
2738
2739
2741 return null;
2742 }
2743
2744 Portlet clonedInstance = _clonedInstances.get(portletId);
2745
2746 if (clonedInstance == null) {
2747 clonedInstance = (Portlet)clone();
2748
2749 clonedInstance.setPortletId(portletId);
2750
2751
2758 }
2760
2761 return clonedInstance;
2762 }
2763
2764
2769 public boolean getStatic() {
2770 return _staticPortlet;
2771 }
2772
2773
2778 public boolean isStatic() {
2779 return _staticPortlet;
2780 }
2781
2782
2788 public void setStatic(boolean staticPortlet) {
2789 _staticPortlet = staticPortlet;
2790 }
2791
2792
2799 public boolean getStaticStart() {
2800 return _staticPortletStart;
2801 }
2802
2803
2810 public boolean isStaticStart() {
2811 return _staticPortletStart;
2812 }
2813
2814
2821 public void setStaticStart(boolean staticPortletStart) {
2822 _staticPortletStart = staticPortletStart;
2823 }
2824
2825
2832 public boolean getStaticEnd() {
2833 return !_staticPortletStart;
2834 }
2835
2836
2843 public boolean isStaticEnd() {
2844 return !_staticPortletStart;
2845 }
2846
2847
2852 public boolean getUndeployedPortlet() {
2853 return _undeployedPortlet;
2854 }
2855
2856
2861 public boolean isUndeployedPortlet() {
2862 return _undeployedPortlet;
2863 }
2864
2865
2871 public void setUndeployedPortlet(boolean undeployedPortlet) {
2872 _undeployedPortlet = undeployedPortlet;
2873 }
2874
2875
2880 public Object clone() {
2881 Portlet portlet = new PortletImpl(
2882 getPortletId(), getPluginPackage(), getDefaultPluginSetting(),
2883 getCompanyId(), getTimestamp(), getIcon(), getVirtualPath(),
2884 getStrutsPath(), getPortletName(), getDisplayName(),
2885 getPortletClass(), getConfigurationActionClass(), getIndexerClass(),
2886 getOpenSearchClass(), getSchedulerEntries(), getPortletURLClass(),
2887 getFriendlyURLMapperClass(), getFriendlyURLRoutes(),
2888 getURLEncoderClass(), getPortletDataHandlerClass(),
2889 getPortletLayoutListenerClass(), getPollerProcessorClass(),
2890 getPopMessageListenerClass(), getSocialActivityInterpreterClass(),
2891 getSocialRequestInterpreterClass(), getWebDAVStorageToken(),
2892 getWebDAVStorageClass(), getXmlRpcMethodClass(),
2893 getControlPanelEntryCategory(), getControlPanelEntryWeight(),
2894 getControlPanelEntryClass(), getAssetRendererFactoryClasses(),
2895 getCustomAttributesDisplayClasses(), getWorkflowHandlerClasses(),
2896 getDefaultPreferences(), getPreferencesValidator(),
2897 isPreferencesCompanyWide(), isPreferencesUniquePerLayout(),
2898 isPreferencesOwnedByGroup(), isUseDefaultTemplate(),
2899 isShowPortletAccessDenied(), isShowPortletInactive(),
2900 isActionURLRedirect(), isRestoreCurrentView(), isMaximizeEdit(),
2901 isMaximizeHelp(), isPopUpPrint(), isLayoutCacheable(),
2902 isInstanceable(), isScopeable(), getUserPrincipalStrategy(),
2903 isPrivateRequestAttributes(), isPrivateSessionAttributes(),
2904 getRenderWeight(), isAjaxable(), getHeaderPortalCss(),
2905 getHeaderPortletCss(), getHeaderPortalJavaScript(),
2906 getHeaderPortletJavaScript(), getFooterPortalCss(),
2907 getFooterPortletCss(), getFooterPortalJavaScript(),
2908 getFooterPortletJavaScript(), getCssClassWrapper(),
2909 getFacebookIntegration(), isAddDefaultResource(), getRoles(),
2910 getUnlinkedRoles(), getRoleMappers(), isSystem(), isActive(),
2911 isInclude(), getInitParams(), getExpCache(), getPortletModes(),
2912 getWindowStates(), getSupportedLocales(), getResourceBundle(),
2913 getPortletInfo(), getPortletFilters(), getProcessingEvents(),
2914 getPublishingEvents(), getPublicRenderParameters(),
2915 getPortletApp());
2916
2917 portlet.setId(getId());
2918
2919 return portlet;
2920 }
2921
2922
2931 public int compareTo(Portlet portlet) {
2932 return getPortletId().compareTo(portlet.getPortletId());
2933 }
2934
2935
2941 public boolean equals(Object obj) {
2942 Portlet portlet = (Portlet)obj;
2943
2944 return getPortletId().equals(portlet.getPortletId());
2945 }
2946
2947
2950 private static Log _log = LogFactoryUtil.getLog(PortletImpl.class);
2951
2952
2955 private PluginPackage _pluginPackage;
2956
2957
2960 private PluginSetting _defaultPluginSetting;
2961
2962
2965 private long _timestamp;
2966
2967
2970 private String _icon;
2971
2972
2975 private String _virtualPath;
2976
2977
2980 private String _strutsPath;
2981
2982
2985 private String _portletName;
2986
2987
2990 private String _displayName;
2991
2992
2995 private String _portletClass;
2996
2997
3000 private String _configurationActionClass;
3001
3002
3005 private String _indexerClass;
3006
3007
3010 private String _openSearchClass;
3011
3012
3015 private List<SchedulerEntry> _schedulerEntries;
3016
3017
3020 private String _portletURLClass;
3021
3022
3025 private String _friendlyURLMapperClass;
3026
3027
3031 private String _friendlyURLRoutes;
3032
3033
3036 private String _urlEncoderClass;
3037
3038
3041 private String _portletDataHandlerClass;
3042
3043
3046 private String _portletLayoutListenerClass;
3047
3048
3051 private String _pollerProcessorClass;
3052
3053
3056 private String _popMessageListenerClass;
3057
3058
3061 private String _socialActivityInterpreterClass;
3062
3063
3066 private String _socialRequestInterpreterClass;
3067
3068
3071 private String _webDAVStorageToken;
3072
3073
3076 private String _webDAVStorageClass;
3077
3078
3081 private String _xmlRpcMethodClass;
3082
3083
3086 private String _defaultPreferences;
3087
3088
3091 private String _preferencesValidator;
3092
3093
3096 private boolean _preferencesCompanyWide;
3097
3098
3101 private boolean _preferencesUniquePerLayout = true;
3102
3103
3107 private boolean _preferencesOwnedByGroup = true;
3108
3109
3113 private String _controlPanelEntryCategory;
3114
3115
3119 private double _controlPanelEntryWeight = 100;
3120
3121
3125 private String _controlPanelEntryClass;
3126
3127
3131 private List<String> _assetRendererFactoryClasses;
3132
3133
3137 private List<String> _customAttributesDisplayClasses;
3138
3139
3143 private List<String> _workflowHandlerClasses;
3144
3145
3148 private boolean _useDefaultTemplate = true;
3149
3150
3153 private boolean _showPortletAccessDenied =
3154 PropsValues.LAYOUT_SHOW_PORTLET_ACCESS_DENIED;
3155
3156
3159 private boolean _showPortletInactive =
3160 PropsValues.LAYOUT_SHOW_PORTLET_INACTIVE;
3161
3162
3165 private boolean _actionURLRedirect;
3166
3167
3171 private boolean _restoreCurrentView = true;
3172
3173
3177 private boolean _maximizeEdit;
3178
3179
3183 private boolean _maximizeHelp;
3184
3185
3189 private boolean _popUpPrint = true;
3190
3191
3194 private boolean _layoutCacheable;
3195
3196
3199 private boolean _instanceable;
3200
3201
3204 private boolean _scopeable;
3205
3206
3209 private String _userPrincipalStrategy =
3210 PortletConstants.USER_PRINCIPAL_STRATEGY_USER_ID;
3211
3212
3216 private boolean _privateRequestAttributes = true;
3217
3218
3221 private boolean _privateSessionAttributes = true;
3222
3223
3226 private int _renderWeight = 1;
3227
3228
3231 private boolean _ajaxable = true;
3232
3233
3237 private List<String> _headerPortalCss;
3238
3239
3243 private List<String> _headerPortletCss;
3244
3245
3249 private List<String> _headerPortalJavaScript;
3250
3251
3255 private List<String> _headerPortletJavaScript;
3256
3257
3261 private List<String> _footerPortalCss;
3262
3263
3267 private List<String> _footerPortletCss;
3268
3269
3273 private List<String> _footerPortalJavaScript;
3274
3275
3279 private List<String> _footerPortletJavaScript;
3280
3281
3285 private String _cssClassWrapper = StringPool.BLANK;
3286
3287
3290 private String _facebookIntegration =
3291 PortletConstants.FACEBOOK_INTEGRATION_IFRAME;
3292
3293
3296 private boolean _addDefaultResource;
3297
3298
3301 private String[] _rolesArray;
3302
3303
3306 private Set<String> _unlinkedRoles;
3307
3308
3311 private Map<String, String> _roleMappers;
3312
3313
3317 private boolean _system;
3318
3319
3322 private boolean _include = true;
3323
3324
3327 private Map<String, String> _initParams;
3328
3329
3332 private Integer _expCache;
3333
3334
3337 private Map<String, Set<String>> _portletModes;
3338
3339
3342 private Map<String, Set<String>> _windowStates;
3343
3344
3347 private Set<String> _supportedLocales;
3348
3349
3352 private String _resourceBundle;
3353
3354
3357 private PortletInfo _portletInfo;
3358
3359
3362 private Map<String, PortletFilter> _portletFilters;
3363
3364
3367 private Set<QName> _processingEvents = new HashSet<QName>();
3368
3369
3372 private Map<String, QName> _processingEventsByQName =
3373 new HashMap<String, QName>();
3374
3375
3378 private Set<QName> _publishingEvents = new HashSet<QName>();
3379
3380
3383 private Set<PublicRenderParameter> _publicRenderParameters =
3384 new HashSet<PublicRenderParameter>();
3385
3386
3390 private Map<String, PublicRenderParameter>
3391 _publicRenderParametersByIdentifier =
3392 new HashMap<String, PublicRenderParameter>();
3393
3394
3398 private Map<String, PublicRenderParameter>
3399 _publicRenderParametersByQName =
3400 new HashMap<String, PublicRenderParameter>();
3401
3402
3405 private PortletApp _portletApp;
3406
3407
3410 private Map<String, Portlet> _clonedInstances;
3411
3412
3415 private boolean _staticPortlet;
3416
3417
3421 private boolean _staticPortletStart;
3422
3423
3426 private boolean _undeployedPortlet = false;
3427
3428}