001
014
015 package com.liferay.portal.model.impl;
016
017 import com.liferay.portal.kernel.atom.AtomCollectionAdapter;
018 import com.liferay.portal.kernel.lar.PortletDataHandler;
019 import com.liferay.portal.kernel.log.Log;
020 import com.liferay.portal.kernel.log.LogFactoryUtil;
021 import com.liferay.portal.kernel.plugin.PluginPackage;
022 import com.liferay.portal.kernel.poller.PollerProcessor;
023 import com.liferay.portal.kernel.pop.MessageListener;
024 import com.liferay.portal.kernel.portlet.ConfigurationAction;
025 import com.liferay.portal.kernel.portlet.FriendlyURLMapper;
026 import com.liferay.portal.kernel.portlet.PortletBag;
027 import com.liferay.portal.kernel.portlet.PortletBagPool;
028 import com.liferay.portal.kernel.portlet.PortletLayoutListener;
029 import com.liferay.portal.kernel.scheduler.SchedulerEntry;
030 import com.liferay.portal.kernel.search.Indexer;
031 import com.liferay.portal.kernel.search.OpenSearch;
032 import com.liferay.portal.kernel.servlet.ServletContextPool;
033 import com.liferay.portal.kernel.servlet.URLEncoder;
034 import com.liferay.portal.kernel.util.ContentTypes;
035 import com.liferay.portal.kernel.util.ContextPathUtil;
036 import com.liferay.portal.kernel.util.StringPool;
037 import com.liferay.portal.kernel.util.StringUtil;
038 import com.liferay.portal.kernel.util.Validator;
039 import com.liferay.portal.kernel.webdav.WebDAVStorage;
040 import com.liferay.portal.kernel.workflow.WorkflowHandler;
041 import com.liferay.portal.kernel.xml.QName;
042 import com.liferay.portal.kernel.xmlrpc.Method;
043 import com.liferay.portal.model.Plugin;
044 import com.liferay.portal.model.PluginSetting;
045 import com.liferay.portal.model.Portlet;
046 import com.liferay.portal.model.PortletApp;
047 import com.liferay.portal.model.PortletConstants;
048 import com.liferay.portal.model.PortletFilter;
049 import com.liferay.portal.model.PortletInfo;
050 import com.liferay.portal.model.PublicRenderParameter;
051 import com.liferay.portal.model.User;
052 import com.liferay.portal.security.permission.ActionKeys;
053 import com.liferay.portal.security.permission.PermissionChecker;
054 import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil;
055 import com.liferay.portal.security.permission.PermissionPropagator;
056 import com.liferay.portal.security.permission.PermissionThreadLocal;
057 import com.liferay.portal.service.UserLocalServiceUtil;
058 import com.liferay.portal.service.permission.PortletPermissionUtil;
059 import com.liferay.portal.util.PortalUtil;
060 import com.liferay.portal.util.PropsValues;
061 import com.liferay.portlet.ControlPanelEntry;
062 import com.liferay.portlet.PortletQNameUtil;
063 import com.liferay.portlet.asset.model.AssetRendererFactory;
064 import com.liferay.portlet.expando.model.CustomAttributesDisplay;
065 import com.liferay.portlet.social.model.SocialActivityInterpreter;
066 import com.liferay.portlet.social.model.SocialRequestInterpreter;
067
068 import java.util.ArrayList;
069 import java.util.Arrays;
070 import java.util.Collections;
071 import java.util.HashMap;
072 import java.util.HashSet;
073 import java.util.Iterator;
074 import java.util.LinkedHashMap;
075 import java.util.LinkedHashSet;
076 import java.util.List;
077 import java.util.Map;
078 import java.util.Set;
079 import java.util.TreeSet;
080 import java.util.concurrent.ConcurrentHashMap;
081
082 import javax.portlet.PortletMode;
083 import javax.portlet.WindowState;
084
085 import javax.servlet.ServletContext;
086
087
090 public class PortletImpl extends PortletBaseImpl {
091
092
095 public PortletImpl() {
096 }
097
098
101 public PortletImpl(long companyId, String portletId) {
102 setCompanyId(companyId);
103 setPortletId(portletId);
104 setStrutsPath(portletId);
105 setActive(true);
106 _indexerClasses = new ArrayList<String>();
107 _schedulerEntries = new ArrayList<SchedulerEntry>();
108 _assetRendererFactoryClasses = new ArrayList<String>();
109 _atomCollectionAdapterClasses = new ArrayList<String>();
110 _customAttributesDisplayClasses = new ArrayList<String>();
111 _workflowHandlerClasses = new ArrayList<String>();
112 _autopropagatedParameters = new LinkedHashSet<String>();
113 _headerPortalCss = new ArrayList<String>();
114 _headerPortletCss = new ArrayList<String>();
115 _headerPortalJavaScript = new ArrayList<String>();
116 _headerPortletJavaScript = new ArrayList<String>();
117 _footerPortalCss = new ArrayList<String>();
118 _footerPortletCss = new ArrayList<String>();
119 _footerPortalJavaScript = new ArrayList<String>();
120 _footerPortletJavaScript = new ArrayList<String>();
121 _unlinkedRoles = new HashSet<String>();
122 _roleMappers = new LinkedHashMap<String, String>();
123 _initParams = new HashMap<String, String>();
124 _portletModes = new HashMap<String, Set<String>>();
125 _windowStates = new HashMap<String, Set<String>>();
126 _supportedLocales = new HashSet<String>();
127 _portletFilters = new LinkedHashMap<String, PortletFilter>();
128 _processingEvents = new HashSet<QName>();
129 _publishingEvents = new HashSet<QName>();
130 _publicRenderParameters = new HashSet<PublicRenderParameter>();
131 }
132
133
136 public PortletImpl(
137 String portletId, Portlet rootPortlet, PluginPackage pluginPackage,
138 PluginSetting pluginSetting, long companyId, long timestamp,
139 String icon, String virtualPath, String strutsPath,
140 String parentStrutsPath, String portletName, String displayName,
141 String portletClass, String configurationActionClass,
142 List<String> indexerClasses, String openSearchClass,
143 List<SchedulerEntry> schedulerEntries, String portletURLClass,
144 String friendlyURLMapperClass, String friendlyURLMapping,
145 String friendlyURLRoutes, String urlEncoderClass,
146 String portletDataHandlerClass, String portletLayoutListenerClass,
147 String pollerProcessorClass, String popMessageListenerClass,
148 String socialActivityInterpreterClass,
149 String socialRequestInterpreterClass, String webDAVStorageToken,
150 String webDAVStorageClass, String xmlRpcMethodClass,
151 String controlPanelEntryCategory, double controlPanelEntryWeight,
152 String controlPanelClass, List<String> assetRendererFactoryClasses,
153 List<String> atomCollectionAdapterClasses,
154 List<String> customAttributesDisplayClasses,
155 String permissionPropagatorClass, List<String> workflowHandlerClasses,
156 String defaultPreferences, String preferencesValidator,
157 boolean preferencesCompanyWide, boolean preferencesUniquePerLayout,
158 boolean preferencesOwnedByGroup, boolean useDefaultTemplate,
159 boolean showPortletAccessDenied, boolean showPortletInactive,
160 boolean actionURLRedirect, boolean restoreCurrentView,
161 boolean maximizeEdit, boolean maximizeHelp, boolean popUpPrint,
162 boolean layoutCacheable, boolean instanceable, boolean remoteable,
163 boolean scopeable, String userPrincipalStrategy,
164 boolean privateRequestAttributes, boolean privateSessionAttributes,
165 Set<String> autopropagatedParameters, int actionTimeout,
166 int renderTimeout, int renderWeight, boolean ajaxable,
167 List<String> headerPortalCss, List<String> headerPortletCss,
168 List<String> headerPortalJavaScript,
169 List<String> headerPortletJavaScript, List<String> footerPortalCss,
170 List<String> footerPortletCss, List<String> footerPortalJavaScript,
171 List<String> footerPortletJavaScript, String cssClassWrapper,
172 String facebookIntegration, boolean addDefaultResource, String roles,
173 Set<String> unlinkedRoles, Map<String, String> roleMappers,
174 boolean system, boolean active, boolean include,
175 Map<String, String> initParams, Integer expCache,
176 Map<String, Set<String>> portletModes,
177 Map<String, Set<String>> windowStates, Set<String> supportedLocales,
178 String resourceBundle, PortletInfo portletInfo,
179 Map<String, PortletFilter> portletFilters, Set<QName> processingEvents,
180 Set<QName> publishingEvents,
181 Set<PublicRenderParameter> publicRenderParameters,
182 PortletApp portletApp) {
183
184 setPortletId(portletId);
185 _rootPortlet = rootPortlet;
186 _pluginPackage = pluginPackage;
187 _defaultPluginSetting = pluginSetting;
188 setCompanyId(companyId);
189 _timestamp = timestamp;
190 _icon = icon;
191 _virtualPath = virtualPath;
192 _strutsPath = strutsPath;
193 _portletName = portletName;
194 _parentStrutsPath = parentStrutsPath;
195 _displayName = displayName;
196 _portletClass = portletClass;
197 _configurationActionClass = configurationActionClass;
198 _indexerClasses = indexerClasses;
199 _openSearchClass = openSearchClass;
200 _schedulerEntries = schedulerEntries;
201 _portletURLClass = portletURLClass;
202 _friendlyURLMapperClass = friendlyURLMapperClass;
203 _friendlyURLMapping = friendlyURLMapping;
204 _friendlyURLRoutes = friendlyURLRoutes;
205 _urlEncoderClass = urlEncoderClass;
206 _portletDataHandlerClass = portletDataHandlerClass;
207 _portletLayoutListenerClass = portletLayoutListenerClass;
208 _pollerProcessorClass = pollerProcessorClass;
209 _popMessageListenerClass = popMessageListenerClass;
210 _socialActivityInterpreterClass = socialActivityInterpreterClass;
211 _socialRequestInterpreterClass = socialRequestInterpreterClass;
212 _webDAVStorageToken = webDAVStorageToken;
213 _webDAVStorageClass = webDAVStorageClass;
214 _xmlRpcMethodClass = xmlRpcMethodClass;
215 _controlPanelEntryCategory = controlPanelEntryCategory;
216 _controlPanelEntryWeight = controlPanelEntryWeight;
217 _controlPanelEntryClass = controlPanelClass;
218 _assetRendererFactoryClasses = assetRendererFactoryClasses;
219 _atomCollectionAdapterClasses = atomCollectionAdapterClasses;
220 _customAttributesDisplayClasses = customAttributesDisplayClasses;
221 _permissionPropagatorClass = permissionPropagatorClass;
222 _workflowHandlerClasses = workflowHandlerClasses;
223 _defaultPreferences = defaultPreferences;
224 _preferencesValidator = preferencesValidator;
225 _preferencesCompanyWide = preferencesCompanyWide;
226 _preferencesUniquePerLayout = preferencesUniquePerLayout;
227 _preferencesOwnedByGroup = preferencesOwnedByGroup;
228 _useDefaultTemplate = useDefaultTemplate;
229 _showPortletAccessDenied = showPortletAccessDenied;
230 _showPortletInactive = showPortletInactive;
231 _actionURLRedirect = actionURLRedirect;
232 _restoreCurrentView = restoreCurrentView;
233 _maximizeEdit = maximizeEdit;
234 _maximizeHelp = maximizeHelp;
235 _popUpPrint = popUpPrint;
236 _layoutCacheable = layoutCacheable;
237 _instanceable = instanceable;
238 _remoteable = remoteable;
239 _scopeable = scopeable;
240 _userPrincipalStrategy = userPrincipalStrategy;
241 _privateRequestAttributes = privateRequestAttributes;
242 _privateSessionAttributes = privateSessionAttributes;
243 _autopropagatedParameters = autopropagatedParameters;
244 _actionTimeout = actionTimeout;
245 _renderTimeout = renderTimeout;
246 _renderWeight = renderWeight;
247 _ajaxable = ajaxable;
248 _headerPortalCss = headerPortalCss;
249 _headerPortletCss = headerPortletCss;
250 _headerPortalJavaScript = headerPortalJavaScript;
251 _headerPortletJavaScript = headerPortletJavaScript;
252 _footerPortalCss = footerPortalCss;
253 _footerPortletCss = footerPortletCss;
254 _footerPortalJavaScript = footerPortalJavaScript;
255 _footerPortletJavaScript = footerPortletJavaScript;
256 _cssClassWrapper = cssClassWrapper;
257 _facebookIntegration = facebookIntegration;
258 _scopeable = scopeable;
259 _addDefaultResource = addDefaultResource;
260 setRoles(roles);
261 _unlinkedRoles = unlinkedRoles;
262 _roleMappers = roleMappers;
263 _system = system;
264 setActive(active);
265 _include = include;
266 _initParams = initParams;
267 _expCache = expCache;
268 _portletModes = portletModes;
269 _windowStates = windowStates;
270 _supportedLocales = supportedLocales;
271 _resourceBundle = resourceBundle;
272 _portletInfo = portletInfo;
273 _portletFilters = portletFilters;
274 setProcessingEvents(processingEvents);
275 setPublishingEvents(publishingEvents);
276 setPublicRenderParameters(publicRenderParameters);
277 _portletApp = portletApp;
278 }
279
280
283 public void addProcessingEvent(QName processingEvent) {
284 _processingEvents.add(processingEvent);
285 _processingEventsByQName.put(
286 PortletQNameUtil.getKey(processingEvent), processingEvent);
287 }
288
289
294 public void addPublicRenderParameter(
295 PublicRenderParameter publicRenderParameter) {
296
297 _publicRenderParameters.add(publicRenderParameter);
298
299 String identifier = publicRenderParameter.getIdentifier();
300
301 _publicRenderParametersByIdentifier.put(
302 identifier, publicRenderParameter);
303
304 QName qName = publicRenderParameter.getQName();
305
306 _publicRenderParametersByQName.put(
307 PortletQNameUtil.getKey(qName), publicRenderParameter);
308
309 String publicRenderParameterName =
310 PortletQNameUtil.getPublicRenderParameterName(qName);
311
312 PortletQNameUtil.setPublicRenderParameterIdentifier(
313 publicRenderParameterName, identifier);
314 }
315
316
319 public void addPublishingEvent(QName publishingEvent) {
320 _publishingEvents.add(publishingEvent);
321 }
322
323
326 public void addSchedulerEntry(SchedulerEntry schedulerEntry) {
327 _schedulerEntries.add(schedulerEntry);
328 }
329
330
335 @Override
336 public Object clone() {
337 Portlet portlet = new PortletImpl(
338 getPortletId(), getRootPortlet(), getPluginPackage(),
339 getDefaultPluginSetting(), getCompanyId(), getTimestamp(),
340 getIcon(), getVirtualPath(), getStrutsPath(), getParentStrutsPath(),
341 getPortletName(), getDisplayName(), getPortletClass(),
342 getConfigurationActionClass(), getIndexerClasses(),
343 getOpenSearchClass(), getSchedulerEntries(), getPortletURLClass(),
344 getFriendlyURLMapperClass(), getFriendlyURLMapping(),
345 getFriendlyURLRoutes(), getURLEncoderClass(),
346 getPortletDataHandlerClass(), getPortletLayoutListenerClass(),
347 getPollerProcessorClass(), getPopMessageListenerClass(),
348 getSocialActivityInterpreterClass(),
349 getSocialRequestInterpreterClass(), getWebDAVStorageToken(),
350 getWebDAVStorageClass(), getXmlRpcMethodClass(),
351 getControlPanelEntryCategory(), getControlPanelEntryWeight(),
352 getControlPanelEntryClass(), getAssetRendererFactoryClasses(),
353 getAtomCollectionAdapterClasses(),
354 getCustomAttributesDisplayClasses(), getPermissionPropagatorClass(),
355 getWorkflowHandlerClasses(), getDefaultPreferences(),
356 getPreferencesValidator(), isPreferencesCompanyWide(),
357 isPreferencesUniquePerLayout(), isPreferencesOwnedByGroup(),
358 isUseDefaultTemplate(), isShowPortletAccessDenied(),
359 isShowPortletInactive(), isActionURLRedirect(),
360 isRestoreCurrentView(), isMaximizeEdit(), isMaximizeHelp(),
361 isPopUpPrint(), isLayoutCacheable(), isInstanceable(),
362 isRemoteable(), isScopeable(), getUserPrincipalStrategy(),
363 isPrivateRequestAttributes(), isPrivateSessionAttributes(),
364 getAutopropagatedParameters(), getActionTimeout(),
365 getRenderTimeout(), getRenderWeight(), isAjaxable(),
366 getHeaderPortalCss(), getHeaderPortletCss(),
367 getHeaderPortalJavaScript(), getHeaderPortletJavaScript(),
368 getFooterPortalCss(), getFooterPortletCss(),
369 getFooterPortalJavaScript(), getFooterPortletJavaScript(),
370 getCssClassWrapper(), getFacebookIntegration(),
371 isAddDefaultResource(), getRoles(), getUnlinkedRoles(),
372 getRoleMappers(), isSystem(), isActive(), isInclude(),
373 getInitParams(), getExpCache(), getPortletModes(),
374 getWindowStates(), getSupportedLocales(), getResourceBundle(),
375 getPortletInfo(), getPortletFilters(), getProcessingEvents(),
376 getPublishingEvents(), getPublicRenderParameters(),
377 getPortletApp());
378
379 portlet.setId(getId());
380 portlet.setUndeployedPortlet(isUndeployedPortlet());
381
382 return portlet;
383 }
384
385
394 @Override
395 public int compareTo(Portlet portlet) {
396 return getPortletId().compareTo(portlet.getPortletId());
397 }
398
399
405 @Override
406 public boolean equals(Object obj) {
407 Portlet portlet = (Portlet)obj;
408
409 return getPortletId().equals(portlet.getPortletId());
410 }
411
412
417 public int getActionTimeout() {
418 return _actionTimeout;
419 }
420
421
428 public boolean getActionURLRedirect() {
429 return _actionURLRedirect;
430 }
431
432
439 public boolean getAddDefaultResource() {
440 return _addDefaultResource;
441 }
442
443
448 public boolean getAjaxable() {
449 return _ajaxable;
450 }
451
452
457 public Set<String> getAllPortletModes() {
458 Set<String> allPortletModes = new TreeSet<String>();
459
460 Iterator<Map.Entry <String, Set<String>>> itr1 =
461 _portletModes.entrySet().iterator();
462
463 while (itr1.hasNext()) {
464 Map.Entry<String, Set<String>> entry = itr1.next();
465
466 Set<String> mimeTypePortletModes = entry.getValue();
467
468 Iterator<String> itr2 = mimeTypePortletModes.iterator();
469
470 while (itr2.hasNext()) {
471 String portletMode = itr2.next();
472
473 allPortletModes.add(portletMode);
474 }
475 }
476
477 return allPortletModes;
478 }
479
480
485 public Set<String> getAllWindowStates() {
486 Set<String> allWindowStates = new TreeSet<String>();
487
488 Iterator<Map.Entry <String, Set<String>>> itr1 =
489 _windowStates.entrySet().iterator();
490
491 while (itr1.hasNext()) {
492 Map.Entry<String, Set<String>> entry = itr1.next();
493
494 Set<String> mimeTypeWindowStates = entry.getValue();
495
496 Iterator<String> itr2 = mimeTypeWindowStates.iterator();
497
498 while (itr2.hasNext()) {
499 String windowState = itr2.next();
500
501 allWindowStates.add(windowState);
502 }
503 }
504
505 return allWindowStates;
506 }
507
508
515 public List<String> getAssetRendererFactoryClasses() {
516 return _assetRendererFactoryClasses;
517 }
518
519
524 public List<AssetRendererFactory> getAssetRendererFactoryInstances() {
525 if (getAssetRendererFactoryClasses().isEmpty()) {
526 return null;
527 }
528
529 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
530
531 return portletBag.getAssetRendererFactoryInstances();
532 }
533
534
541 public List<String> getAtomCollectionAdapterClasses() {
542 return _atomCollectionAdapterClasses;
543 }
544
545
550 public List<AtomCollectionAdapter<?>> getAtomCollectionAdapterInstances() {
551 if (getAtomCollectionAdapterClasses().isEmpty()) {
552 return null;
553 }
554
555 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
556
557 return portletBag.getAtomCollectionAdapterInstances();
558 }
559
560
567 public Set<String> getAutopropagatedParameters() {
568 return _autopropagatedParameters;
569 }
570
571
577 public Portlet getClonedInstance(String portletId) {
578 Portlet portlet = (Portlet)clone();
579
580 portlet.setPortletId(portletId);
581
582 return portlet;
583 }
584
585
590 public String getConfigurationActionClass() {
591 return _configurationActionClass;
592 }
593
594
599 public ConfigurationAction getConfigurationActionInstance() {
600 if (Validator.isNull(getConfigurationActionClass())) {
601 return null;
602 }
603
604 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
605
606 return portletBag.getConfigurationActionInstance();
607 }
608
609
614 public String getContextPath() {
615 if (!_portletApp.isWARFile()) {
616 return PortalUtil.getPathContext();
617 }
618
619 String servletContextName = _portletApp.getServletContextName();
620
621 if (ServletContextPool.containsKey(servletContextName)) {
622 ServletContext servletContext = ServletContextPool.get(
623 servletContextName);
624
625 return ContextPathUtil.getContextPath(servletContext);
626 }
627
628 return StringPool.SLASH.concat(servletContextName);
629 }
630
631
638 public String getControlPanelEntryCategory() {
639 return _controlPanelEntryCategory;
640 }
641
642
649 public String getControlPanelEntryClass() {
650 return _controlPanelEntryClass;
651 }
652
653
660 public ControlPanelEntry getControlPanelEntryInstance() {
661 if (Validator.isNull(getControlPanelEntryClass())) {
662 return null;
663 }
664
665 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
666
667 return portletBag.getControlPanelEntryInstance();
668 }
669
670
677 public double getControlPanelEntryWeight() {
678 return _controlPanelEntryWeight;
679 }
680
681
688 public String getCssClassWrapper() {
689 return _cssClassWrapper;
690 }
691
692
699 public List<String> getCustomAttributesDisplayClasses() {
700 return _customAttributesDisplayClasses;
701 }
702
703
708 public List<CustomAttributesDisplay> getCustomAttributesDisplayInstances() {
709 if (getCustomAttributesDisplayClasses().isEmpty()) {
710 return null;
711 }
712
713 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
714
715 return portletBag.getCustomAttributesDisplayInstances();
716 }
717
718
723 public PluginSetting getDefaultPluginSetting() {
724 return _defaultPluginSetting;
725 }
726
727
732 public String getDefaultPreferences() {
733 if (Validator.isNull(_defaultPreferences)) {
734 return PortletConstants.DEFAULT_PREFERENCES;
735 }
736 else {
737 return _defaultPreferences;
738 }
739 }
740
741
746 public String getDisplayName() {
747 return _displayName;
748 }
749
750
755 public Integer getExpCache() {
756 return _expCache;
757 }
758
759
764 public String getFacebookIntegration() {
765 return _facebookIntegration;
766 }
767
768
775 public List<String> getFooterPortalCss() {
776 return _footerPortalCss;
777 }
778
779
786 public List<String> getFooterPortalJavaScript() {
787 return _footerPortalJavaScript;
788 }
789
790
797 public List<String> getFooterPortletCss() {
798 return _footerPortletCss;
799 }
800
801
808 public List<String> getFooterPortletJavaScript() {
809 return _footerPortletJavaScript;
810 }
811
812
817 public String getFriendlyURLMapperClass() {
818 return _friendlyURLMapperClass;
819 }
820
821
826 public FriendlyURLMapper getFriendlyURLMapperInstance() {
827 if (Validator.isNull(getFriendlyURLMapperClass())) {
828 return null;
829 }
830
831 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
832
833 return portletBag.getFriendlyURLMapperInstance();
834 }
835
836
841 public String getFriendlyURLMapping() {
842 return _friendlyURLMapping;
843 }
844
845
852 public String getFriendlyURLRoutes() {
853 return _friendlyURLRoutes;
854 }
855
856
863 public List<String> getHeaderPortalCss() {
864 return _headerPortalCss;
865 }
866
867
874 public List<String> getHeaderPortalJavaScript() {
875 return _headerPortalJavaScript;
876 }
877
878
885 public List<String> getHeaderPortletCss() {
886 return _headerPortletCss;
887 }
888
889
896 public List<String> getHeaderPortletJavaScript() {
897 return _headerPortletJavaScript;
898 }
899
900
905 public String getIcon() {
906 return _icon;
907 }
908
909
916 public boolean getInclude() {
917 return _include;
918 }
919
920
927 public List<String> getIndexerClasses() {
928 return _indexerClasses;
929 }
930
931
936 public List<Indexer> getIndexerInstances() {
937 if (getIndexerClasses().isEmpty()) {
938 return Collections.emptyList();
939 }
940
941 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
942
943 return portletBag.getIndexerInstances();
944 }
945
946
951 public Map<String, String> getInitParams() {
952 return _initParams;
953 }
954
955
962 public boolean getInstanceable() {
963 return _instanceable;
964 }
965
966
971 public String getInstanceId() {
972 return PortletConstants.getInstanceId(getPortletId());
973 }
974
975
981 public boolean getLayoutCacheable() {
982 return _layoutCacheable;
983 }
984
985
992 public boolean getMaximizeEdit() {
993 return _maximizeEdit;
994 }
995
996
1003 public boolean getMaximizeHelp() {
1004 return _maximizeHelp;
1005 }
1006
1007
1012 public String getOpenSearchClass() {
1013 return _openSearchClass;
1014 }
1015
1016
1021 public OpenSearch getOpenSearchInstance() {
1022 if (Validator.isNull(getOpenSearchClass())) {
1023 return null;
1024 }
1025
1026 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1027
1028 return portletBag.getOpenSearchInstance();
1029 }
1030
1031
1036 public String getParentStrutsPath() {
1037 return _parentStrutsPath;
1038 }
1039
1040
1045 public String getPermissionPropagatorClass() {
1046 return _permissionPropagatorClass;
1047 }
1048
1049
1054 public PermissionPropagator getPermissionPropagatorInstance() {
1055 if (Validator.isNull(getPermissionPropagatorClass())) {
1056 return null;
1057 }
1058
1059 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1060
1061 return portletBag.getPermissionPropagatorInstance();
1062 }
1063
1064
1069 public String getPluginId() {
1070 return getRootPortletId();
1071 }
1072
1073
1078 public PluginPackage getPluginPackage() {
1079 return _pluginPackage;
1080 }
1081
1082
1087 public String getPluginType() {
1088 return Plugin.TYPE_PORTLET;
1089 }
1090
1091
1096 public String getPollerProcessorClass() {
1097 return _pollerProcessorClass;
1098 }
1099
1100
1105 public PollerProcessor getPollerProcessorInstance() {
1106 if (Validator.isNull(getPollerProcessorClass())) {
1107 return null;
1108 }
1109
1110 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1111
1112 return portletBag.getPollerProcessorInstance();
1113 }
1114
1115
1120 public String getPopMessageListenerClass() {
1121 return _popMessageListenerClass;
1122 }
1123
1124
1129 public MessageListener getPopMessageListenerInstance() {
1130 if (Validator.isNull(getPopMessageListenerClass())) {
1131 return null;
1132 }
1133
1134 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1135
1136 return portletBag.getPopMessageListenerInstance();
1137 }
1138
1139
1146 public boolean getPopUpPrint() {
1147 return _popUpPrint;
1148 }
1149
1150
1155 public PortletApp getPortletApp() {
1156 return _portletApp;
1157 }
1158
1159
1164 public String getPortletClass() {
1165 return _portletClass;
1166 }
1167
1168
1173 public String getPortletDataHandlerClass() {
1174 return _portletDataHandlerClass;
1175 }
1176
1177
1182 public PortletDataHandler getPortletDataHandlerInstance() {
1183 if (Validator.isNull(getPortletDataHandlerClass())) {
1184 return null;
1185 }
1186
1187 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1188
1189 return portletBag.getPortletDataHandlerInstance();
1190 }
1191
1192
1197 public Map<String, PortletFilter> getPortletFilters() {
1198 return _portletFilters;
1199 }
1200
1201
1206 public PortletInfo getPortletInfo() {
1207 return _portletInfo;
1208 }
1209
1210
1215 public String getPortletLayoutListenerClass() {
1216 return _portletLayoutListenerClass;
1217 }
1218
1219
1224 public PortletLayoutListener getPortletLayoutListenerInstance() {
1225 if (Validator.isNull(getPortletLayoutListenerClass())) {
1226 return null;
1227 }
1228
1229 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1230
1231 return portletBag.getPortletLayoutListenerInstance();
1232 }
1233
1234
1239 public Map<String, Set<String>> getPortletModes() {
1240 return _portletModes;
1241 }
1242
1243
1248 public String getPortletName() {
1249 return _portletName;
1250 }
1251
1252
1257 public String getPortletURLClass() {
1258 return _portletURLClass;
1259 }
1260
1261
1268 public boolean getPreferencesCompanyWide() {
1269 return _preferencesCompanyWide;
1270 }
1271
1272
1281 public boolean getPreferencesOwnedByGroup() {
1282 return _preferencesOwnedByGroup;
1283 }
1284
1285
1290 public boolean getPreferencesUniquePerLayout() {
1291 return _preferencesUniquePerLayout;
1292 }
1293
1294
1299 public String getPreferencesValidator() {
1300 return _preferencesValidator;
1301 }
1302
1303
1310 public boolean getPrivateRequestAttributes() {
1311 return _privateRequestAttributes;
1312 }
1313
1314
1321 public boolean getPrivateSessionAttributes() {
1322 return _privateSessionAttributes;
1323 }
1324
1325
1332 public QName getProcessingEvent(String uri, String localPart) {
1333 return _processingEventsByQName.get(
1334 PortletQNameUtil.getKey(uri, localPart));
1335 }
1336
1337
1342 public Set<QName> getProcessingEvents() {
1343 return _processingEvents;
1344 }
1345
1346
1351 public PublicRenderParameter getPublicRenderParameter(String identifier) {
1352 return _publicRenderParametersByIdentifier.get(identifier);
1353 }
1354
1355
1362 public PublicRenderParameter getPublicRenderParameter(
1363 String uri, String localPart) {
1364
1365 return _publicRenderParametersByQName.get(
1366 PortletQNameUtil.getKey(uri, localPart));
1367 }
1368
1369
1374 public Set<PublicRenderParameter> getPublicRenderParameters() {
1375 return _publicRenderParameters;
1376 }
1377
1378
1383 public Set<QName> getPublishingEvents() {
1384 return _publishingEvents;
1385 }
1386
1387
1392 public boolean getReady() {
1393 return isReady();
1394 }
1395
1396
1401 public boolean getRemoteable() {
1402 return _remoteable;
1403 }
1404
1405
1410 public int getRenderTimeout() {
1411 return _renderTimeout;
1412 }
1413
1414
1419 public int getRenderWeight() {
1420 return _renderWeight;
1421 }
1422
1423
1428 public String getResourceBundle() {
1429 return _resourceBundle;
1430 }
1431
1432
1439 public boolean getRestoreCurrentView() {
1440 return _restoreCurrentView;
1441 }
1442
1443
1448 public Map<String, String> getRoleMappers() {
1449 return _roleMappers;
1450 }
1451
1452
1457 public String[] getRolesArray() {
1458 return _rolesArray;
1459 }
1460
1461
1466 public Portlet getRootPortlet() {
1467 return _rootPortlet;
1468 }
1469
1470
1475 public String getRootPortletId() {
1476 return PortletConstants.getRootPortletId(getPortletId());
1477 }
1478
1479
1484 public List<SchedulerEntry> getSchedulerEntries() {
1485 return _schedulerEntries;
1486 }
1487
1488
1493 public boolean getScopeable() {
1494 return _scopeable;
1495 }
1496
1497
1504 public boolean getShowPortletAccessDenied() {
1505 return _showPortletAccessDenied;
1506 }
1507
1508
1514 public boolean getShowPortletInactive() {
1515 return _showPortletInactive;
1516 }
1517
1518
1523 public String getSocialActivityInterpreterClass() {
1524 return _socialActivityInterpreterClass;
1525 }
1526
1527
1534 public SocialActivityInterpreter getSocialActivityInterpreterInstance() {
1535 if (Validator.isNull(getSocialActivityInterpreterClass())) {
1536 return null;
1537 }
1538
1539 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1540
1541 return portletBag.getSocialActivityInterpreterInstance();
1542 }
1543
1544
1549 public String getSocialRequestInterpreterClass() {
1550 return _socialRequestInterpreterClass;
1551 }
1552
1553
1560 public SocialRequestInterpreter getSocialRequestInterpreterInstance() {
1561 if (Validator.isNull(getSocialRequestInterpreterClass())) {
1562 return null;
1563 }
1564
1565 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1566
1567 return portletBag.getSocialRequestInterpreterInstance();
1568 }
1569
1570
1577 public boolean getStatic() {
1578 return _staticPortlet;
1579 }
1580
1581
1588 public boolean getStaticEnd() {
1589 return !_staticPortletStart;
1590 }
1591
1592
1597 public String getStaticResourcePath() {
1598 String proxyPath = PortalUtil.getPathProxy();
1599
1600 String virtualPath = getVirtualPath();
1601
1602 if (Validator.isNotNull(virtualPath)) {
1603 return proxyPath.concat(virtualPath);
1604 }
1605
1606 String contextPath = getContextPath();
1607
1608 if (!_portletApp.isWARFile()) {
1609 return contextPath;
1610 }
1611
1612 return proxyPath.concat(contextPath);
1613 }
1614
1615
1622 public boolean getStaticStart() {
1623 return _staticPortletStart;
1624 }
1625
1626
1631 public String getStrutsPath() {
1632 return _strutsPath;
1633 }
1634
1635
1640 public Set<String> getSupportedLocales() {
1641 return _supportedLocales;
1642 }
1643
1644
1651 public boolean getSystem() {
1652 return _system;
1653 }
1654
1655
1660 public long getTimestamp() {
1661 return _timestamp;
1662 }
1663
1664
1670 public boolean getUndeployedPortlet() {
1671 return _undeployedPortlet;
1672 }
1673
1674
1679 public Set<String> getUnlinkedRoles() {
1680 return _unlinkedRoles;
1681 }
1682
1683
1688 public String getURLEncoderClass() {
1689 return _urlEncoderClass;
1690 }
1691
1692
1697 public URLEncoder getURLEncoderInstance() {
1698 if (Validator.isNull(getURLEncoderClass())) {
1699 return null;
1700 }
1701
1702 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1703
1704 return portletBag.getURLEncoderInstance();
1705 }
1706
1707
1712 public boolean getUseDefaultTemplate() {
1713 return _useDefaultTemplate;
1714 }
1715
1716
1721 public String getUserPrincipalStrategy() {
1722 return _userPrincipalStrategy;
1723 }
1724
1725
1730 public String getVirtualPath() {
1731 return _virtualPath;
1732 }
1733
1734
1739 public String getWebDAVStorageClass() {
1740 return _webDAVStorageClass;
1741 }
1742
1743
1748 public WebDAVStorage getWebDAVStorageInstance() {
1749 if (Validator.isNull(getWebDAVStorageClass())) {
1750 return null;
1751 }
1752
1753 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1754
1755 return portletBag.getWebDAVStorageInstance();
1756 }
1757
1758
1763 public String getWebDAVStorageToken() {
1764 return _webDAVStorageToken;
1765 }
1766
1767
1772 public Map<String, Set<String>> getWindowStates() {
1773 return _windowStates;
1774 }
1775
1776
1783 public List<String> getWorkflowHandlerClasses() {
1784 return _workflowHandlerClasses;
1785 }
1786
1787
1792 public List<WorkflowHandler> getWorkflowHandlerInstances() {
1793 if (getWorkflowHandlerClasses().isEmpty()) {
1794 return null;
1795 }
1796
1797 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1798
1799 return portletBag.getWorkflowHandlerInstances();
1800 }
1801
1802
1807 public String getXmlRpcMethodClass() {
1808 return _xmlRpcMethodClass;
1809 }
1810
1811
1816 public Method getXmlRpcMethodInstance() {
1817 if (Validator.isNull(getXmlRpcMethodClass())) {
1818 return null;
1819 }
1820
1821 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1822
1823 return portletBag.getXmlRpcMethodInstance();
1824 }
1825
1826
1833 public boolean hasAddPortletPermission(long userId) {
1834 PermissionChecker permissionChecker =
1835 PermissionThreadLocal.getPermissionChecker();
1836
1837 try {
1838 if ((permissionChecker == null) ||
1839 (permissionChecker.getUserId() != userId)) {
1840
1841 User user = UserLocalServiceUtil.getUser(userId);
1842
1843 permissionChecker = PermissionCheckerFactoryUtil.create(user);
1844 }
1845
1846 if (PortletPermissionUtil.contains(
1847 permissionChecker, getRootPortletId(),
1848 ActionKeys.ADD_TO_PAGE)) {
1849
1850 return true;
1851 }
1852 }
1853 catch (Exception e) {
1854 _log.error(e, e);
1855 }
1856
1857 return false;
1858 }
1859
1860
1866 public boolean hasMultipleMimeTypes() {
1867 if (_portletModes.size() > 1) {
1868 return true;
1869 }
1870 else {
1871 return false;
1872 }
1873 }
1874
1875
1882 public boolean hasPortletMode(String mimeType, PortletMode portletMode) {
1883 if (mimeType == null) {
1884 mimeType = ContentTypes.TEXT_HTML;
1885 }
1886
1887 Set<String> mimeTypePortletModes = _portletModes.get(mimeType);
1888
1889 if (mimeTypePortletModes == null) {
1890 return false;
1891 }
1892
1893 if (mimeTypePortletModes.contains(portletMode.toString())) {
1894 return true;
1895 }
1896 else {
1897 return false;
1898 }
1899 }
1900
1901
1908 public boolean hasRoleWithName(String roleName) {
1909 if ((_rolesArray == null) || (_rolesArray.length == 0)) {
1910 return false;
1911 }
1912
1913 for (int i = 0; i < _rolesArray.length; i++) {
1914 if (_rolesArray[i].equalsIgnoreCase(roleName)) {
1915 return true;
1916 }
1917 }
1918
1919 return false;
1920 }
1921
1922
1929 public boolean hasWindowState(String mimeType, WindowState windowState) {
1930 if (mimeType == null) {
1931 mimeType = ContentTypes.TEXT_HTML;
1932 }
1933
1934 Set<String> mimeTypeWindowStates = _windowStates.get(mimeType);
1935
1936 if (mimeTypeWindowStates == null) {
1937 return false;
1938 }
1939
1940 if (mimeTypeWindowStates.contains(windowState.toString())) {
1941 return true;
1942 }
1943 else {
1944 return false;
1945 }
1946 }
1947
1948
1955 public boolean isActionURLRedirect() {
1956 return _actionURLRedirect;
1957 }
1958
1959
1966 public boolean isAddDefaultResource() {
1967 return _addDefaultResource;
1968 }
1969
1970
1975 public boolean isAjaxable() {
1976 return _ajaxable;
1977 }
1978
1979
1986 public boolean isInclude() {
1987 return _include;
1988 }
1989
1990
1997 public boolean isInstanceable() {
1998 return _instanceable;
1999 }
2000
2001
2007 public boolean isLayoutCacheable() {
2008 return _layoutCacheable;
2009 }
2010
2011
2018 public boolean isMaximizeEdit() {
2019 return _maximizeEdit;
2020 }
2021
2022
2029 public boolean isMaximizeHelp() {
2030 return _maximizeHelp;
2031 }
2032
2033
2040 public boolean isPopUpPrint() {
2041 return _popUpPrint;
2042 }
2043
2044
2051 public boolean isPreferencesCompanyWide() {
2052 return _preferencesCompanyWide;
2053 }
2054
2055
2064 public boolean isPreferencesOwnedByGroup() {
2065 return _preferencesOwnedByGroup;
2066 }
2067
2068
2073 public boolean isPreferencesUniquePerLayout() {
2074 return _preferencesUniquePerLayout;
2075 }
2076
2077
2084 public boolean isPrivateRequestAttributes() {
2085 return _privateRequestAttributes;
2086 }
2087
2088
2095 public boolean isPrivateSessionAttributes() {
2096 return _privateSessionAttributes;
2097 }
2098
2099
2104 public boolean isReady() {
2105 Boolean ready = _readyMap.get(getRootPortletId());
2106
2107 if (ready == null) {
2108 return true;
2109 }
2110 else {
2111 return ready;
2112 }
2113 }
2114
2115
2120 public boolean isRemoteable() {
2121 return _remoteable;
2122 }
2123
2124
2131 public boolean isRestoreCurrentView() {
2132 return _restoreCurrentView;
2133 }
2134
2135
2140 public boolean isScopeable() {
2141 return _scopeable;
2142 }
2143
2144
2151 public boolean isShowPortletAccessDenied() {
2152 return _showPortletAccessDenied;
2153 }
2154
2155
2161 public boolean isShowPortletInactive() {
2162 return _showPortletInactive;
2163 }
2164
2165
2172 public boolean isStatic() {
2173 return _staticPortlet;
2174 }
2175
2176
2183 public boolean isStaticEnd() {
2184 return !_staticPortletStart;
2185 }
2186
2187
2194 public boolean isStaticStart() {
2195 return _staticPortletStart;
2196 }
2197
2198
2205 public boolean isSystem() {
2206 return _system;
2207 }
2208
2209
2215 public boolean isUndeployedPortlet() {
2216 return _undeployedPortlet;
2217 }
2218
2219
2224 public boolean isUseDefaultTemplate() {
2225 return _useDefaultTemplate;
2226 }
2227
2228
2232 public void linkRoles() {
2233 List<String> linkedRoles = new ArrayList<String>();
2234
2235 Iterator<String> itr = _unlinkedRoles.iterator();
2236
2237 while (itr.hasNext()) {
2238 String unlinkedRole = itr.next();
2239
2240 String roleLink = _roleMappers.get(unlinkedRole);
2241
2242 if (Validator.isNotNull(roleLink)) {
2243 if (_log.isDebugEnabled()) {
2244 _log.debug(
2245 "Linking role for portlet [" + getPortletId() +
2246 "] with role-name [" + unlinkedRole +
2247 "] to role-link [" + roleLink + "]");
2248 }
2249
2250 linkedRoles.add(roleLink);
2251 }
2252 else {
2253 _log.error(
2254 "Unable to link role for portlet [" + getPortletId() +
2255 "] with role-name [" + unlinkedRole +
2256 "] because role-link is null");
2257 }
2258 }
2259
2260 String[] array = linkedRoles.toArray(new String[linkedRoles.size()]);
2261
2262 Arrays.sort(array);
2263
2264 setRolesArray(array);
2265 }
2266
2267
2272 public void setActionTimeout(int actionTimeout) {
2273 _actionTimeout = actionTimeout;
2274 }
2275
2276
2283 public void setActionURLRedirect(boolean actionURLRedirect) {
2284 _actionURLRedirect = actionURLRedirect;
2285 }
2286
2287
2294 public void setAddDefaultResource(boolean addDefaultResource) {
2295 _addDefaultResource = addDefaultResource;
2296 }
2297
2298
2304 public void setAjaxable(boolean ajaxable) {
2305 _ajaxable = ajaxable;
2306 }
2307
2308
2315 public void setAssetRendererFactoryClasses(
2316 List<String> assetRendererFactoryClasses) {
2317
2318 _assetRendererFactoryClasses = assetRendererFactoryClasses;
2319 }
2320
2321
2328 public void setAtomCollectionAdapterClasses(
2329 List<String> atomCollectionAdapterClasses) {
2330
2331 _atomCollectionAdapterClasses = atomCollectionAdapterClasses;
2332 }
2333
2334
2341 public void setAutopropagatedParameters(
2342 Set<String> autopropagatedParameters) {
2343
2344 _autopropagatedParameters = autopropagatedParameters;
2345 }
2346
2347
2353 public void setConfigurationActionClass(String configurationActionClass) {
2354 _configurationActionClass = configurationActionClass;
2355 }
2356
2357
2364 public void setControlPanelEntryCategory(String controlPanelEntryCategory) {
2365 _controlPanelEntryCategory = controlPanelEntryCategory;
2366 }
2367
2368
2375 public void setControlPanelEntryClass(String controlPanelEntryClass) {
2376 _controlPanelEntryClass = controlPanelEntryClass;
2377 }
2378
2379
2387 public void setControlPanelEntryWeight(double controlPanelEntryWeight) {
2388 _controlPanelEntryWeight = controlPanelEntryWeight;
2389 }
2390
2391
2398 public void setCssClassWrapper(String cssClassWrapper) {
2399 _cssClassWrapper = cssClassWrapper;
2400 }
2401
2402
2409 public void setCustomAttributesDisplayClasses(
2410 List<String> customAttributesDisplayClasses) {
2411
2412 _customAttributesDisplayClasses = customAttributesDisplayClasses;
2413 }
2414
2415
2420 public void setDefaultPluginSetting(PluginSetting pluginSetting) {
2421 _defaultPluginSetting = pluginSetting;
2422 }
2423
2424
2429 public void setDefaultPreferences(String defaultPreferences) {
2430 _defaultPreferences = defaultPreferences;
2431 }
2432
2433
2438 public void setDisplayName(String displayName) {
2439 _displayName = displayName;
2440 }
2441
2442
2447 public void setExpCache(Integer expCache) {
2448 _expCache = expCache;
2449 }
2450
2451
2456 public void setFacebookIntegration(String facebookIntegration) {
2457 if (Validator.isNotNull(facebookIntegration)) {
2458 _facebookIntegration = facebookIntegration;
2459 }
2460 }
2461
2462
2469 public void setFooterPortalCss(List<String> footerPortalCss) {
2470 _footerPortalCss = footerPortalCss;
2471 }
2472
2473
2481 public void setFooterPortalJavaScript(List<String> footerPortalJavaScript) {
2482 _footerPortalJavaScript = footerPortalJavaScript;
2483 }
2484
2485
2492 public void setFooterPortletCss(List<String> footerPortletCss) {
2493 _footerPortletCss = footerPortletCss;
2494 }
2495
2496
2504 public void setFooterPortletJavaScript(
2505 List<String> footerPortletJavaScript) {
2506
2507 _footerPortletJavaScript = footerPortletJavaScript;
2508 }
2509
2510
2516 public void setFriendlyURLMapperClass(String friendlyURLMapperClass) {
2517 _friendlyURLMapperClass = friendlyURLMapperClass;
2518 }
2519
2520
2526 public void setFriendlyURLMapping(String friendlyURLMapping) {
2527 _friendlyURLMapping = friendlyURLMapping;
2528 }
2529
2530
2537 public void setFriendlyURLRoutes(String friendlyURLRoutes) {
2538 _friendlyURLRoutes = friendlyURLRoutes;
2539 }
2540
2541
2548 public void setHeaderPortalCss(List<String> headerPortalCss) {
2549 _headerPortalCss = headerPortalCss;
2550 }
2551
2552
2560 public void setHeaderPortalJavaScript(List<String> headerPortalJavaScript) {
2561 _headerPortalJavaScript = headerPortalJavaScript;
2562 }
2563
2564
2571 public void setHeaderPortletCss(List<String> headerPortletCss) {
2572 _headerPortletCss = headerPortletCss;
2573 }
2574
2575
2583 public void setHeaderPortletJavaScript(
2584 List<String> headerPortletJavaScript) {
2585
2586 _headerPortletJavaScript = headerPortletJavaScript;
2587 }
2588
2589
2594 public void setIcon(String icon) {
2595 _icon = icon;
2596 }
2597
2598
2605 public void setInclude(boolean include) {
2606 _include = include;
2607 }
2608
2609
2616 public void setIndexerClasses(List<String> indexerClasses) {
2617 _indexerClasses = indexerClasses;
2618 }
2619
2620
2625 public void setInitParams(Map<String, String> initParams) {
2626 _initParams = initParams;
2627 }
2628
2629
2636 public void setInstanceable(boolean instanceable) {
2637 _instanceable = instanceable;
2638 }
2639
2640
2647 public void setLayoutCacheable(boolean layoutCacheable) {
2648 _layoutCacheable = layoutCacheable;
2649 }
2650
2651
2658 public void setMaximizeEdit(boolean maximizeEdit) {
2659 _maximizeEdit = maximizeEdit;
2660 }
2661
2662
2669 public void setMaximizeHelp(boolean maximizeHelp) {
2670 _maximizeHelp = maximizeHelp;
2671 }
2672
2673
2678 public void setOpenSearchClass(String openSearchClass) {
2679 _openSearchClass = openSearchClass;
2680 }
2681
2682
2687 public void setParentStrutsPath(String parentStrutsPath) {
2688 _parentStrutsPath = parentStrutsPath;
2689 }
2690
2691
2694 public void setPermissionPropagatorClass(String permissionPropagatorClass) {
2695 _permissionPropagatorClass = permissionPropagatorClass;
2696 }
2697
2698
2703 public void setPluginPackage(PluginPackage pluginPackage) {
2704 _pluginPackage = pluginPackage;
2705 }
2706
2707
2713 public void setPollerProcessorClass(String pollerProcessorClass) {
2714 _pollerProcessorClass = pollerProcessorClass;
2715 }
2716
2717
2723 public void setPopMessageListenerClass(String popMessageListenerClass) {
2724 _popMessageListenerClass = popMessageListenerClass;
2725 }
2726
2727
2734 public void setPopUpPrint(boolean popUpPrint) {
2735 _popUpPrint = popUpPrint;
2736 }
2737
2738
2743 public void setPortletApp(PortletApp portletApp) {
2744 _portletApp = portletApp;
2745
2746 _portletApp.addPortlet(this);
2747 }
2748
2749
2754 public void setPortletClass(String portletClass) {
2755 _portletClass = portletClass;
2756 }
2757
2758
2764 public void setPortletDataHandlerClass(String portletDataHandlerClass) {
2765 _portletDataHandlerClass = portletDataHandlerClass;
2766 }
2767
2768
2773 public void setPortletFilters(Map<String, PortletFilter> portletFilters) {
2774 _portletFilters = portletFilters;
2775 }
2776
2777
2782 public void setPortletInfo(PortletInfo portletInfo) {
2783 _portletInfo = portletInfo;
2784 }
2785
2786
2792 public void setPortletLayoutListenerClass(
2793 String portletLayoutListenerClass) {
2794
2795 _portletLayoutListenerClass = portletLayoutListenerClass;
2796 }
2797
2798
2803 public void setPortletModes(Map<String, Set<String>> portletModes) {
2804 _portletModes = portletModes;
2805 }
2806
2807
2812 public void setPortletName(String portletName) {
2813 _portletName = portletName;
2814 }
2815
2816
2821 public void setPortletURLClass(String portletURLClass) {
2822 _portletURLClass = portletURLClass;
2823 }
2824
2825
2832 public void setPreferencesCompanyWide(boolean preferencesCompanyWide) {
2833 _preferencesCompanyWide = preferencesCompanyWide;
2834 }
2835
2836
2845 public void setPreferencesOwnedByGroup(boolean preferencesOwnedByGroup) {
2846 _preferencesOwnedByGroup = preferencesOwnedByGroup;
2847 }
2848
2849
2855 public void setPreferencesUniquePerLayout(
2856 boolean preferencesUniquePerLayout) {
2857
2858 _preferencesUniquePerLayout = preferencesUniquePerLayout;
2859 }
2860
2861
2867 public void setPreferencesValidator(String preferencesValidator) {
2868 if (preferencesValidator != null) {
2869
2870
2871
2872
2873 _preferencesValidator = preferencesValidator.trim();
2874 }
2875 else {
2876 _preferencesValidator = null;
2877 }
2878 }
2879
2880
2888 public void setPrivateRequestAttributes(boolean privateRequestAttributes) {
2889 _privateRequestAttributes = privateRequestAttributes;
2890 }
2891
2892
2899 public void setPrivateSessionAttributes(boolean privateSessionAttributes) {
2900 _privateSessionAttributes = privateSessionAttributes;
2901 }
2902
2903
2908 public void setProcessingEvents(Set<QName> processingEvents) {
2909 for (QName processingEvent : processingEvents) {
2910 addProcessingEvent(processingEvent);
2911 }
2912 }
2913
2914
2920 public void setPublicRenderParameters(
2921 Set<PublicRenderParameter> publicRenderParameters) {
2922
2923 for (PublicRenderParameter publicRenderParameter :
2924 publicRenderParameters) {
2925
2926 addPublicRenderParameter(publicRenderParameter);
2927 }
2928 }
2929
2930
2935 public void setPublishingEvents(Set<QName> publishingEvents) {
2936 for (QName publishingEvent : publishingEvents) {
2937 addPublishingEvent(publishingEvent);
2938 }
2939 }
2940
2941
2946 public void setReady(boolean ready) {
2947 _readyMap.put(getRootPortletId(), ready);
2948 }
2949
2950
2956 public void setRemoteable(boolean remoteable) {
2957 _remoteable = remoteable;
2958 }
2959
2960
2965 public void setRenderTimeout(int renderTimeout) {
2966 _renderTimeout = renderTimeout;
2967 }
2968
2969
2974 public void setRenderWeight(int renderWeight) {
2975 _renderWeight = renderWeight;
2976 }
2977
2978
2983 public void setResourceBundle(String resourceBundle) {
2984 _resourceBundle = resourceBundle;
2985 }
2986
2987
2994 public void setRestoreCurrentView(boolean restoreCurrentView) {
2995 _restoreCurrentView = restoreCurrentView;
2996 }
2997
2998
3003 public void setRoleMappers(Map<String, String> roleMappers) {
3004 _roleMappers = roleMappers;
3005 }
3006
3007
3012 @Override
3013 public void setRoles(String roles) {
3014 _rolesArray = StringUtil.split(roles);
3015
3016 super.setRoles(roles);
3017 }
3018
3019
3024 public void setRolesArray(String[] rolesArray) {
3025 _rolesArray = rolesArray;
3026
3027 super.setRoles(StringUtil.merge(rolesArray));
3028 }
3029
3030
3035 public void setSchedulerEntries(List<SchedulerEntry> schedulerEntries) {
3036 for (SchedulerEntry schedulerEntry : schedulerEntries) {
3037 addSchedulerEntry(schedulerEntry);
3038 }
3039 }
3040
3041
3047 public void setScopeable(boolean scopeable) {
3048 _scopeable = scopeable;
3049 }
3050
3051
3058 public void setShowPortletAccessDenied(boolean showPortletAccessDenied) {
3059 _showPortletAccessDenied = showPortletAccessDenied;
3060 }
3061
3062
3068 public void setShowPortletInactive(boolean showPortletInactive) {
3069 _showPortletInactive = showPortletInactive;
3070 }
3071
3072
3078 public void setSocialActivityInterpreterClass(
3079 String socialActivityInterpreterClass) {
3080
3081 _socialActivityInterpreterClass = socialActivityInterpreterClass;
3082 }
3083
3084
3090 public void setSocialRequestInterpreterClass(
3091 String socialRequestInterpreterClass) {
3092
3093 _socialRequestInterpreterClass = socialRequestInterpreterClass;
3094 }
3095
3096
3103 public void setStatic(boolean staticPortlet) {
3104 _staticPortlet = staticPortlet;
3105 }
3106
3107
3114 public void setStaticStart(boolean staticPortletStart) {
3115 _staticPortletStart = staticPortletStart;
3116 }
3117
3118
3123 public void setStrutsPath(String strutsPath) {
3124 _strutsPath = strutsPath;
3125 }
3126
3127
3132 public void setSupportedLocales(Set<String> supportedLocales) {
3133 _supportedLocales = supportedLocales;
3134 }
3135
3136
3143 public void setSystem(boolean system) {
3144 _system = system;
3145 }
3146
3147
3152 public void setTimestamp(long timestamp) {
3153 _timestamp = timestamp;
3154 }
3155
3156
3162 public void setUndeployedPortlet(boolean undeployedPortlet) {
3163 _undeployedPortlet = undeployedPortlet;
3164 }
3165
3166
3171 public void setUnlinkedRoles(Set<String> unlinkedRoles) {
3172 _unlinkedRoles = unlinkedRoles;
3173 }
3174
3175
3180 public void setURLEncoderClass(String urlEncoderClass) {
3181 _urlEncoderClass = urlEncoderClass;
3182 }
3183
3184
3190 public void setUseDefaultTemplate(boolean useDefaultTemplate) {
3191 _useDefaultTemplate = useDefaultTemplate;
3192 }
3193
3194
3199 public void setUserPrincipalStrategy(String userPrincipalStrategy) {
3200 if (Validator.isNotNull(userPrincipalStrategy)) {
3201 _userPrincipalStrategy = userPrincipalStrategy;
3202 }
3203 }
3204
3205
3210 public void setVirtualPath(String virtualPath) {
3211 if (_portletApp.isWARFile() && Validator.isNull(virtualPath)) {
3212 virtualPath = PropsValues.PORTLET_VIRTUAL_PATH;
3213 }
3214
3215 _virtualPath = virtualPath;
3216 }
3217
3218
3224 public void setWebDAVStorageClass(String webDAVStorageClass) {
3225 _webDAVStorageClass = webDAVStorageClass;
3226 }
3227
3228
3234 public void setWebDAVStorageToken(String webDAVStorageToken) {
3235 _webDAVStorageToken = webDAVStorageToken;
3236 }
3237
3238
3243 public void setWindowStates(Map<String, Set<String>> windowStates) {
3244 _windowStates = windowStates;
3245 }
3246
3247
3254 public void setWorkflowHandlerClasses(List<String> workflowHandlerClasses) {
3255 _workflowHandlerClasses = workflowHandlerClasses;
3256 }
3257
3258
3264 public void setXmlRpcMethodClass(String xmlRpcMethodClass) {
3265 _xmlRpcMethodClass = xmlRpcMethodClass;
3266 }
3267
3268
3271 private static Log _log = LogFactoryUtil.getLog(PortletImpl.class);
3272
3273
3276 private static Map<String, Boolean> _readyMap =
3277 new ConcurrentHashMap<String, Boolean>();
3278
3279
3282 private int _actionTimeout;
3283
3284
3288 private boolean _actionURLRedirect;
3289
3290
3294 private boolean _addDefaultResource;
3295
3296
3299 private boolean _ajaxable = true;
3300
3301
3305 private List<String> _assetRendererFactoryClasses;
3306
3307
3311 private List<String> _atomCollectionAdapterClasses;
3312
3313
3317 private Set<String> _autopropagatedParameters;
3318
3319
3322 private String _configurationActionClass;
3323
3324
3328 private String _controlPanelEntryCategory;
3329
3330
3334 private String _controlPanelEntryClass;
3335
3336
3340 private double _controlPanelEntryWeight = 100;
3341
3342
3346 private String _cssClassWrapper = StringPool.BLANK;
3347
3348
3352 private List<String> _customAttributesDisplayClasses;
3353
3354
3357 private PluginSetting _defaultPluginSetting;
3358
3359
3362 private String _defaultPreferences;
3363
3364
3367 private String _displayName;
3368
3369
3372 private Integer _expCache;
3373
3374
3377 private String _facebookIntegration =
3378 PortletConstants.FACEBOOK_INTEGRATION_IFRAME;
3379
3380
3384 private List<String> _footerPortalCss;
3385
3386
3390 private List<String> _footerPortalJavaScript;
3391
3392
3396 private List<String> _footerPortletCss;
3397
3398
3402 private List<String> _footerPortletJavaScript;
3403
3404
3407 private String _friendlyURLMapperClass;
3408
3409
3412 private String _friendlyURLMapping;
3413
3414
3418 private String _friendlyURLRoutes;
3419
3420
3424 private List<String> _headerPortalCss;
3425
3426
3430 private List<String> _headerPortalJavaScript;
3431
3432
3436 private List<String> _headerPortletCss;
3437
3438
3442 private List<String> _headerPortletJavaScript;
3443
3444
3447 private String _icon;
3448
3449
3453 private boolean _include = true;
3454
3455
3459 private List<String> _indexerClasses;
3460
3461
3464 private Map<String, String> _initParams;
3465
3466
3469 private boolean _instanceable;
3470
3471
3474 private boolean _layoutCacheable;
3475
3476
3480 private boolean _maximizeEdit;
3481
3482
3486 private boolean _maximizeHelp;
3487
3488
3491 private String _openSearchClass;
3492
3493
3496 private String _parentStrutsPath;
3497
3498
3501 private String _permissionPropagatorClass;
3502
3503
3506 private PluginPackage _pluginPackage;
3507
3508
3511 private String _pollerProcessorClass;
3512
3513
3516 private String _popMessageListenerClass;
3517
3518
3522 private boolean _popUpPrint = true;
3523
3524
3527 private PortletApp _portletApp;
3528
3529
3532 private String _portletClass;
3533
3534
3537 private String _portletDataHandlerClass;
3538
3539
3542 private Map<String, PortletFilter> _portletFilters;
3543
3544
3547 private PortletInfo _portletInfo;
3548
3549
3552 private String _portletLayoutListenerClass;
3553
3554
3557 private Map<String, Set<String>> _portletModes;
3558
3559
3562 private String _portletName;
3563
3564
3567 private String _portletURLClass;
3568
3569
3572 private boolean _preferencesCompanyWide;
3573
3574
3579 private boolean _preferencesOwnedByGroup = true;
3580
3581
3584 private boolean _preferencesUniquePerLayout = true;
3585
3586
3589 private String _preferencesValidator;
3590
3591
3595 private boolean _privateRequestAttributes = true;
3596
3597
3601 private boolean _privateSessionAttributes = true;
3602
3603
3606 private Set<QName> _processingEvents = new HashSet<QName>();
3607
3608
3611 private Map<String, QName> _processingEventsByQName =
3612 new HashMap<String, QName>();
3613
3614
3617 private Set<PublicRenderParameter> _publicRenderParameters =
3618 new HashSet<PublicRenderParameter>();
3619
3620
3624 private Map<String, PublicRenderParameter>
3625 _publicRenderParametersByIdentifier =
3626 new HashMap<String, PublicRenderParameter>();
3627
3628
3632 private Map<String, PublicRenderParameter>
3633 _publicRenderParametersByQName =
3634 new HashMap<String, PublicRenderParameter>();
3635
3636
3639 private Set<QName> _publishingEvents = new HashSet<QName>();
3640
3641
3644 private boolean _remoteable;
3645
3646
3649 private int _renderTimeout;
3650
3651
3654 private int _renderWeight = 1;
3655
3656
3659 private String _resourceBundle;
3660
3661
3665 private boolean _restoreCurrentView = true;
3666
3667
3670 private Map<String, String> _roleMappers;
3671
3672
3675 private String[] _rolesArray = new String[0];
3676
3677
3680 private Portlet _rootPortlet = this;
3681
3682
3685 private List<SchedulerEntry> _schedulerEntries;
3686
3687
3690 private boolean _scopeable;
3691
3692
3696 private boolean _showPortletAccessDenied =
3697 PropsValues.LAYOUT_SHOW_PORTLET_ACCESS_DENIED;
3698
3699
3702 private boolean _showPortletInactive =
3703 PropsValues.LAYOUT_SHOW_PORTLET_INACTIVE;
3704
3705
3708 private String _socialActivityInterpreterClass;
3709
3710
3713 private String _socialRequestInterpreterClass;
3714
3715
3719 private boolean _staticPortlet;
3720
3721
3725 private boolean _staticPortletStart;
3726
3727
3730 private String _strutsPath;
3731
3732
3735 private Set<String> _supportedLocales;
3736
3737
3741 private boolean _system;
3742
3743
3746 private long _timestamp;
3747
3748
3751 private boolean _undeployedPortlet = false;
3752
3753
3756 private Set<String> _unlinkedRoles;
3757
3758
3761 private String _urlEncoderClass;
3762
3763
3766 private boolean _useDefaultTemplate = true;
3767
3768
3771 private String _userPrincipalStrategy =
3772 PortletConstants.USER_PRINCIPAL_STRATEGY_USER_ID;
3773
3774
3777 private String _virtualPath;
3778
3779
3782 private String _webDAVStorageClass;
3783
3784
3787 private String _webDAVStorageToken;
3788
3789
3792 private Map<String, Set<String>> _windowStates;
3793
3794
3798 private List<String> _workflowHandlerClasses;
3799
3800
3803 private String _xmlRpcMethodClass;
3804
3805 }