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.portletdisplaytemplate.PortletDisplayTemplateHandler;
030 import com.liferay.portal.kernel.scheduler.SchedulerEntry;
031 import com.liferay.portal.kernel.search.Indexer;
032 import com.liferay.portal.kernel.search.OpenSearch;
033 import com.liferay.portal.kernel.servlet.ServletContextPool;
034 import com.liferay.portal.kernel.servlet.URLEncoder;
035 import com.liferay.portal.kernel.trash.TrashHandler;
036 import com.liferay.portal.kernel.util.ContentTypes;
037 import com.liferay.portal.kernel.util.ContextPathUtil;
038 import com.liferay.portal.kernel.util.StringPool;
039 import com.liferay.portal.kernel.util.StringUtil;
040 import com.liferay.portal.kernel.util.Validator;
041 import com.liferay.portal.kernel.webdav.WebDAVStorage;
042 import com.liferay.portal.kernel.workflow.WorkflowHandler;
043 import com.liferay.portal.kernel.xml.QName;
044 import com.liferay.portal.kernel.xmlrpc.Method;
045 import com.liferay.portal.model.Plugin;
046 import com.liferay.portal.model.PluginSetting;
047 import com.liferay.portal.model.Portlet;
048 import com.liferay.portal.model.PortletApp;
049 import com.liferay.portal.model.PortletConstants;
050 import com.liferay.portal.model.PortletFilter;
051 import com.liferay.portal.model.PortletInfo;
052 import com.liferay.portal.model.PublicRenderParameter;
053 import com.liferay.portal.model.User;
054 import com.liferay.portal.security.permission.ActionKeys;
055 import com.liferay.portal.security.permission.PermissionChecker;
056 import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil;
057 import com.liferay.portal.security.permission.PermissionPropagator;
058 import com.liferay.portal.security.permission.PermissionThreadLocal;
059 import com.liferay.portal.service.UserLocalServiceUtil;
060 import com.liferay.portal.service.permission.PortletPermissionUtil;
061 import com.liferay.portal.util.PortalUtil;
062 import com.liferay.portal.util.PropsValues;
063 import com.liferay.portlet.ControlPanelEntry;
064 import com.liferay.portlet.PortletQNameUtil;
065 import com.liferay.portlet.asset.model.AssetRendererFactory;
066 import com.liferay.portlet.expando.model.CustomAttributesDisplay;
067 import com.liferay.portlet.social.model.SocialActivityInterpreter;
068 import com.liferay.portlet.social.model.SocialRequestInterpreter;
069 import com.liferay.util.bridges.alloy.AlloyPortlet;
070
071 import java.util.ArrayList;
072 import java.util.Arrays;
073 import java.util.Collections;
074 import java.util.HashMap;
075 import java.util.HashSet;
076 import java.util.LinkedHashMap;
077 import java.util.LinkedHashSet;
078 import java.util.List;
079 import java.util.Map;
080 import java.util.Set;
081 import java.util.TreeSet;
082 import java.util.concurrent.ConcurrentHashMap;
083
084 import javax.portlet.PortletMode;
085 import javax.portlet.WindowState;
086
087 import javax.servlet.ServletContext;
088
089
092 public class PortletImpl extends PortletBaseImpl {
093
094
097 public PortletImpl() {
098 }
099
100
103 public PortletImpl(long companyId, String portletId) {
104 setCompanyId(companyId);
105 setPortletId(portletId);
106 setStrutsPath(portletId);
107 setActive(true);
108 _indexerClasses = new ArrayList<String>();
109 _schedulerEntries = new ArrayList<SchedulerEntry>();
110 _assetRendererFactoryClasses = new ArrayList<String>();
111 _atomCollectionAdapterClasses = new ArrayList<String>();
112 _customAttributesDisplayClasses = new ArrayList<String>();
113 _trashHandlerClasses = new ArrayList<String>();
114 _workflowHandlerClasses = new ArrayList<String>();
115 _autopropagatedParameters = new LinkedHashSet<String>();
116 _headerPortalCss = new ArrayList<String>();
117 _headerPortletCss = new ArrayList<String>();
118 _headerPortalJavaScript = new ArrayList<String>();
119 _headerPortletJavaScript = new ArrayList<String>();
120 _footerPortalCss = new ArrayList<String>();
121 _footerPortletCss = new ArrayList<String>();
122 _footerPortalJavaScript = new ArrayList<String>();
123 _footerPortletJavaScript = new ArrayList<String>();
124 _unlinkedRoles = new HashSet<String>();
125 _roleMappers = new LinkedHashMap<String, String>();
126 _initParams = new HashMap<String, String>();
127 _portletModes = new HashMap<String, Set<String>>();
128 _windowStates = new HashMap<String, Set<String>>();
129 _supportedLocales = new HashSet<String>();
130 _portletFilters = new LinkedHashMap<String, PortletFilter>();
131 _processingEvents = new HashSet<QName>();
132 _publishingEvents = new HashSet<QName>();
133 _publicRenderParameters = new HashSet<PublicRenderParameter>();
134 }
135
136
139 public PortletImpl(
140 String portletId, Portlet rootPortlet, PluginPackage pluginPackage,
141 PluginSetting pluginSetting, long companyId, long timestamp,
142 String icon, String virtualPath, String strutsPath,
143 String parentStrutsPath, String portletName, String displayName,
144 String portletClass, String configurationActionClass,
145 List<String> indexerClasses, String openSearchClass,
146 List<SchedulerEntry> schedulerEntries, String portletURLClass,
147 String friendlyURLMapperClass, String friendlyURLMapping,
148 String friendlyURLRoutes, String urlEncoderClass,
149 String portletDataHandlerClass,
150 String portletDisplayTemplateHandlerClass,
151 String portletLayoutListenerClass, String pollerProcessorClass,
152 String popMessageListenerClass, String socialActivityInterpreterClass,
153 String socialRequestInterpreterClass, String webDAVStorageToken,
154 String webDAVStorageClass, String xmlRpcMethodClass,
155 String controlPanelEntryCategory, double controlPanelEntryWeight,
156 String controlPanelClass, List<String> assetRendererFactoryClasses,
157 List<String> atomCollectionAdapterClasses,
158 List<String> customAttributesDisplayClasses,
159 String permissionPropagatorClass, List<String> trashHandlerClasses,
160 List<String> workflowHandlerClasses, String defaultPreferences,
161 String preferencesValidator, boolean preferencesCompanyWide,
162 boolean preferencesUniquePerLayout, boolean preferencesOwnedByGroup,
163 boolean useDefaultTemplate, boolean showPortletAccessDenied,
164 boolean showPortletInactive, boolean actionURLRedirect,
165 boolean restoreCurrentView, boolean maximizeEdit, boolean maximizeHelp,
166 boolean popUpPrint, boolean layoutCacheable, boolean instanceable,
167 boolean remoteable, boolean scopeable, String userPrincipalStrategy,
168 boolean privateRequestAttributes, boolean privateSessionAttributes,
169 Set<String> autopropagatedParameters, int actionTimeout,
170 int renderTimeout, int renderWeight, boolean ajaxable,
171 List<String> headerPortalCss, List<String> headerPortletCss,
172 List<String> headerPortalJavaScript,
173 List<String> headerPortletJavaScript, List<String> footerPortalCss,
174 List<String> footerPortletCss, List<String> footerPortalJavaScript,
175 List<String> footerPortletJavaScript, String cssClassWrapper,
176 String facebookIntegration, boolean addDefaultResource, String roles,
177 Set<String> unlinkedRoles, Map<String, String> roleMappers,
178 boolean system, boolean active, boolean include,
179 Map<String, String> initParams, Integer expCache,
180 Map<String, Set<String>> portletModes,
181 Map<String, Set<String>> windowStates, Set<String> supportedLocales,
182 String resourceBundle, PortletInfo portletInfo,
183 Map<String, PortletFilter> portletFilters, Set<QName> processingEvents,
184 Set<QName> publishingEvents,
185 Set<PublicRenderParameter> publicRenderParameters,
186 PortletApp portletApp) {
187
188 setPortletId(portletId);
189 _rootPortlet = rootPortlet;
190 _pluginPackage = pluginPackage;
191 _defaultPluginSetting = pluginSetting;
192 setCompanyId(companyId);
193 _timestamp = timestamp;
194 _icon = icon;
195 _virtualPath = virtualPath;
196 _strutsPath = strutsPath;
197 _portletName = portletName;
198 _parentStrutsPath = parentStrutsPath;
199 _displayName = displayName;
200 _portletClass = portletClass;
201 _configurationActionClass = configurationActionClass;
202 _indexerClasses = indexerClasses;
203 _openSearchClass = openSearchClass;
204 _schedulerEntries = schedulerEntries;
205 _portletURLClass = portletURLClass;
206 _friendlyURLMapperClass = friendlyURLMapperClass;
207 _friendlyURLMapping = friendlyURLMapping;
208 _friendlyURLRoutes = friendlyURLRoutes;
209 _urlEncoderClass = urlEncoderClass;
210 _portletDataHandlerClass = portletDataHandlerClass;
211 _portletDisplayTemplateHandlerClass =
212 portletDisplayTemplateHandlerClass;
213 _portletLayoutListenerClass = portletLayoutListenerClass;
214 _pollerProcessorClass = pollerProcessorClass;
215 _popMessageListenerClass = popMessageListenerClass;
216 _socialActivityInterpreterClass = socialActivityInterpreterClass;
217 _socialRequestInterpreterClass = socialRequestInterpreterClass;
218 _webDAVStorageToken = webDAVStorageToken;
219 _webDAVStorageClass = webDAVStorageClass;
220 _xmlRpcMethodClass = xmlRpcMethodClass;
221 _controlPanelEntryCategory = controlPanelEntryCategory;
222 _controlPanelEntryWeight = controlPanelEntryWeight;
223 _controlPanelEntryClass = controlPanelClass;
224 _assetRendererFactoryClasses = assetRendererFactoryClasses;
225 _atomCollectionAdapterClasses = atomCollectionAdapterClasses;
226 _customAttributesDisplayClasses = customAttributesDisplayClasses;
227 _permissionPropagatorClass = permissionPropagatorClass;
228 _trashHandlerClasses = trashHandlerClasses;
229 _workflowHandlerClasses = workflowHandlerClasses;
230 _defaultPreferences = defaultPreferences;
231 _preferencesValidator = preferencesValidator;
232 _preferencesCompanyWide = preferencesCompanyWide;
233 _preferencesUniquePerLayout = preferencesUniquePerLayout;
234 _preferencesOwnedByGroup = preferencesOwnedByGroup;
235 _useDefaultTemplate = useDefaultTemplate;
236 _showPortletAccessDenied = showPortletAccessDenied;
237 _showPortletInactive = showPortletInactive;
238 _actionURLRedirect = actionURLRedirect;
239 _restoreCurrentView = restoreCurrentView;
240 _maximizeEdit = maximizeEdit;
241 _maximizeHelp = maximizeHelp;
242 _popUpPrint = popUpPrint;
243 _layoutCacheable = layoutCacheable;
244 _instanceable = instanceable;
245 _remoteable = remoteable;
246 _scopeable = scopeable;
247 _userPrincipalStrategy = userPrincipalStrategy;
248 _privateRequestAttributes = privateRequestAttributes;
249 _privateSessionAttributes = privateSessionAttributes;
250 _autopropagatedParameters = autopropagatedParameters;
251 _actionTimeout = actionTimeout;
252 _renderTimeout = renderTimeout;
253 _renderWeight = renderWeight;
254 _ajaxable = ajaxable;
255 _headerPortalCss = headerPortalCss;
256 _headerPortletCss = headerPortletCss;
257 _headerPortalJavaScript = headerPortalJavaScript;
258 _headerPortletJavaScript = headerPortletJavaScript;
259 _footerPortalCss = footerPortalCss;
260 _footerPortletCss = footerPortletCss;
261 _footerPortalJavaScript = footerPortalJavaScript;
262 _footerPortletJavaScript = footerPortletJavaScript;
263 _cssClassWrapper = cssClassWrapper;
264 _facebookIntegration = facebookIntegration;
265 _scopeable = scopeable;
266 _addDefaultResource = addDefaultResource;
267 setRoles(roles);
268 _unlinkedRoles = unlinkedRoles;
269 _roleMappers = roleMappers;
270 _system = system;
271 setActive(active);
272 _include = include;
273 _initParams = initParams;
274 _expCache = expCache;
275 _portletModes = portletModes;
276 _windowStates = windowStates;
277 _supportedLocales = supportedLocales;
278 _resourceBundle = resourceBundle;
279 _portletInfo = portletInfo;
280 _portletFilters = portletFilters;
281 setProcessingEvents(processingEvents);
282 setPublishingEvents(publishingEvents);
283 setPublicRenderParameters(publicRenderParameters);
284 _portletApp = portletApp;
285 }
286
287
290 public void addProcessingEvent(QName processingEvent) {
291 _processingEvents.add(processingEvent);
292 _processingEventsByQName.put(
293 PortletQNameUtil.getKey(processingEvent), processingEvent);
294 }
295
296
301 public void addPublicRenderParameter(
302 PublicRenderParameter publicRenderParameter) {
303
304 _publicRenderParameters.add(publicRenderParameter);
305
306 String identifier = publicRenderParameter.getIdentifier();
307
308 _publicRenderParametersByIdentifier.put(
309 identifier, publicRenderParameter);
310
311 QName qName = publicRenderParameter.getQName();
312
313 _publicRenderParametersByQName.put(
314 PortletQNameUtil.getKey(qName), publicRenderParameter);
315
316 String publicRenderParameterName =
317 PortletQNameUtil.getPublicRenderParameterName(qName);
318
319 PortletQNameUtil.setPublicRenderParameterIdentifier(
320 publicRenderParameterName, identifier);
321 }
322
323
326 public void addPublishingEvent(QName publishingEvent) {
327 _publishingEvents.add(publishingEvent);
328 }
329
330
333 public void addSchedulerEntry(SchedulerEntry schedulerEntry) {
334 _schedulerEntries.add(schedulerEntry);
335 }
336
337
342 @Override
343 public Object clone() {
344 Portlet portlet = new PortletImpl(
345 getPortletId(), getRootPortlet(), getPluginPackage(),
346 getDefaultPluginSetting(), getCompanyId(), getTimestamp(),
347 getIcon(), getVirtualPath(), getStrutsPath(), getParentStrutsPath(),
348 getPortletName(), getDisplayName(), getPortletClass(),
349 getConfigurationActionClass(), getIndexerClasses(),
350 getOpenSearchClass(), getSchedulerEntries(), getPortletURLClass(),
351 getFriendlyURLMapperClass(), getFriendlyURLMapping(),
352 getFriendlyURLRoutes(), getURLEncoderClass(),
353 getPortletDataHandlerClass(),
354 getPortletDisplayTemplateHandlerClass(),
355 getPortletLayoutListenerClass(), getPollerProcessorClass(),
356 getPopMessageListenerClass(), getSocialActivityInterpreterClass(),
357 getSocialRequestInterpreterClass(), getWebDAVStorageToken(),
358 getWebDAVStorageClass(), getXmlRpcMethodClass(),
359 getControlPanelEntryCategory(), getControlPanelEntryWeight(),
360 getControlPanelEntryClass(), getAssetRendererFactoryClasses(),
361 getAtomCollectionAdapterClasses(),
362 getCustomAttributesDisplayClasses(), getPermissionPropagatorClass(),
363 getTrashHandlerClasses(), getWorkflowHandlerClasses(),
364 getDefaultPreferences(), getPreferencesValidator(),
365 isPreferencesCompanyWide(), isPreferencesUniquePerLayout(),
366 isPreferencesOwnedByGroup(), isUseDefaultTemplate(),
367 isShowPortletAccessDenied(), isShowPortletInactive(),
368 isActionURLRedirect(), isRestoreCurrentView(), isMaximizeEdit(),
369 isMaximizeHelp(), isPopUpPrint(), isLayoutCacheable(),
370 isInstanceable(), isRemoteable(), isScopeable(),
371 getUserPrincipalStrategy(), isPrivateRequestAttributes(),
372 isPrivateSessionAttributes(), getAutopropagatedParameters(),
373 getActionTimeout(), getRenderTimeout(), getRenderWeight(),
374 isAjaxable(), getHeaderPortalCss(), getHeaderPortletCss(),
375 getHeaderPortalJavaScript(), getHeaderPortletJavaScript(),
376 getFooterPortalCss(), getFooterPortletCss(),
377 getFooterPortalJavaScript(), getFooterPortletJavaScript(),
378 getCssClassWrapper(), getFacebookIntegration(),
379 isAddDefaultResource(), getRoles(), getUnlinkedRoles(),
380 getRoleMappers(), isSystem(), isActive(), isInclude(),
381 getInitParams(), getExpCache(), getPortletModes(),
382 getWindowStates(), getSupportedLocales(), getResourceBundle(),
383 getPortletInfo(), getPortletFilters(), getProcessingEvents(),
384 getPublishingEvents(), getPublicRenderParameters(),
385 getPortletApp());
386
387 portlet.setId(getId());
388 portlet.setUndeployedPortlet(isUndeployedPortlet());
389
390 return portlet;
391 }
392
393
402 @Override
403 public int compareTo(Portlet portlet) {
404 String portletId = getPortletId();
405
406 return portletId.compareTo(portlet.getPortletId());
407 }
408
409
415 @Override
416 public boolean equals(Object obj) {
417 Portlet portlet = (Portlet)obj;
418
419 String portletId = getPortletId();
420
421 return portletId.equals(portlet.getPortletId());
422 }
423
424
429 public int getActionTimeout() {
430 return _actionTimeout;
431 }
432
433
440 public boolean getActionURLRedirect() {
441 return _actionURLRedirect;
442 }
443
444
451 public boolean getAddDefaultResource() {
452 return _addDefaultResource;
453 }
454
455
460 public boolean getAjaxable() {
461 return _ajaxable;
462 }
463
464
469 public Set<String> getAllPortletModes() {
470 Set<String> allPortletModes = new TreeSet<String>();
471
472 for (Map.Entry<String, Set<String>> entry : _portletModes.entrySet()) {
473 Set<String> mimeTypePortletModes = entry.getValue();
474
475 for (String portletMode : mimeTypePortletModes) {
476 allPortletModes.add(portletMode);
477 }
478 }
479
480 return allPortletModes;
481 }
482
483
488 public Set<String> getAllWindowStates() {
489 Set<String> allWindowStates = new TreeSet<String>();
490
491 for (Map.Entry<String, Set<String>> entry : _windowStates.entrySet()) {
492 Set<String> mimeTypeWindowStates = entry.getValue();
493
494 for (String windowState : mimeTypeWindowStates) {
495 allWindowStates.add(windowState);
496 }
497 }
498
499 return allWindowStates;
500 }
501
502
509 public List<String> getAssetRendererFactoryClasses() {
510 return _assetRendererFactoryClasses;
511 }
512
513
518 public List<AssetRendererFactory> getAssetRendererFactoryInstances() {
519 if (_assetRendererFactoryClasses.isEmpty()) {
520 return null;
521 }
522
523 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
524
525 return portletBag.getAssetRendererFactoryInstances();
526 }
527
528
535 public List<String> getAtomCollectionAdapterClasses() {
536 return _atomCollectionAdapterClasses;
537 }
538
539
544 public List<AtomCollectionAdapter<?>> getAtomCollectionAdapterInstances() {
545 if (_atomCollectionAdapterClasses.isEmpty()) {
546 return null;
547 }
548
549 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
550
551 return portletBag.getAtomCollectionAdapterInstances();
552 }
553
554
561 public Set<String> getAutopropagatedParameters() {
562 return _autopropagatedParameters;
563 }
564
565
571 public Portlet getClonedInstance(String portletId) {
572 Portlet portlet = (Portlet)clone();
573
574 portlet.setPortletId(portletId);
575
576 return portlet;
577 }
578
579
584 public String getConfigurationActionClass() {
585 return _configurationActionClass;
586 }
587
588
593 public ConfigurationAction getConfigurationActionInstance() {
594 if (Validator.isNull(getConfigurationActionClass())) {
595 return null;
596 }
597
598 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
599
600 return portletBag.getConfigurationActionInstance();
601 }
602
603
608 public String getContextPath() {
609 if (!_portletApp.isWARFile()) {
610 return PortalUtil.getPathContext();
611 }
612
613 String servletContextName = _portletApp.getServletContextName();
614
615 if (ServletContextPool.containsKey(servletContextName)) {
616 ServletContext servletContext = ServletContextPool.get(
617 servletContextName);
618
619 return ContextPathUtil.getContextPath(servletContext);
620 }
621
622 return StringPool.SLASH.concat(servletContextName);
623 }
624
625
632 public String getControlPanelEntryCategory() {
633 return _controlPanelEntryCategory;
634 }
635
636
643 public String getControlPanelEntryClass() {
644 return _controlPanelEntryClass;
645 }
646
647
654 public ControlPanelEntry getControlPanelEntryInstance() {
655 if (Validator.isNull(getControlPanelEntryClass())) {
656 return null;
657 }
658
659 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
660
661 return portletBag.getControlPanelEntryInstance();
662 }
663
664
671 public double getControlPanelEntryWeight() {
672 return _controlPanelEntryWeight;
673 }
674
675
682 public String getCssClassWrapper() {
683 return _cssClassWrapper;
684 }
685
686
693 public List<String> getCustomAttributesDisplayClasses() {
694 return _customAttributesDisplayClasses;
695 }
696
697
702 public List<CustomAttributesDisplay> getCustomAttributesDisplayInstances() {
703 if (_customAttributesDisplayClasses.isEmpty()) {
704 return null;
705 }
706
707 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
708
709 return portletBag.getCustomAttributesDisplayInstances();
710 }
711
712
717 public PluginSetting getDefaultPluginSetting() {
718 return _defaultPluginSetting;
719 }
720
721
726 public String getDefaultPreferences() {
727 if (Validator.isNull(_defaultPreferences)) {
728 return PortletConstants.DEFAULT_PREFERENCES;
729 }
730 else {
731 return _defaultPreferences;
732 }
733 }
734
735
740 public String getDisplayName() {
741 return _displayName;
742 }
743
744
749 public Integer getExpCache() {
750 return _expCache;
751 }
752
753
758 public String getFacebookIntegration() {
759 return _facebookIntegration;
760 }
761
762
769 public List<String> getFooterPortalCss() {
770 return _footerPortalCss;
771 }
772
773
780 public List<String> getFooterPortalJavaScript() {
781 return _footerPortalJavaScript;
782 }
783
784
791 public List<String> getFooterPortletCss() {
792 return _footerPortletCss;
793 }
794
795
802 public List<String> getFooterPortletJavaScript() {
803 return _footerPortletJavaScript;
804 }
805
806
811 public String getFriendlyURLMapperClass() {
812 return _friendlyURLMapperClass;
813 }
814
815
820 public FriendlyURLMapper getFriendlyURLMapperInstance() {
821 if (Validator.isNull(getFriendlyURLMapperClass())) {
822 return null;
823 }
824
825 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
826
827 return portletBag.getFriendlyURLMapperInstance();
828 }
829
830
835 public String getFriendlyURLMapping() {
836 return _friendlyURLMapping;
837 }
838
839
846 public String getFriendlyURLRoutes() {
847 return _friendlyURLRoutes;
848 }
849
850
857 public List<String> getHeaderPortalCss() {
858 return _headerPortalCss;
859 }
860
861
868 public List<String> getHeaderPortalJavaScript() {
869 return _headerPortalJavaScript;
870 }
871
872
879 public List<String> getHeaderPortletCss() {
880 return _headerPortletCss;
881 }
882
883
890 public List<String> getHeaderPortletJavaScript() {
891 return _headerPortletJavaScript;
892 }
893
894
899 public String getIcon() {
900 return _icon;
901 }
902
903
910 public boolean getInclude() {
911 return _include;
912 }
913
914
921 public List<String> getIndexerClasses() {
922 return _indexerClasses;
923 }
924
925
930 public List<Indexer> getIndexerInstances() {
931 if (_indexerClasses.isEmpty() &&
932 !_portletClass.equals(AlloyPortlet.class.getName())) {
933
934 return Collections.emptyList();
935 }
936
937 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
938
939 return portletBag.getIndexerInstances();
940 }
941
942
947 public Map<String, String> getInitParams() {
948 return _initParams;
949 }
950
951
958 public boolean getInstanceable() {
959 return _instanceable;
960 }
961
962
967 public String getInstanceId() {
968 return PortletConstants.getInstanceId(getPortletId());
969 }
970
971
977 public boolean getLayoutCacheable() {
978 return _layoutCacheable;
979 }
980
981
988 public boolean getMaximizeEdit() {
989 return _maximizeEdit;
990 }
991
992
999 public boolean getMaximizeHelp() {
1000 return _maximizeHelp;
1001 }
1002
1003
1008 public String getOpenSearchClass() {
1009 return _openSearchClass;
1010 }
1011
1012
1017 public OpenSearch getOpenSearchInstance() {
1018 if (Validator.isNull(getOpenSearchClass())) {
1019 return null;
1020 }
1021
1022 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1023
1024 return portletBag.getOpenSearchInstance();
1025 }
1026
1027
1032 public String getParentStrutsPath() {
1033 return _parentStrutsPath;
1034 }
1035
1036
1041 public String getPermissionPropagatorClass() {
1042 return _permissionPropagatorClass;
1043 }
1044
1045
1050 public PermissionPropagator getPermissionPropagatorInstance() {
1051 if (Validator.isNull(getPermissionPropagatorClass())) {
1052 return null;
1053 }
1054
1055 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1056
1057 return portletBag.getPermissionPropagatorInstance();
1058 }
1059
1060
1065 public String getPluginId() {
1066 return getRootPortletId();
1067 }
1068
1069
1074 public PluginPackage getPluginPackage() {
1075 return _pluginPackage;
1076 }
1077
1078
1083 public String getPluginType() {
1084 return Plugin.TYPE_PORTLET;
1085 }
1086
1087
1092 public String getPollerProcessorClass() {
1093 return _pollerProcessorClass;
1094 }
1095
1096
1101 public PollerProcessor getPollerProcessorInstance() {
1102 if (Validator.isNull(getPollerProcessorClass())) {
1103 return null;
1104 }
1105
1106 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1107
1108 return portletBag.getPollerProcessorInstance();
1109 }
1110
1111
1116 public String getPopMessageListenerClass() {
1117 return _popMessageListenerClass;
1118 }
1119
1120
1125 public MessageListener getPopMessageListenerInstance() {
1126 if (Validator.isNull(getPopMessageListenerClass())) {
1127 return null;
1128 }
1129
1130 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1131
1132 return portletBag.getPopMessageListenerInstance();
1133 }
1134
1135
1142 public boolean getPopUpPrint() {
1143 return _popUpPrint;
1144 }
1145
1146
1151 public PortletApp getPortletApp() {
1152 return _portletApp;
1153 }
1154
1155
1160 public String getPortletClass() {
1161 return _portletClass;
1162 }
1163
1164
1169 public String getPortletDataHandlerClass() {
1170 return _portletDataHandlerClass;
1171 }
1172
1173
1178 public PortletDataHandler getPortletDataHandlerInstance() {
1179 if (Validator.isNull(getPortletDataHandlerClass())) {
1180 return null;
1181 }
1182
1183 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1184
1185 return portletBag.getPortletDataHandlerInstance();
1186 }
1187
1188
1193 public String getPortletDisplayTemplateHandlerClass() {
1194 return _portletDisplayTemplateHandlerClass;
1195 }
1196
1197
1202 public PortletDisplayTemplateHandler
1203 getPortletDisplayTemplateHandlerInstance() {
1204
1205 if (Validator.isNull(getPortletDisplayTemplateHandlerClass())) {
1206 return null;
1207 }
1208
1209 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1210
1211 return portletBag.getPortletDisplayTemplateHandlerInstance();
1212 }
1213
1214
1219 public Map<String, PortletFilter> getPortletFilters() {
1220 return _portletFilters;
1221 }
1222
1223
1228 public PortletInfo getPortletInfo() {
1229 return _portletInfo;
1230 }
1231
1232
1237 public String getPortletLayoutListenerClass() {
1238 return _portletLayoutListenerClass;
1239 }
1240
1241
1246 public PortletLayoutListener getPortletLayoutListenerInstance() {
1247 if (Validator.isNull(getPortletLayoutListenerClass())) {
1248 return null;
1249 }
1250
1251 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1252
1253 return portletBag.getPortletLayoutListenerInstance();
1254 }
1255
1256
1261 public Map<String, Set<String>> getPortletModes() {
1262 return _portletModes;
1263 }
1264
1265
1270 public String getPortletName() {
1271 return _portletName;
1272 }
1273
1274
1279 public String getPortletURLClass() {
1280 return _portletURLClass;
1281 }
1282
1283
1290 public boolean getPreferencesCompanyWide() {
1291 return _preferencesCompanyWide;
1292 }
1293
1294
1303 public boolean getPreferencesOwnedByGroup() {
1304 return _preferencesOwnedByGroup;
1305 }
1306
1307
1312 public boolean getPreferencesUniquePerLayout() {
1313 return _preferencesUniquePerLayout;
1314 }
1315
1316
1321 public String getPreferencesValidator() {
1322 return _preferencesValidator;
1323 }
1324
1325
1332 public boolean getPrivateRequestAttributes() {
1333 return _privateRequestAttributes;
1334 }
1335
1336
1343 public boolean getPrivateSessionAttributes() {
1344 return _privateSessionAttributes;
1345 }
1346
1347
1356 public QName getProcessingEvent(String uri, String localPart) {
1357 return _processingEventsByQName.get(
1358 PortletQNameUtil.getKey(uri, localPart));
1359 }
1360
1361
1366 public Set<QName> getProcessingEvents() {
1367 return _processingEvents;
1368 }
1369
1370
1376 public PublicRenderParameter getPublicRenderParameter(String identifier) {
1377 return _publicRenderParametersByIdentifier.get(identifier);
1378 }
1379
1380
1389 public PublicRenderParameter getPublicRenderParameter(
1390 String uri, String localPart) {
1391
1392 return _publicRenderParametersByQName.get(
1393 PortletQNameUtil.getKey(uri, localPart));
1394 }
1395
1396
1401 public Set<PublicRenderParameter> getPublicRenderParameters() {
1402 return _publicRenderParameters;
1403 }
1404
1405
1410 public Set<QName> getPublishingEvents() {
1411 return _publishingEvents;
1412 }
1413
1414
1419 public boolean getReady() {
1420 return isReady();
1421 }
1422
1423
1428 public boolean getRemoteable() {
1429 return _remoteable;
1430 }
1431
1432
1437 public int getRenderTimeout() {
1438 return _renderTimeout;
1439 }
1440
1441
1446 public int getRenderWeight() {
1447 return _renderWeight;
1448 }
1449
1450
1455 public String getResourceBundle() {
1456 return _resourceBundle;
1457 }
1458
1459
1466 public boolean getRestoreCurrentView() {
1467 return _restoreCurrentView;
1468 }
1469
1470
1475 public Map<String, String> getRoleMappers() {
1476 return _roleMappers;
1477 }
1478
1479
1484 public String[] getRolesArray() {
1485 return _rolesArray;
1486 }
1487
1488
1493 public Portlet getRootPortlet() {
1494 return _rootPortlet;
1495 }
1496
1497
1502 public String getRootPortletId() {
1503 return PortletConstants.getRootPortletId(getPortletId());
1504 }
1505
1506
1511 public List<SchedulerEntry> getSchedulerEntries() {
1512 return _schedulerEntries;
1513 }
1514
1515
1520 public boolean getScopeable() {
1521 return _scopeable;
1522 }
1523
1524
1531 public boolean getShowPortletAccessDenied() {
1532 return _showPortletAccessDenied;
1533 }
1534
1535
1541 public boolean getShowPortletInactive() {
1542 return _showPortletInactive;
1543 }
1544
1545
1550 public String getSocialActivityInterpreterClass() {
1551 return _socialActivityInterpreterClass;
1552 }
1553
1554
1561 public SocialActivityInterpreter getSocialActivityInterpreterInstance() {
1562 if (Validator.isNull(getSocialActivityInterpreterClass())) {
1563 return null;
1564 }
1565
1566 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1567
1568 return portletBag.getSocialActivityInterpreterInstance();
1569 }
1570
1571
1576 public String getSocialRequestInterpreterClass() {
1577 return _socialRequestInterpreterClass;
1578 }
1579
1580
1587 public SocialRequestInterpreter getSocialRequestInterpreterInstance() {
1588 if (Validator.isNull(getSocialRequestInterpreterClass())) {
1589 return null;
1590 }
1591
1592 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1593
1594 return portletBag.getSocialRequestInterpreterInstance();
1595 }
1596
1597
1604 public boolean getStatic() {
1605 return _staticPortlet;
1606 }
1607
1608
1615 public boolean getStaticEnd() {
1616 return !_staticPortletStart;
1617 }
1618
1619
1624 public String getStaticResourcePath() {
1625 String proxyPath = PortalUtil.getPathProxy();
1626
1627 String virtualPath = getVirtualPath();
1628
1629 if (Validator.isNotNull(virtualPath)) {
1630 return proxyPath.concat(virtualPath);
1631 }
1632
1633 String contextPath = getContextPath();
1634
1635 if (!_portletApp.isWARFile()) {
1636 return contextPath;
1637 }
1638
1639 return proxyPath.concat(contextPath);
1640 }
1641
1642
1649 public boolean getStaticStart() {
1650 return _staticPortletStart;
1651 }
1652
1653
1658 public String getStrutsPath() {
1659 return _strutsPath;
1660 }
1661
1662
1667 public Set<String> getSupportedLocales() {
1668 return _supportedLocales;
1669 }
1670
1671
1678 public boolean getSystem() {
1679 return _system;
1680 }
1681
1682
1687 public long getTimestamp() {
1688 return _timestamp;
1689 }
1690
1691
1698 public List<String> getTrashHandlerClasses() {
1699 return _trashHandlerClasses;
1700 }
1701
1702
1707 public List<TrashHandler> getTrashHandlerInstances() {
1708 if (_trashHandlerClasses.isEmpty()) {
1709 return null;
1710 }
1711
1712 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1713
1714 return portletBag.getTrashHandlerInstances();
1715 }
1716
1717
1723 public boolean getUndeployedPortlet() {
1724 return _undeployedPortlet;
1725 }
1726
1727
1732 public Set<String> getUnlinkedRoles() {
1733 return _unlinkedRoles;
1734 }
1735
1736
1741 public String getURLEncoderClass() {
1742 return _urlEncoderClass;
1743 }
1744
1745
1750 public URLEncoder getURLEncoderInstance() {
1751 if (Validator.isNull(getURLEncoderClass())) {
1752 return null;
1753 }
1754
1755 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1756
1757 return portletBag.getURLEncoderInstance();
1758 }
1759
1760
1765 public boolean getUseDefaultTemplate() {
1766 return _useDefaultTemplate;
1767 }
1768
1769
1775 public long getUserId() {
1776 return PortletConstants.getUserId(getPortletId());
1777 }
1778
1779
1784 public String getUserPrincipalStrategy() {
1785 return _userPrincipalStrategy;
1786 }
1787
1788
1793 public String getVirtualPath() {
1794 return _virtualPath;
1795 }
1796
1797
1802 public String getWebDAVStorageClass() {
1803 return _webDAVStorageClass;
1804 }
1805
1806
1811 public WebDAVStorage getWebDAVStorageInstance() {
1812 if (Validator.isNull(getWebDAVStorageClass())) {
1813 return null;
1814 }
1815
1816 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1817
1818 return portletBag.getWebDAVStorageInstance();
1819 }
1820
1821
1826 public String getWebDAVStorageToken() {
1827 return _webDAVStorageToken;
1828 }
1829
1830
1835 public Map<String, Set<String>> getWindowStates() {
1836 return _windowStates;
1837 }
1838
1839
1846 public List<String> getWorkflowHandlerClasses() {
1847 return _workflowHandlerClasses;
1848 }
1849
1850
1855 public List<WorkflowHandler> getWorkflowHandlerInstances() {
1856 if (_workflowHandlerClasses.isEmpty()) {
1857 return null;
1858 }
1859
1860 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1861
1862 return portletBag.getWorkflowHandlerInstances();
1863 }
1864
1865
1870 public String getXmlRpcMethodClass() {
1871 return _xmlRpcMethodClass;
1872 }
1873
1874
1879 public Method getXmlRpcMethodInstance() {
1880 if (Validator.isNull(getXmlRpcMethodClass())) {
1881 return null;
1882 }
1883
1884 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1885
1886 return portletBag.getXmlRpcMethodInstance();
1887 }
1888
1889
1897 public boolean hasAddPortletPermission(long userId) {
1898 PermissionChecker permissionChecker =
1899 PermissionThreadLocal.getPermissionChecker();
1900
1901 try {
1902 if ((permissionChecker == null) ||
1903 (permissionChecker.getUserId() != userId)) {
1904
1905 User user = UserLocalServiceUtil.getUser(userId);
1906
1907 permissionChecker = PermissionCheckerFactoryUtil.create(user);
1908 }
1909
1910 if (PortletPermissionUtil.contains(
1911 permissionChecker, getRootPortletId(),
1912 ActionKeys.ADD_TO_PAGE)) {
1913
1914 return true;
1915 }
1916 }
1917 catch (Exception e) {
1918 _log.error(e, e);
1919 }
1920
1921 return false;
1922 }
1923
1924
1930 public boolean hasMultipleMimeTypes() {
1931 if (_portletModes.size() > 1) {
1932 return true;
1933 }
1934 else {
1935 return false;
1936 }
1937 }
1938
1939
1948 public boolean hasPortletMode(String mimeType, PortletMode portletMode) {
1949 if (mimeType == null) {
1950 mimeType = ContentTypes.TEXT_HTML;
1951 }
1952
1953 Set<String> mimeTypePortletModes = _portletModes.get(mimeType);
1954
1955 if (mimeTypePortletModes == null) {
1956 return false;
1957 }
1958
1959 if (mimeTypePortletModes.contains(portletMode.toString())) {
1960 return true;
1961 }
1962 else {
1963 return false;
1964 }
1965 }
1966
1967
1975 public boolean hasRoleWithName(String roleName) {
1976 if ((_rolesArray == null) || (_rolesArray.length == 0)) {
1977 return false;
1978 }
1979
1980 for (int i = 0; i < _rolesArray.length; i++) {
1981 if (_rolesArray[i].equalsIgnoreCase(roleName)) {
1982 return true;
1983 }
1984 }
1985
1986 return false;
1987 }
1988
1989
1998 public boolean hasWindowState(String mimeType, WindowState windowState) {
1999 if (mimeType == null) {
2000 mimeType = ContentTypes.TEXT_HTML;
2001 }
2002
2003 Set<String> mimeTypeWindowStates = _windowStates.get(mimeType);
2004
2005 if (mimeTypeWindowStates == null) {
2006 return false;
2007 }
2008
2009 if (mimeTypeWindowStates.contains(windowState.toString())) {
2010 return true;
2011 }
2012 else {
2013 return false;
2014 }
2015 }
2016
2017
2024 public boolean isActionURLRedirect() {
2025 return _actionURLRedirect;
2026 }
2027
2028
2035 public boolean isAddDefaultResource() {
2036 return _addDefaultResource;
2037 }
2038
2039
2044 public boolean isAjaxable() {
2045 return _ajaxable;
2046 }
2047
2048
2055 public boolean isInclude() {
2056 return _include;
2057 }
2058
2059
2066 public boolean isInstanceable() {
2067 return _instanceable;
2068 }
2069
2070
2076 public boolean isLayoutCacheable() {
2077 return _layoutCacheable;
2078 }
2079
2080
2087 public boolean isMaximizeEdit() {
2088 return _maximizeEdit;
2089 }
2090
2091
2098 public boolean isMaximizeHelp() {
2099 return _maximizeHelp;
2100 }
2101
2102
2109 public boolean isPopUpPrint() {
2110 return _popUpPrint;
2111 }
2112
2113
2120 public boolean isPreferencesCompanyWide() {
2121 return _preferencesCompanyWide;
2122 }
2123
2124
2133 public boolean isPreferencesOwnedByGroup() {
2134 return _preferencesOwnedByGroup;
2135 }
2136
2137
2142 public boolean isPreferencesUniquePerLayout() {
2143 return _preferencesUniquePerLayout;
2144 }
2145
2146
2153 public boolean isPrivateRequestAttributes() {
2154 return _privateRequestAttributes;
2155 }
2156
2157
2164 public boolean isPrivateSessionAttributes() {
2165 return _privateSessionAttributes;
2166 }
2167
2168
2173 public boolean isReady() {
2174 Boolean ready = _readyMap.get(getRootPortletId());
2175
2176 if (ready == null) {
2177 return true;
2178 }
2179 else {
2180 return ready;
2181 }
2182 }
2183
2184
2189 public boolean isRemoteable() {
2190 return _remoteable;
2191 }
2192
2193
2200 public boolean isRestoreCurrentView() {
2201 return _restoreCurrentView;
2202 }
2203
2204
2209 public boolean isScopeable() {
2210 return _scopeable;
2211 }
2212
2213
2220 public boolean isShowPortletAccessDenied() {
2221 return _showPortletAccessDenied;
2222 }
2223
2224
2230 public boolean isShowPortletInactive() {
2231 return _showPortletInactive;
2232 }
2233
2234
2241 public boolean isStatic() {
2242 return _staticPortlet;
2243 }
2244
2245
2252 public boolean isStaticEnd() {
2253 return !_staticPortletStart;
2254 }
2255
2256
2263 public boolean isStaticStart() {
2264 return _staticPortletStart;
2265 }
2266
2267
2274 public boolean isSystem() {
2275 return _system;
2276 }
2277
2278
2284 public boolean isUndeployedPortlet() {
2285 return _undeployedPortlet;
2286 }
2287
2288
2293 public boolean isUseDefaultTemplate() {
2294 return _useDefaultTemplate;
2295 }
2296
2297
2301 public void linkRoles() {
2302 List<String> linkedRoles = new ArrayList<String>();
2303
2304 for (String unlinkedRole : _unlinkedRoles) {
2305 String roleLink = _roleMappers.get(unlinkedRole);
2306
2307 if (Validator.isNotNull(roleLink)) {
2308 if (_log.isDebugEnabled()) {
2309 _log.debug(
2310 "Linking role for portlet [" + getPortletId() +
2311 "] with role-name [" + unlinkedRole +
2312 "] to role-link [" + roleLink + "]");
2313 }
2314
2315 linkedRoles.add(roleLink);
2316 }
2317 else {
2318 _log.error(
2319 "Unable to link role for portlet [" + getPortletId() +
2320 "] with role-name [" + unlinkedRole +
2321 "] because role-link is null");
2322 }
2323 }
2324
2325 String[] array = linkedRoles.toArray(new String[linkedRoles.size()]);
2326
2327 Arrays.sort(array);
2328
2329 setRolesArray(array);
2330 }
2331
2332
2337 public void setActionTimeout(int actionTimeout) {
2338 _actionTimeout = actionTimeout;
2339 }
2340
2341
2348 public void setActionURLRedirect(boolean actionURLRedirect) {
2349 _actionURLRedirect = actionURLRedirect;
2350 }
2351
2352
2359 public void setAddDefaultResource(boolean addDefaultResource) {
2360 _addDefaultResource = addDefaultResource;
2361 }
2362
2363
2369 public void setAjaxable(boolean ajaxable) {
2370 _ajaxable = ajaxable;
2371 }
2372
2373
2380 public void setAssetRendererFactoryClasses(
2381 List<String> assetRendererFactoryClasses) {
2382
2383 _assetRendererFactoryClasses = assetRendererFactoryClasses;
2384 }
2385
2386
2393 public void setAtomCollectionAdapterClasses(
2394 List<String> atomCollectionAdapterClasses) {
2395
2396 _atomCollectionAdapterClasses = atomCollectionAdapterClasses;
2397 }
2398
2399
2406 public void setAutopropagatedParameters(
2407 Set<String> autopropagatedParameters) {
2408
2409 _autopropagatedParameters = autopropagatedParameters;
2410 }
2411
2412
2418 public void setConfigurationActionClass(String configurationActionClass) {
2419 _configurationActionClass = configurationActionClass;
2420 }
2421
2422
2429 public void setControlPanelEntryCategory(String controlPanelEntryCategory) {
2430 _controlPanelEntryCategory = controlPanelEntryCategory;
2431 }
2432
2433
2440 public void setControlPanelEntryClass(String controlPanelEntryClass) {
2441 _controlPanelEntryClass = controlPanelEntryClass;
2442 }
2443
2444
2452 public void setControlPanelEntryWeight(double controlPanelEntryWeight) {
2453 _controlPanelEntryWeight = controlPanelEntryWeight;
2454 }
2455
2456
2463 public void setCssClassWrapper(String cssClassWrapper) {
2464 _cssClassWrapper = cssClassWrapper;
2465 }
2466
2467
2474 public void setCustomAttributesDisplayClasses(
2475 List<String> customAttributesDisplayClasses) {
2476
2477 _customAttributesDisplayClasses = customAttributesDisplayClasses;
2478 }
2479
2480
2485 public void setDefaultPluginSetting(PluginSetting pluginSetting) {
2486 _defaultPluginSetting = pluginSetting;
2487 }
2488
2489
2494 public void setDefaultPreferences(String defaultPreferences) {
2495 _defaultPreferences = defaultPreferences;
2496 }
2497
2498
2503 public void setDisplayName(String displayName) {
2504 _displayName = displayName;
2505 }
2506
2507
2512 public void setExpCache(Integer expCache) {
2513 _expCache = expCache;
2514 }
2515
2516
2521 public void setFacebookIntegration(String facebookIntegration) {
2522 if (Validator.isNotNull(facebookIntegration)) {
2523 _facebookIntegration = facebookIntegration;
2524 }
2525 }
2526
2527
2534 public void setFooterPortalCss(List<String> footerPortalCss) {
2535 _footerPortalCss = footerPortalCss;
2536 }
2537
2538
2546 public void setFooterPortalJavaScript(List<String> footerPortalJavaScript) {
2547 _footerPortalJavaScript = footerPortalJavaScript;
2548 }
2549
2550
2557 public void setFooterPortletCss(List<String> footerPortletCss) {
2558 _footerPortletCss = footerPortletCss;
2559 }
2560
2561
2569 public void setFooterPortletJavaScript(
2570 List<String> footerPortletJavaScript) {
2571
2572 _footerPortletJavaScript = footerPortletJavaScript;
2573 }
2574
2575
2581 public void setFriendlyURLMapperClass(String friendlyURLMapperClass) {
2582 _friendlyURLMapperClass = friendlyURLMapperClass;
2583 }
2584
2585
2591 public void setFriendlyURLMapping(String friendlyURLMapping) {
2592 _friendlyURLMapping = friendlyURLMapping;
2593 }
2594
2595
2602 public void setFriendlyURLRoutes(String friendlyURLRoutes) {
2603 _friendlyURLRoutes = friendlyURLRoutes;
2604 }
2605
2606
2613 public void setHeaderPortalCss(List<String> headerPortalCss) {
2614 _headerPortalCss = headerPortalCss;
2615 }
2616
2617
2625 public void setHeaderPortalJavaScript(List<String> headerPortalJavaScript) {
2626 _headerPortalJavaScript = headerPortalJavaScript;
2627 }
2628
2629
2636 public void setHeaderPortletCss(List<String> headerPortletCss) {
2637 _headerPortletCss = headerPortletCss;
2638 }
2639
2640
2648 public void setHeaderPortletJavaScript(
2649 List<String> headerPortletJavaScript) {
2650
2651 _headerPortletJavaScript = headerPortletJavaScript;
2652 }
2653
2654
2659 public void setIcon(String icon) {
2660 _icon = icon;
2661 }
2662
2663
2670 public void setInclude(boolean include) {
2671 _include = include;
2672 }
2673
2674
2681 public void setIndexerClasses(List<String> indexerClasses) {
2682 _indexerClasses = indexerClasses;
2683 }
2684
2685
2690 public void setInitParams(Map<String, String> initParams) {
2691 _initParams = initParams;
2692 }
2693
2694
2701 public void setInstanceable(boolean instanceable) {
2702 _instanceable = instanceable;
2703 }
2704
2705
2712 public void setLayoutCacheable(boolean layoutCacheable) {
2713 _layoutCacheable = layoutCacheable;
2714 }
2715
2716
2723 public void setMaximizeEdit(boolean maximizeEdit) {
2724 _maximizeEdit = maximizeEdit;
2725 }
2726
2727
2734 public void setMaximizeHelp(boolean maximizeHelp) {
2735 _maximizeHelp = maximizeHelp;
2736 }
2737
2738
2743 public void setOpenSearchClass(String openSearchClass) {
2744 _openSearchClass = openSearchClass;
2745 }
2746
2747
2752 public void setParentStrutsPath(String parentStrutsPath) {
2753 _parentStrutsPath = parentStrutsPath;
2754 }
2755
2756
2759 public void setPermissionPropagatorClass(String permissionPropagatorClass) {
2760 _permissionPropagatorClass = permissionPropagatorClass;
2761 }
2762
2763
2768 public void setPluginPackage(PluginPackage pluginPackage) {
2769 _pluginPackage = pluginPackage;
2770 }
2771
2772
2778 public void setPollerProcessorClass(String pollerProcessorClass) {
2779 _pollerProcessorClass = pollerProcessorClass;
2780 }
2781
2782
2788 public void setPopMessageListenerClass(String popMessageListenerClass) {
2789 _popMessageListenerClass = popMessageListenerClass;
2790 }
2791
2792
2799 public void setPopUpPrint(boolean popUpPrint) {
2800 _popUpPrint = popUpPrint;
2801 }
2802
2803
2808 public void setPortletApp(PortletApp portletApp) {
2809 _portletApp = portletApp;
2810
2811 _portletApp.addPortlet(this);
2812 }
2813
2814
2819 public void setPortletClass(String portletClass) {
2820 _portletClass = portletClass;
2821 }
2822
2823
2829 public void setPortletDataHandlerClass(String portletDataHandlerClass) {
2830 _portletDataHandlerClass = portletDataHandlerClass;
2831 }
2832
2833
2840 public void setPortletDisplayTemplateHandlerClass(
2841 String portletDisplayTemplateHandlerClass) {
2842
2843 _portletDisplayTemplateHandlerClass =
2844 portletDisplayTemplateHandlerClass;
2845 }
2846
2847
2852 public void setPortletFilters(Map<String, PortletFilter> portletFilters) {
2853 _portletFilters = portletFilters;
2854 }
2855
2856
2861 public void setPortletInfo(PortletInfo portletInfo) {
2862 _portletInfo = portletInfo;
2863 }
2864
2865
2871 public void setPortletLayoutListenerClass(
2872 String portletLayoutListenerClass) {
2873
2874 _portletLayoutListenerClass = portletLayoutListenerClass;
2875 }
2876
2877
2882 public void setPortletModes(Map<String, Set<String>> portletModes) {
2883 _portletModes = portletModes;
2884 }
2885
2886
2891 public void setPortletName(String portletName) {
2892 _portletName = portletName;
2893 }
2894
2895
2900 public void setPortletURLClass(String portletURLClass) {
2901 _portletURLClass = portletURLClass;
2902 }
2903
2904
2911 public void setPreferencesCompanyWide(boolean preferencesCompanyWide) {
2912 _preferencesCompanyWide = preferencesCompanyWide;
2913 }
2914
2915
2924 public void setPreferencesOwnedByGroup(boolean preferencesOwnedByGroup) {
2925 _preferencesOwnedByGroup = preferencesOwnedByGroup;
2926 }
2927
2928
2934 public void setPreferencesUniquePerLayout(
2935 boolean preferencesUniquePerLayout) {
2936
2937 _preferencesUniquePerLayout = preferencesUniquePerLayout;
2938 }
2939
2940
2946 public void setPreferencesValidator(String preferencesValidator) {
2947 if (preferencesValidator != null) {
2948
2949
2950
2951
2952 _preferencesValidator = preferencesValidator.trim();
2953 }
2954 else {
2955 _preferencesValidator = null;
2956 }
2957 }
2958
2959
2967 public void setPrivateRequestAttributes(boolean privateRequestAttributes) {
2968 _privateRequestAttributes = privateRequestAttributes;
2969 }
2970
2971
2978 public void setPrivateSessionAttributes(boolean privateSessionAttributes) {
2979 _privateSessionAttributes = privateSessionAttributes;
2980 }
2981
2982
2987 public void setProcessingEvents(Set<QName> processingEvents) {
2988 for (QName processingEvent : processingEvents) {
2989 addProcessingEvent(processingEvent);
2990 }
2991 }
2992
2993
2999 public void setPublicRenderParameters(
3000 Set<PublicRenderParameter> publicRenderParameters) {
3001
3002 for (PublicRenderParameter publicRenderParameter :
3003 publicRenderParameters) {
3004
3005 addPublicRenderParameter(publicRenderParameter);
3006 }
3007 }
3008
3009
3014 public void setPublishingEvents(Set<QName> publishingEvents) {
3015 for (QName publishingEvent : publishingEvents) {
3016 addPublishingEvent(publishingEvent);
3017 }
3018 }
3019
3020
3025 public void setReady(boolean ready) {
3026 _readyMap.put(getRootPortletId(), ready);
3027 }
3028
3029
3035 public void setRemoteable(boolean remoteable) {
3036 _remoteable = remoteable;
3037 }
3038
3039
3044 public void setRenderTimeout(int renderTimeout) {
3045 _renderTimeout = renderTimeout;
3046 }
3047
3048
3053 public void setRenderWeight(int renderWeight) {
3054 _renderWeight = renderWeight;
3055 }
3056
3057
3062 public void setResourceBundle(String resourceBundle) {
3063 _resourceBundle = resourceBundle;
3064 }
3065
3066
3073 public void setRestoreCurrentView(boolean restoreCurrentView) {
3074 _restoreCurrentView = restoreCurrentView;
3075 }
3076
3077
3082 public void setRoleMappers(Map<String, String> roleMappers) {
3083 _roleMappers = roleMappers;
3084 }
3085
3086
3091 @Override
3092 public void setRoles(String roles) {
3093 _rolesArray = StringUtil.split(roles);
3094
3095 super.setRoles(roles);
3096 }
3097
3098
3103 public void setRolesArray(String[] rolesArray) {
3104 _rolesArray = rolesArray;
3105
3106 super.setRoles(StringUtil.merge(rolesArray));
3107 }
3108
3109
3114 public void setSchedulerEntries(List<SchedulerEntry> schedulerEntries) {
3115 for (SchedulerEntry schedulerEntry : schedulerEntries) {
3116 addSchedulerEntry(schedulerEntry);
3117 }
3118 }
3119
3120
3126 public void setScopeable(boolean scopeable) {
3127 _scopeable = scopeable;
3128 }
3129
3130
3137 public void setShowPortletAccessDenied(boolean showPortletAccessDenied) {
3138 _showPortletAccessDenied = showPortletAccessDenied;
3139 }
3140
3141
3147 public void setShowPortletInactive(boolean showPortletInactive) {
3148 _showPortletInactive = showPortletInactive;
3149 }
3150
3151
3157 public void setSocialActivityInterpreterClass(
3158 String socialActivityInterpreterClass) {
3159
3160 _socialActivityInterpreterClass = socialActivityInterpreterClass;
3161 }
3162
3163
3169 public void setSocialRequestInterpreterClass(
3170 String socialRequestInterpreterClass) {
3171
3172 _socialRequestInterpreterClass = socialRequestInterpreterClass;
3173 }
3174
3175
3182 public void setStatic(boolean staticPortlet) {
3183 _staticPortlet = staticPortlet;
3184 }
3185
3186
3193 public void setStaticStart(boolean staticPortletStart) {
3194 _staticPortletStart = staticPortletStart;
3195 }
3196
3197
3202 public void setStrutsPath(String strutsPath) {
3203 _strutsPath = strutsPath;
3204 }
3205
3206
3211 public void setSupportedLocales(Set<String> supportedLocales) {
3212 _supportedLocales = supportedLocales;
3213 }
3214
3215
3222 public void setSystem(boolean system) {
3223 _system = system;
3224 }
3225
3226
3231 public void setTimestamp(long timestamp) {
3232 _timestamp = timestamp;
3233 }
3234
3235
3242 public void setTrashHandlerClasses(List<String> trashHandlerClasses) {
3243 _trashHandlerClasses = trashHandlerClasses;
3244 }
3245
3246
3252 public void setUndeployedPortlet(boolean undeployedPortlet) {
3253 _undeployedPortlet = undeployedPortlet;
3254 }
3255
3256
3261 public void setUnlinkedRoles(Set<String> unlinkedRoles) {
3262 _unlinkedRoles = unlinkedRoles;
3263 }
3264
3265
3270 public void setURLEncoderClass(String urlEncoderClass) {
3271 _urlEncoderClass = urlEncoderClass;
3272 }
3273
3274
3280 public void setUseDefaultTemplate(boolean useDefaultTemplate) {
3281 _useDefaultTemplate = useDefaultTemplate;
3282 }
3283
3284
3289 public void setUserPrincipalStrategy(String userPrincipalStrategy) {
3290 if (Validator.isNotNull(userPrincipalStrategy)) {
3291 _userPrincipalStrategy = userPrincipalStrategy;
3292 }
3293 }
3294
3295
3300 public void setVirtualPath(String virtualPath) {
3301 if (_portletApp.isWARFile() && Validator.isNull(virtualPath)) {
3302 virtualPath = PropsValues.PORTLET_VIRTUAL_PATH;
3303 }
3304
3305 _virtualPath = virtualPath;
3306 }
3307
3308
3314 public void setWebDAVStorageClass(String webDAVStorageClass) {
3315 _webDAVStorageClass = webDAVStorageClass;
3316 }
3317
3318
3324 public void setWebDAVStorageToken(String webDAVStorageToken) {
3325 _webDAVStorageToken = webDAVStorageToken;
3326 }
3327
3328
3333 public void setWindowStates(Map<String, Set<String>> windowStates) {
3334 _windowStates = windowStates;
3335 }
3336
3337
3344 public void setWorkflowHandlerClasses(List<String> workflowHandlerClasses) {
3345 _workflowHandlerClasses = workflowHandlerClasses;
3346 }
3347
3348
3354 public void setXmlRpcMethodClass(String xmlRpcMethodClass) {
3355 _xmlRpcMethodClass = xmlRpcMethodClass;
3356 }
3357
3358
3361 private static Log _log = LogFactoryUtil.getLog(PortletImpl.class);
3362
3363
3366 private static Map<String, Boolean> _readyMap =
3367 new ConcurrentHashMap<String, Boolean>();
3368
3369
3372 private int _actionTimeout;
3373
3374
3378 private boolean _actionURLRedirect;
3379
3380
3384 private boolean _addDefaultResource;
3385
3386
3389 private boolean _ajaxable = true;
3390
3391
3395 private List<String> _assetRendererFactoryClasses;
3396
3397
3401 private List<String> _atomCollectionAdapterClasses;
3402
3403
3407 private Set<String> _autopropagatedParameters;
3408
3409
3412 private String _configurationActionClass;
3413
3414
3418 private String _controlPanelEntryCategory;
3419
3420
3424 private String _controlPanelEntryClass;
3425
3426
3430 private double _controlPanelEntryWeight = 100;
3431
3432
3436 private String _cssClassWrapper = StringPool.BLANK;
3437
3438
3442 private List<String> _customAttributesDisplayClasses;
3443
3444
3447 private PluginSetting _defaultPluginSetting;
3448
3449
3452 private String _defaultPreferences;
3453
3454
3457 private String _displayName;
3458
3459
3462 private Integer _expCache;
3463
3464
3467 private String _facebookIntegration =
3468 PortletConstants.FACEBOOK_INTEGRATION_IFRAME;
3469
3470
3474 private List<String> _footerPortalCss;
3475
3476
3480 private List<String> _footerPortalJavaScript;
3481
3482
3486 private List<String> _footerPortletCss;
3487
3488
3492 private List<String> _footerPortletJavaScript;
3493
3494
3497 private String _friendlyURLMapperClass;
3498
3499
3502 private String _friendlyURLMapping;
3503
3504
3508 private String _friendlyURLRoutes;
3509
3510
3514 private List<String> _headerPortalCss;
3515
3516
3520 private List<String> _headerPortalJavaScript;
3521
3522
3526 private List<String> _headerPortletCss;
3527
3528
3532 private List<String> _headerPortletJavaScript;
3533
3534
3537 private String _icon;
3538
3539
3543 private boolean _include = true;
3544
3545
3549 private List<String> _indexerClasses;
3550
3551
3554 private Map<String, String> _initParams;
3555
3556
3559 private boolean _instanceable;
3560
3561
3564 private boolean _layoutCacheable;
3565
3566
3570 private boolean _maximizeEdit;
3571
3572
3576 private boolean _maximizeHelp;
3577
3578
3581 private String _openSearchClass;
3582
3583
3586 private String _parentStrutsPath;
3587
3588
3591 private String _permissionPropagatorClass;
3592
3593
3596 private PluginPackage _pluginPackage;
3597
3598
3601 private String _pollerProcessorClass;
3602
3603
3606 private String _popMessageListenerClass;
3607
3608
3612 private boolean _popUpPrint = true;
3613
3614
3617 private PortletApp _portletApp;
3618
3619
3622 private String _portletClass;
3623
3624
3627 private String _portletDataHandlerClass;
3628
3629
3632 private String _portletDisplayTemplateHandlerClass;
3633
3634
3637 private Map<String, PortletFilter> _portletFilters;
3638
3639
3642 private PortletInfo _portletInfo;
3643
3644
3647 private String _portletLayoutListenerClass;
3648
3649
3652 private Map<String, Set<String>> _portletModes;
3653
3654
3657 private String _portletName;
3658
3659
3662 private String _portletURLClass;
3663
3664
3667 private boolean _preferencesCompanyWide;
3668
3669
3674 private boolean _preferencesOwnedByGroup = true;
3675
3676
3679 private boolean _preferencesUniquePerLayout = true;
3680
3681
3684 private String _preferencesValidator;
3685
3686
3690 private boolean _privateRequestAttributes = true;
3691
3692
3696 private boolean _privateSessionAttributes = true;
3697
3698
3701 private Set<QName> _processingEvents = new HashSet<QName>();
3702
3703
3706 private Map<String, QName> _processingEventsByQName =
3707 new HashMap<String, QName>();
3708
3709
3712 private Set<PublicRenderParameter> _publicRenderParameters =
3713 new HashSet<PublicRenderParameter>();
3714
3715
3719 private Map<String, PublicRenderParameter>
3720 _publicRenderParametersByIdentifier =
3721 new HashMap<String, PublicRenderParameter>();
3722
3723
3727 private Map<String, PublicRenderParameter>
3728 _publicRenderParametersByQName =
3729 new HashMap<String, PublicRenderParameter>();
3730
3731
3734 private Set<QName> _publishingEvents = new HashSet<QName>();
3735
3736
3739 private boolean _remoteable;
3740
3741
3744 private int _renderTimeout;
3745
3746
3749 private int _renderWeight = 1;
3750
3751
3754 private String _resourceBundle;
3755
3756
3760 private boolean _restoreCurrentView = true;
3761
3762
3765 private Map<String, String> _roleMappers;
3766
3767
3770 private String[] _rolesArray = new String[0];
3771
3772
3775 private Portlet _rootPortlet = this;
3776
3777
3780 private List<SchedulerEntry> _schedulerEntries;
3781
3782
3785 private boolean _scopeable;
3786
3787
3791 private boolean _showPortletAccessDenied =
3792 PropsValues.LAYOUT_SHOW_PORTLET_ACCESS_DENIED;
3793
3794
3797 private boolean _showPortletInactive =
3798 PropsValues.LAYOUT_SHOW_PORTLET_INACTIVE;
3799
3800
3803 private String _socialActivityInterpreterClass;
3804
3805
3808 private String _socialRequestInterpreterClass;
3809
3810
3814 private boolean _staticPortlet;
3815
3816
3820 private boolean _staticPortletStart;
3821
3822
3825 private String _strutsPath;
3826
3827
3830 private Set<String> _supportedLocales;
3831
3832
3836 private boolean _system;
3837
3838
3841 private long _timestamp;
3842
3843
3847 private List<String> _trashHandlerClasses;
3848
3849
3852 private boolean _undeployedPortlet = false;
3853
3854
3857 private Set<String> _unlinkedRoles;
3858
3859
3862 private String _urlEncoderClass;
3863
3864
3867 private boolean _useDefaultTemplate = true;
3868
3869
3872 private String _userPrincipalStrategy =
3873 PortletConstants.USER_PRINCIPAL_STRATEGY_USER_ID;
3874
3875
3878 private String _virtualPath;
3879
3880
3883 private String _webDAVStorageClass;
3884
3885
3888 private String _webDAVStorageToken;
3889
3890
3893 private Map<String, Set<String>> _windowStates;
3894
3895
3899 private List<String> _workflowHandlerClasses;
3900
3901
3904 private String _xmlRpcMethodClass;
3905
3906 }