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.lar.StagedModelDataHandler;
020 import com.liferay.portal.kernel.log.Log;
021 import com.liferay.portal.kernel.log.LogFactoryUtil;
022 import com.liferay.portal.kernel.plugin.PluginPackage;
023 import com.liferay.portal.kernel.poller.PollerProcessor;
024 import com.liferay.portal.kernel.pop.MessageListener;
025 import com.liferay.portal.kernel.portlet.ConfigurationAction;
026 import com.liferay.portal.kernel.portlet.FriendlyURLMapper;
027 import com.liferay.portal.kernel.portlet.PortletBag;
028 import com.liferay.portal.kernel.portlet.PortletBagPool;
029 import com.liferay.portal.kernel.portlet.PortletLayoutListener;
030 import com.liferay.portal.kernel.portletdisplaytemplate.PortletDisplayTemplateHandler;
031 import com.liferay.portal.kernel.scheduler.SchedulerEntry;
032 import com.liferay.portal.kernel.search.Indexer;
033 import com.liferay.portal.kernel.search.OpenSearch;
034 import com.liferay.portal.kernel.servlet.ServletContextPool;
035 import com.liferay.portal.kernel.servlet.URLEncoder;
036 import com.liferay.portal.kernel.trash.TrashHandler;
037 import com.liferay.portal.kernel.util.ContentTypes;
038 import com.liferay.portal.kernel.util.ContextPathUtil;
039 import com.liferay.portal.kernel.util.StringPool;
040 import com.liferay.portal.kernel.util.StringUtil;
041 import com.liferay.portal.kernel.util.Validator;
042 import com.liferay.portal.kernel.webdav.WebDAVStorage;
043 import com.liferay.portal.kernel.workflow.WorkflowHandler;
044 import com.liferay.portal.kernel.xml.QName;
045 import com.liferay.portal.kernel.xmlrpc.Method;
046 import com.liferay.portal.model.Plugin;
047 import com.liferay.portal.model.PluginSetting;
048 import com.liferay.portal.model.Portlet;
049 import com.liferay.portal.model.PortletApp;
050 import com.liferay.portal.model.PortletConstants;
051 import com.liferay.portal.model.PortletFilter;
052 import com.liferay.portal.model.PortletInfo;
053 import com.liferay.portal.model.PublicRenderParameter;
054 import com.liferay.portal.model.User;
055 import com.liferay.portal.security.permission.ActionKeys;
056 import com.liferay.portal.security.permission.PermissionChecker;
057 import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil;
058 import com.liferay.portal.security.permission.PermissionPropagator;
059 import com.liferay.portal.security.permission.PermissionThreadLocal;
060 import com.liferay.portal.service.UserLocalServiceUtil;
061 import com.liferay.portal.service.permission.PortletPermissionUtil;
062 import com.liferay.portal.util.PortalUtil;
063 import com.liferay.portal.util.PropsValues;
064 import com.liferay.portlet.ControlPanelEntry;
065 import com.liferay.portlet.PortletQNameUtil;
066 import com.liferay.portlet.asset.model.AssetRendererFactory;
067 import com.liferay.portlet.expando.model.CustomAttributesDisplay;
068 import com.liferay.portlet.social.model.SocialActivityInterpreter;
069 import com.liferay.portlet.social.model.SocialRequestInterpreter;
070 import com.liferay.util.bridges.alloy.AlloyPortlet;
071
072 import java.util.ArrayList;
073 import java.util.Arrays;
074 import java.util.Collections;
075 import java.util.HashMap;
076 import java.util.HashSet;
077 import java.util.LinkedHashMap;
078 import java.util.LinkedHashSet;
079 import java.util.List;
080 import java.util.Map;
081 import java.util.Set;
082 import java.util.TreeSet;
083 import java.util.concurrent.ConcurrentHashMap;
084
085 import javax.portlet.PortletMode;
086 import javax.portlet.WindowState;
087
088 import javax.servlet.ServletContext;
089
090
093 public class PortletImpl extends PortletBaseImpl {
094
095
098 public PortletImpl() {
099 }
100
101
104 public PortletImpl(long companyId, String portletId) {
105 setCompanyId(companyId);
106 setPortletId(portletId);
107 setStrutsPath(portletId);
108 setActive(true);
109 _indexerClasses = new ArrayList<String>();
110 _schedulerEntries = new ArrayList<SchedulerEntry>();
111 _stagedModelDataHandlerClasses = new ArrayList<String>();
112 _assetRendererFactoryClasses = new ArrayList<String>();
113 _atomCollectionAdapterClasses = new ArrayList<String>();
114 _customAttributesDisplayClasses = new ArrayList<String>();
115 _trashHandlerClasses = new ArrayList<String>();
116 _workflowHandlerClasses = new ArrayList<String>();
117 _autopropagatedParameters = new LinkedHashSet<String>();
118 _headerPortalCss = new ArrayList<String>();
119 _headerPortletCss = new ArrayList<String>();
120 _headerPortalJavaScript = new ArrayList<String>();
121 _headerPortletJavaScript = new ArrayList<String>();
122 _footerPortalCss = new ArrayList<String>();
123 _footerPortletCss = new ArrayList<String>();
124 _footerPortalJavaScript = new ArrayList<String>();
125 _footerPortletJavaScript = new ArrayList<String>();
126 _unlinkedRoles = new HashSet<String>();
127 _roleMappers = new LinkedHashMap<String, String>();
128 _initParams = new HashMap<String, String>();
129 _portletModes = new HashMap<String, Set<String>>();
130 _windowStates = new HashMap<String, Set<String>>();
131 _supportedLocales = new HashSet<String>();
132 _portletFilters = new LinkedHashMap<String, PortletFilter>();
133 _processingEvents = new HashSet<QName>();
134 _publishingEvents = new HashSet<QName>();
135 _publicRenderParameters = new HashSet<PublicRenderParameter>();
136 }
137
138
141 public PortletImpl(
142 String portletId, Portlet rootPortlet, PluginPackage pluginPackage,
143 PluginSetting pluginSetting, long companyId, long timestamp,
144 String icon, String virtualPath, String strutsPath,
145 String parentStrutsPath, String portletName, String displayName,
146 String portletClass, String configurationActionClass,
147 List<String> indexerClasses, String openSearchClass,
148 List<SchedulerEntry> schedulerEntries, String portletURLClass,
149 String friendlyURLMapperClass, String friendlyURLMapping,
150 String friendlyURLRoutes, String urlEncoderClass,
151 String portletDataHandlerClass,
152 List<String> stagedModelDataHandlerClasses,
153 String portletDisplayTemplateHandlerClass,
154 String portletLayoutListenerClass, String pollerProcessorClass,
155 String popMessageListenerClass, String socialActivityInterpreterClass,
156 String socialRequestInterpreterClass, String webDAVStorageToken,
157 String webDAVStorageClass, String xmlRpcMethodClass,
158 String controlPanelEntryCategory, double controlPanelEntryWeight,
159 String controlPanelClass, List<String> assetRendererFactoryClasses,
160 List<String> atomCollectionAdapterClasses,
161 List<String> customAttributesDisplayClasses,
162 String permissionPropagatorClass, List<String> trashHandlerClasses,
163 List<String> workflowHandlerClasses, String defaultPreferences,
164 String preferencesValidator, boolean preferencesCompanyWide,
165 boolean preferencesUniquePerLayout, boolean preferencesOwnedByGroup,
166 boolean useDefaultTemplate, boolean showPortletAccessDenied,
167 boolean showPortletInactive, boolean actionURLRedirect,
168 boolean restoreCurrentView, boolean maximizeEdit, boolean maximizeHelp,
169 boolean popUpPrint, boolean layoutCacheable, boolean instanceable,
170 boolean remoteable, boolean scopeable, String userPrincipalStrategy,
171 boolean privateRequestAttributes, boolean privateSessionAttributes,
172 Set<String> autopropagatedParameters, int actionTimeout,
173 int renderTimeout, int renderWeight, boolean ajaxable,
174 List<String> headerPortalCss, List<String> headerPortletCss,
175 List<String> headerPortalJavaScript,
176 List<String> headerPortletJavaScript, List<String> footerPortalCss,
177 List<String> footerPortletCss, List<String> footerPortalJavaScript,
178 List<String> footerPortletJavaScript, String cssClassWrapper,
179 String facebookIntegration, boolean addDefaultResource, String roles,
180 Set<String> unlinkedRoles, Map<String, String> roleMappers,
181 boolean system, boolean active, boolean include,
182 Map<String, String> initParams, Integer expCache,
183 Map<String, Set<String>> portletModes,
184 Map<String, Set<String>> windowStates, Set<String> supportedLocales,
185 String resourceBundle, PortletInfo portletInfo,
186 Map<String, PortletFilter> portletFilters, Set<QName> processingEvents,
187 Set<QName> publishingEvents,
188 Set<PublicRenderParameter> publicRenderParameters,
189 PortletApp portletApp) {
190
191 setPortletId(portletId);
192 _rootPortlet = rootPortlet;
193 _pluginPackage = pluginPackage;
194 _defaultPluginSetting = pluginSetting;
195 setCompanyId(companyId);
196 _timestamp = timestamp;
197 _icon = icon;
198 _virtualPath = virtualPath;
199 _strutsPath = strutsPath;
200 _portletName = portletName;
201 _parentStrutsPath = parentStrutsPath;
202 _displayName = displayName;
203 _portletClass = portletClass;
204 _configurationActionClass = configurationActionClass;
205 _indexerClasses = indexerClasses;
206 _openSearchClass = openSearchClass;
207 _schedulerEntries = schedulerEntries;
208 _portletURLClass = portletURLClass;
209 _friendlyURLMapperClass = friendlyURLMapperClass;
210 _friendlyURLMapping = friendlyURLMapping;
211 _friendlyURLRoutes = friendlyURLRoutes;
212 _urlEncoderClass = urlEncoderClass;
213 _portletDataHandlerClass = portletDataHandlerClass;
214 _stagedModelDataHandlerClasses = stagedModelDataHandlerClasses;
215 _portletDisplayTemplateHandlerClass =
216 portletDisplayTemplateHandlerClass;
217 _portletLayoutListenerClass = portletLayoutListenerClass;
218 _pollerProcessorClass = pollerProcessorClass;
219 _popMessageListenerClass = popMessageListenerClass;
220 _socialActivityInterpreterClass = socialActivityInterpreterClass;
221 _socialRequestInterpreterClass = socialRequestInterpreterClass;
222 _webDAVStorageToken = webDAVStorageToken;
223 _webDAVStorageClass = webDAVStorageClass;
224 _xmlRpcMethodClass = xmlRpcMethodClass;
225 _controlPanelEntryCategory = controlPanelEntryCategory;
226 _controlPanelEntryWeight = controlPanelEntryWeight;
227 _controlPanelEntryClass = controlPanelClass;
228 _assetRendererFactoryClasses = assetRendererFactoryClasses;
229 _atomCollectionAdapterClasses = atomCollectionAdapterClasses;
230 _customAttributesDisplayClasses = customAttributesDisplayClasses;
231 _permissionPropagatorClass = permissionPropagatorClass;
232 _trashHandlerClasses = trashHandlerClasses;
233 _workflowHandlerClasses = workflowHandlerClasses;
234 _defaultPreferences = defaultPreferences;
235 _preferencesValidator = preferencesValidator;
236 _preferencesCompanyWide = preferencesCompanyWide;
237 _preferencesUniquePerLayout = preferencesUniquePerLayout;
238 _preferencesOwnedByGroup = preferencesOwnedByGroup;
239 _useDefaultTemplate = useDefaultTemplate;
240 _showPortletAccessDenied = showPortletAccessDenied;
241 _showPortletInactive = showPortletInactive;
242 _actionURLRedirect = actionURLRedirect;
243 _restoreCurrentView = restoreCurrentView;
244 _maximizeEdit = maximizeEdit;
245 _maximizeHelp = maximizeHelp;
246 _popUpPrint = popUpPrint;
247 _layoutCacheable = layoutCacheable;
248 _instanceable = instanceable;
249 _remoteable = remoteable;
250 _scopeable = scopeable;
251 _userPrincipalStrategy = userPrincipalStrategy;
252 _privateRequestAttributes = privateRequestAttributes;
253 _privateSessionAttributes = privateSessionAttributes;
254 _autopropagatedParameters = autopropagatedParameters;
255 _actionTimeout = actionTimeout;
256 _renderTimeout = renderTimeout;
257 _renderWeight = renderWeight;
258 _ajaxable = ajaxable;
259 _headerPortalCss = headerPortalCss;
260 _headerPortletCss = headerPortletCss;
261 _headerPortalJavaScript = headerPortalJavaScript;
262 _headerPortletJavaScript = headerPortletJavaScript;
263 _footerPortalCss = footerPortalCss;
264 _footerPortletCss = footerPortletCss;
265 _footerPortalJavaScript = footerPortalJavaScript;
266 _footerPortletJavaScript = footerPortletJavaScript;
267 _cssClassWrapper = cssClassWrapper;
268 _facebookIntegration = facebookIntegration;
269 _scopeable = scopeable;
270 _addDefaultResource = addDefaultResource;
271 setRoles(roles);
272 _unlinkedRoles = unlinkedRoles;
273 _roleMappers = roleMappers;
274 _system = system;
275 setActive(active);
276 _include = include;
277 _initParams = initParams;
278 _expCache = expCache;
279 _portletModes = portletModes;
280 _windowStates = windowStates;
281 _supportedLocales = supportedLocales;
282 _resourceBundle = resourceBundle;
283 _portletInfo = portletInfo;
284 _portletFilters = portletFilters;
285 setProcessingEvents(processingEvents);
286 setPublishingEvents(publishingEvents);
287 setPublicRenderParameters(publicRenderParameters);
288 _portletApp = portletApp;
289 }
290
291
294 public void addProcessingEvent(QName processingEvent) {
295 _processingEvents.add(processingEvent);
296 _processingEventsByQName.put(
297 PortletQNameUtil.getKey(processingEvent), processingEvent);
298 }
299
300
305 public void addPublicRenderParameter(
306 PublicRenderParameter publicRenderParameter) {
307
308 _publicRenderParameters.add(publicRenderParameter);
309
310 String identifier = publicRenderParameter.getIdentifier();
311
312 _publicRenderParametersByIdentifier.put(
313 identifier, publicRenderParameter);
314
315 QName qName = publicRenderParameter.getQName();
316
317 _publicRenderParametersByQName.put(
318 PortletQNameUtil.getKey(qName), publicRenderParameter);
319
320 String publicRenderParameterName =
321 PortletQNameUtil.getPublicRenderParameterName(qName);
322
323 PortletQNameUtil.setPublicRenderParameterIdentifier(
324 publicRenderParameterName, identifier);
325 }
326
327
330 public void addPublishingEvent(QName publishingEvent) {
331 _publishingEvents.add(publishingEvent);
332 }
333
334
337 public void addSchedulerEntry(SchedulerEntry schedulerEntry) {
338 _schedulerEntries.add(schedulerEntry);
339 }
340
341
346 @Override
347 public Object clone() {
348 Portlet portlet = new PortletImpl(
349 getPortletId(), getRootPortlet(), getPluginPackage(),
350 getDefaultPluginSetting(), getCompanyId(), getTimestamp(),
351 getIcon(), getVirtualPath(), getStrutsPath(), getParentStrutsPath(),
352 getPortletName(), getDisplayName(), getPortletClass(),
353 getConfigurationActionClass(), getIndexerClasses(),
354 getOpenSearchClass(), getSchedulerEntries(), getPortletURLClass(),
355 getFriendlyURLMapperClass(), getFriendlyURLMapping(),
356 getFriendlyURLRoutes(), getURLEncoderClass(),
357 getPortletDataHandlerClass(), getStagedModelDataHandlerClasses(),
358 getPortletDisplayTemplateHandlerClass(),
359 getPortletLayoutListenerClass(), getPollerProcessorClass(),
360 getPopMessageListenerClass(), getSocialActivityInterpreterClass(),
361 getSocialRequestInterpreterClass(), getWebDAVStorageToken(),
362 getWebDAVStorageClass(), getXmlRpcMethodClass(),
363 getControlPanelEntryCategory(), getControlPanelEntryWeight(),
364 getControlPanelEntryClass(), getAssetRendererFactoryClasses(),
365 getAtomCollectionAdapterClasses(),
366 getCustomAttributesDisplayClasses(), getPermissionPropagatorClass(),
367 getTrashHandlerClasses(), getWorkflowHandlerClasses(),
368 getDefaultPreferences(), getPreferencesValidator(),
369 isPreferencesCompanyWide(), isPreferencesUniquePerLayout(),
370 isPreferencesOwnedByGroup(), isUseDefaultTemplate(),
371 isShowPortletAccessDenied(), isShowPortletInactive(),
372 isActionURLRedirect(), isRestoreCurrentView(), isMaximizeEdit(),
373 isMaximizeHelp(), isPopUpPrint(), isLayoutCacheable(),
374 isInstanceable(), isRemoteable(), isScopeable(),
375 getUserPrincipalStrategy(), isPrivateRequestAttributes(),
376 isPrivateSessionAttributes(), getAutopropagatedParameters(),
377 getActionTimeout(), getRenderTimeout(), getRenderWeight(),
378 isAjaxable(), getHeaderPortalCss(), getHeaderPortletCss(),
379 getHeaderPortalJavaScript(), getHeaderPortletJavaScript(),
380 getFooterPortalCss(), getFooterPortletCss(),
381 getFooterPortalJavaScript(), getFooterPortletJavaScript(),
382 getCssClassWrapper(), getFacebookIntegration(),
383 isAddDefaultResource(), getRoles(), getUnlinkedRoles(),
384 getRoleMappers(), isSystem(), isActive(), isInclude(),
385 getInitParams(), getExpCache(), getPortletModes(),
386 getWindowStates(), getSupportedLocales(), getResourceBundle(),
387 getPortletInfo(), getPortletFilters(), getProcessingEvents(),
388 getPublishingEvents(), getPublicRenderParameters(),
389 getPortletApp());
390
391 portlet.setId(getId());
392 portlet.setUndeployedPortlet(isUndeployedPortlet());
393
394 return portlet;
395 }
396
397
406 @Override
407 public int compareTo(Portlet portlet) {
408 String portletId = getPortletId();
409
410 return portletId.compareTo(portlet.getPortletId());
411 }
412
413
419 @Override
420 public boolean equals(Object obj) {
421 Portlet portlet = (Portlet)obj;
422
423 String portletId = getPortletId();
424
425 return portletId.equals(portlet.getPortletId());
426 }
427
428
433 public int getActionTimeout() {
434 return _actionTimeout;
435 }
436
437
444 public boolean getActionURLRedirect() {
445 return _actionURLRedirect;
446 }
447
448
455 public boolean getAddDefaultResource() {
456 return _addDefaultResource;
457 }
458
459
464 public boolean getAjaxable() {
465 return _ajaxable;
466 }
467
468
473 public Set<String> getAllPortletModes() {
474 Set<String> allPortletModes = new TreeSet<String>();
475
476 for (Map.Entry<String, Set<String>> entry : _portletModes.entrySet()) {
477 Set<String> mimeTypePortletModes = entry.getValue();
478
479 for (String portletMode : mimeTypePortletModes) {
480 allPortletModes.add(portletMode);
481 }
482 }
483
484 return allPortletModes;
485 }
486
487
492 public Set<String> getAllWindowStates() {
493 Set<String> allWindowStates = new TreeSet<String>();
494
495 for (Map.Entry<String, Set<String>> entry : _windowStates.entrySet()) {
496 Set<String> mimeTypeWindowStates = entry.getValue();
497
498 for (String windowState : mimeTypeWindowStates) {
499 allWindowStates.add(windowState);
500 }
501 }
502
503 return allWindowStates;
504 }
505
506
513 public List<String> getAssetRendererFactoryClasses() {
514 return _assetRendererFactoryClasses;
515 }
516
517
522 public List<AssetRendererFactory> getAssetRendererFactoryInstances() {
523 if (_assetRendererFactoryClasses.isEmpty()) {
524 return null;
525 }
526
527 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
528
529 return portletBag.getAssetRendererFactoryInstances();
530 }
531
532
539 public List<String> getAtomCollectionAdapterClasses() {
540 return _atomCollectionAdapterClasses;
541 }
542
543
548 public List<AtomCollectionAdapter<?>> getAtomCollectionAdapterInstances() {
549 if (_atomCollectionAdapterClasses.isEmpty()) {
550 return null;
551 }
552
553 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
554
555 return portletBag.getAtomCollectionAdapterInstances();
556 }
557
558
565 public Set<String> getAutopropagatedParameters() {
566 return _autopropagatedParameters;
567 }
568
569
575 public Portlet getClonedInstance(String portletId) {
576 Portlet portlet = (Portlet)clone();
577
578 portlet.setPortletId(portletId);
579
580 return portlet;
581 }
582
583
588 public String getConfigurationActionClass() {
589 return _configurationActionClass;
590 }
591
592
597 public ConfigurationAction getConfigurationActionInstance() {
598 if (Validator.isNull(getConfigurationActionClass())) {
599 return null;
600 }
601
602 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
603
604 return portletBag.getConfigurationActionInstance();
605 }
606
607
612 public String getContextPath() {
613 if (!_portletApp.isWARFile()) {
614 return PortalUtil.getPathContext();
615 }
616
617 String servletContextName = _portletApp.getServletContextName();
618
619 if (ServletContextPool.containsKey(servletContextName)) {
620 ServletContext servletContext = ServletContextPool.get(
621 servletContextName);
622
623 return ContextPathUtil.getContextPath(servletContext);
624 }
625
626 return StringPool.SLASH.concat(servletContextName);
627 }
628
629
636 public String getControlPanelEntryCategory() {
637 return _controlPanelEntryCategory;
638 }
639
640
647 public String getControlPanelEntryClass() {
648 return _controlPanelEntryClass;
649 }
650
651
658 public ControlPanelEntry getControlPanelEntryInstance() {
659 if (Validator.isNull(getControlPanelEntryClass())) {
660 return null;
661 }
662
663 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
664
665 return portletBag.getControlPanelEntryInstance();
666 }
667
668
675 public double getControlPanelEntryWeight() {
676 return _controlPanelEntryWeight;
677 }
678
679
686 public String getCssClassWrapper() {
687 return _cssClassWrapper;
688 }
689
690
697 public List<String> getCustomAttributesDisplayClasses() {
698 return _customAttributesDisplayClasses;
699 }
700
701
706 public List<CustomAttributesDisplay> getCustomAttributesDisplayInstances() {
707 if (_customAttributesDisplayClasses.isEmpty()) {
708 return null;
709 }
710
711 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
712
713 return portletBag.getCustomAttributesDisplayInstances();
714 }
715
716
721 public PluginSetting getDefaultPluginSetting() {
722 return _defaultPluginSetting;
723 }
724
725
730 public String getDefaultPreferences() {
731 if (Validator.isNull(_defaultPreferences)) {
732 return PortletConstants.DEFAULT_PREFERENCES;
733 }
734 else {
735 return _defaultPreferences;
736 }
737 }
738
739
744 public String getDisplayName() {
745 return _displayName;
746 }
747
748
753 public Integer getExpCache() {
754 return _expCache;
755 }
756
757
762 public String getFacebookIntegration() {
763 return _facebookIntegration;
764 }
765
766
773 public List<String> getFooterPortalCss() {
774 return _footerPortalCss;
775 }
776
777
784 public List<String> getFooterPortalJavaScript() {
785 return _footerPortalJavaScript;
786 }
787
788
795 public List<String> getFooterPortletCss() {
796 return _footerPortletCss;
797 }
798
799
806 public List<String> getFooterPortletJavaScript() {
807 return _footerPortletJavaScript;
808 }
809
810
815 public String getFriendlyURLMapperClass() {
816 return _friendlyURLMapperClass;
817 }
818
819
824 public FriendlyURLMapper getFriendlyURLMapperInstance() {
825 if (Validator.isNull(getFriendlyURLMapperClass())) {
826 return null;
827 }
828
829 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
830
831 return portletBag.getFriendlyURLMapperInstance();
832 }
833
834
839 public String getFriendlyURLMapping() {
840 return _friendlyURLMapping;
841 }
842
843
850 public String getFriendlyURLRoutes() {
851 return _friendlyURLRoutes;
852 }
853
854
861 public List<String> getHeaderPortalCss() {
862 return _headerPortalCss;
863 }
864
865
872 public List<String> getHeaderPortalJavaScript() {
873 return _headerPortalJavaScript;
874 }
875
876
883 public List<String> getHeaderPortletCss() {
884 return _headerPortletCss;
885 }
886
887
894 public List<String> getHeaderPortletJavaScript() {
895 return _headerPortletJavaScript;
896 }
897
898
903 public String getIcon() {
904 return _icon;
905 }
906
907
914 public boolean getInclude() {
915 return _include;
916 }
917
918
925 public List<String> getIndexerClasses() {
926 return _indexerClasses;
927 }
928
929
934 public List<Indexer> getIndexerInstances() {
935 if (_indexerClasses.isEmpty() &&
936 !_portletClass.equals(AlloyPortlet.class.getName())) {
937
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 String getPortletDisplayTemplateHandlerClass() {
1198 return _portletDisplayTemplateHandlerClass;
1199 }
1200
1201
1206 public PortletDisplayTemplateHandler
1207 getPortletDisplayTemplateHandlerInstance() {
1208
1209 if (Validator.isNull(getPortletDisplayTemplateHandlerClass())) {
1210 return null;
1211 }
1212
1213 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1214
1215 return portletBag.getPortletDisplayTemplateHandlerInstance();
1216 }
1217
1218
1223 public Map<String, PortletFilter> getPortletFilters() {
1224 return _portletFilters;
1225 }
1226
1227
1232 public PortletInfo getPortletInfo() {
1233 return _portletInfo;
1234 }
1235
1236
1241 public String getPortletLayoutListenerClass() {
1242 return _portletLayoutListenerClass;
1243 }
1244
1245
1250 public PortletLayoutListener getPortletLayoutListenerInstance() {
1251 if (Validator.isNull(getPortletLayoutListenerClass())) {
1252 return null;
1253 }
1254
1255 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1256
1257 return portletBag.getPortletLayoutListenerInstance();
1258 }
1259
1260
1265 public Map<String, Set<String>> getPortletModes() {
1266 return _portletModes;
1267 }
1268
1269
1274 public String getPortletName() {
1275 return _portletName;
1276 }
1277
1278
1283 public String getPortletURLClass() {
1284 return _portletURLClass;
1285 }
1286
1287
1294 public boolean getPreferencesCompanyWide() {
1295 return _preferencesCompanyWide;
1296 }
1297
1298
1307 public boolean getPreferencesOwnedByGroup() {
1308 return _preferencesOwnedByGroup;
1309 }
1310
1311
1316 public boolean getPreferencesUniquePerLayout() {
1317 return _preferencesUniquePerLayout;
1318 }
1319
1320
1325 public String getPreferencesValidator() {
1326 return _preferencesValidator;
1327 }
1328
1329
1336 public boolean getPrivateRequestAttributes() {
1337 return _privateRequestAttributes;
1338 }
1339
1340
1347 public boolean getPrivateSessionAttributes() {
1348 return _privateSessionAttributes;
1349 }
1350
1351
1360 public QName getProcessingEvent(String uri, String localPart) {
1361 return _processingEventsByQName.get(
1362 PortletQNameUtil.getKey(uri, localPart));
1363 }
1364
1365
1370 public Set<QName> getProcessingEvents() {
1371 return _processingEvents;
1372 }
1373
1374
1380 public PublicRenderParameter getPublicRenderParameter(String identifier) {
1381 return _publicRenderParametersByIdentifier.get(identifier);
1382 }
1383
1384
1393 public PublicRenderParameter getPublicRenderParameter(
1394 String uri, String localPart) {
1395
1396 return _publicRenderParametersByQName.get(
1397 PortletQNameUtil.getKey(uri, localPart));
1398 }
1399
1400
1405 public Set<PublicRenderParameter> getPublicRenderParameters() {
1406 return _publicRenderParameters;
1407 }
1408
1409
1414 public Set<QName> getPublishingEvents() {
1415 return _publishingEvents;
1416 }
1417
1418
1423 public boolean getReady() {
1424 return isReady();
1425 }
1426
1427
1432 public boolean getRemoteable() {
1433 return _remoteable;
1434 }
1435
1436
1441 public int getRenderTimeout() {
1442 return _renderTimeout;
1443 }
1444
1445
1450 public int getRenderWeight() {
1451 return _renderWeight;
1452 }
1453
1454
1459 public String getResourceBundle() {
1460 return _resourceBundle;
1461 }
1462
1463
1470 public boolean getRestoreCurrentView() {
1471 return _restoreCurrentView;
1472 }
1473
1474
1479 public Map<String, String> getRoleMappers() {
1480 return _roleMappers;
1481 }
1482
1483
1488 public String[] getRolesArray() {
1489 return _rolesArray;
1490 }
1491
1492
1497 public Portlet getRootPortlet() {
1498 return _rootPortlet;
1499 }
1500
1501
1506 public String getRootPortletId() {
1507 return PortletConstants.getRootPortletId(getPortletId());
1508 }
1509
1510
1515 public List<SchedulerEntry> getSchedulerEntries() {
1516 return _schedulerEntries;
1517 }
1518
1519
1524 public boolean getScopeable() {
1525 return _scopeable;
1526 }
1527
1528
1535 public boolean getShowPortletAccessDenied() {
1536 return _showPortletAccessDenied;
1537 }
1538
1539
1545 public boolean getShowPortletInactive() {
1546 return _showPortletInactive;
1547 }
1548
1549
1554 public String getSocialActivityInterpreterClass() {
1555 return _socialActivityInterpreterClass;
1556 }
1557
1558
1565 public SocialActivityInterpreter getSocialActivityInterpreterInstance() {
1566 if (Validator.isNull(getSocialActivityInterpreterClass())) {
1567 return null;
1568 }
1569
1570 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1571
1572 return portletBag.getSocialActivityInterpreterInstance();
1573 }
1574
1575
1580 public String getSocialRequestInterpreterClass() {
1581 return _socialRequestInterpreterClass;
1582 }
1583
1584
1591 public SocialRequestInterpreter getSocialRequestInterpreterInstance() {
1592 if (Validator.isNull(getSocialRequestInterpreterClass())) {
1593 return null;
1594 }
1595
1596 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1597
1598 return portletBag.getSocialRequestInterpreterInstance();
1599 }
1600
1601
1608 public List<String> getStagedModelDataHandlerClasses() {
1609 return _stagedModelDataHandlerClasses;
1610 }
1611
1612
1617 public List<StagedModelDataHandler<?>>
1618 getStagedModelDataHandlerInstances() {
1619
1620 if (_stagedModelDataHandlerClasses.isEmpty()) {
1621 return null;
1622 }
1623
1624 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1625
1626 return portletBag.getStagedModelDataHandlerInstances();
1627 }
1628
1629
1636 public boolean getStatic() {
1637 return _staticPortlet;
1638 }
1639
1640
1647 public boolean getStaticEnd() {
1648 return !_staticPortletStart;
1649 }
1650
1651
1656 public String getStaticResourcePath() {
1657 String proxyPath = PortalUtil.getPathProxy();
1658
1659 String virtualPath = getVirtualPath();
1660
1661 if (Validator.isNotNull(virtualPath)) {
1662 return proxyPath.concat(virtualPath);
1663 }
1664
1665 String contextPath = getContextPath();
1666
1667 if (!_portletApp.isWARFile()) {
1668 return contextPath;
1669 }
1670
1671 return proxyPath.concat(contextPath);
1672 }
1673
1674
1681 public boolean getStaticStart() {
1682 return _staticPortletStart;
1683 }
1684
1685
1690 public String getStrutsPath() {
1691 return _strutsPath;
1692 }
1693
1694
1699 public Set<String> getSupportedLocales() {
1700 return _supportedLocales;
1701 }
1702
1703
1710 public boolean getSystem() {
1711 return _system;
1712 }
1713
1714
1719 public long getTimestamp() {
1720 return _timestamp;
1721 }
1722
1723
1730 public List<String> getTrashHandlerClasses() {
1731 return _trashHandlerClasses;
1732 }
1733
1734
1739 public List<TrashHandler> getTrashHandlerInstances() {
1740 if (_trashHandlerClasses.isEmpty()) {
1741 return null;
1742 }
1743
1744 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1745
1746 return portletBag.getTrashHandlerInstances();
1747 }
1748
1749
1755 public boolean getUndeployedPortlet() {
1756 return _undeployedPortlet;
1757 }
1758
1759
1764 public Set<String> getUnlinkedRoles() {
1765 return _unlinkedRoles;
1766 }
1767
1768
1773 public String getURLEncoderClass() {
1774 return _urlEncoderClass;
1775 }
1776
1777
1782 public URLEncoder getURLEncoderInstance() {
1783 if (Validator.isNull(getURLEncoderClass())) {
1784 return null;
1785 }
1786
1787 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1788
1789 return portletBag.getURLEncoderInstance();
1790 }
1791
1792
1797 public boolean getUseDefaultTemplate() {
1798 return _useDefaultTemplate;
1799 }
1800
1801
1807 public long getUserId() {
1808 return PortletConstants.getUserId(getPortletId());
1809 }
1810
1811
1816 public String getUserPrincipalStrategy() {
1817 return _userPrincipalStrategy;
1818 }
1819
1820
1825 public String getVirtualPath() {
1826 return _virtualPath;
1827 }
1828
1829
1834 public String getWebDAVStorageClass() {
1835 return _webDAVStorageClass;
1836 }
1837
1838
1843 public WebDAVStorage getWebDAVStorageInstance() {
1844 if (Validator.isNull(getWebDAVStorageClass())) {
1845 return null;
1846 }
1847
1848 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1849
1850 return portletBag.getWebDAVStorageInstance();
1851 }
1852
1853
1858 public String getWebDAVStorageToken() {
1859 return _webDAVStorageToken;
1860 }
1861
1862
1867 public Map<String, Set<String>> getWindowStates() {
1868 return _windowStates;
1869 }
1870
1871
1878 public List<String> getWorkflowHandlerClasses() {
1879 return _workflowHandlerClasses;
1880 }
1881
1882
1887 public List<WorkflowHandler> getWorkflowHandlerInstances() {
1888 if (_workflowHandlerClasses.isEmpty()) {
1889 return null;
1890 }
1891
1892 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1893
1894 return portletBag.getWorkflowHandlerInstances();
1895 }
1896
1897
1902 public String getXmlRpcMethodClass() {
1903 return _xmlRpcMethodClass;
1904 }
1905
1906
1911 public Method getXmlRpcMethodInstance() {
1912 if (Validator.isNull(getXmlRpcMethodClass())) {
1913 return null;
1914 }
1915
1916 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1917
1918 return portletBag.getXmlRpcMethodInstance();
1919 }
1920
1921
1929 public boolean hasAddPortletPermission(long userId) {
1930 PermissionChecker permissionChecker =
1931 PermissionThreadLocal.getPermissionChecker();
1932
1933 try {
1934 if ((permissionChecker == null) ||
1935 (permissionChecker.getUserId() != userId)) {
1936
1937 User user = UserLocalServiceUtil.getUser(userId);
1938
1939 permissionChecker = PermissionCheckerFactoryUtil.create(user);
1940 }
1941
1942 if (PortletPermissionUtil.contains(
1943 permissionChecker, getRootPortletId(),
1944 ActionKeys.ADD_TO_PAGE)) {
1945
1946 return true;
1947 }
1948 }
1949 catch (Exception e) {
1950 _log.error(e, e);
1951 }
1952
1953 return false;
1954 }
1955
1956
1962 public boolean hasMultipleMimeTypes() {
1963 if (_portletModes.size() > 1) {
1964 return true;
1965 }
1966 else {
1967 return false;
1968 }
1969 }
1970
1971
1980 public boolean hasPortletMode(String mimeType, PortletMode portletMode) {
1981 if (mimeType == null) {
1982 mimeType = ContentTypes.TEXT_HTML;
1983 }
1984
1985 Set<String> mimeTypePortletModes = _portletModes.get(mimeType);
1986
1987 if (mimeTypePortletModes == null) {
1988 return false;
1989 }
1990
1991 if (mimeTypePortletModes.contains(portletMode.toString())) {
1992 return true;
1993 }
1994 else {
1995 return false;
1996 }
1997 }
1998
1999
2007 public boolean hasRoleWithName(String roleName) {
2008 if ((_rolesArray == null) || (_rolesArray.length == 0)) {
2009 return false;
2010 }
2011
2012 for (int i = 0; i < _rolesArray.length; i++) {
2013 if (_rolesArray[i].equalsIgnoreCase(roleName)) {
2014 return true;
2015 }
2016 }
2017
2018 return false;
2019 }
2020
2021
2030 public boolean hasWindowState(String mimeType, WindowState windowState) {
2031 if (mimeType == null) {
2032 mimeType = ContentTypes.TEXT_HTML;
2033 }
2034
2035 Set<String> mimeTypeWindowStates = _windowStates.get(mimeType);
2036
2037 if (mimeTypeWindowStates == null) {
2038 return false;
2039 }
2040
2041 if (mimeTypeWindowStates.contains(windowState.toString())) {
2042 return true;
2043 }
2044 else {
2045 return false;
2046 }
2047 }
2048
2049
2056 public boolean isActionURLRedirect() {
2057 return _actionURLRedirect;
2058 }
2059
2060
2067 public boolean isAddDefaultResource() {
2068 return _addDefaultResource;
2069 }
2070
2071
2076 public boolean isAjaxable() {
2077 return _ajaxable;
2078 }
2079
2080
2087 public boolean isInclude() {
2088 return _include;
2089 }
2090
2091
2098 public boolean isInstanceable() {
2099 return _instanceable;
2100 }
2101
2102
2108 public boolean isLayoutCacheable() {
2109 return _layoutCacheable;
2110 }
2111
2112
2119 public boolean isMaximizeEdit() {
2120 return _maximizeEdit;
2121 }
2122
2123
2130 public boolean isMaximizeHelp() {
2131 return _maximizeHelp;
2132 }
2133
2134
2141 public boolean isPopUpPrint() {
2142 return _popUpPrint;
2143 }
2144
2145
2152 public boolean isPreferencesCompanyWide() {
2153 return _preferencesCompanyWide;
2154 }
2155
2156
2165 public boolean isPreferencesOwnedByGroup() {
2166 return _preferencesOwnedByGroup;
2167 }
2168
2169
2174 public boolean isPreferencesUniquePerLayout() {
2175 return _preferencesUniquePerLayout;
2176 }
2177
2178
2185 public boolean isPrivateRequestAttributes() {
2186 return _privateRequestAttributes;
2187 }
2188
2189
2196 public boolean isPrivateSessionAttributes() {
2197 return _privateSessionAttributes;
2198 }
2199
2200
2205 public boolean isReady() {
2206 Boolean ready = _readyMap.get(getRootPortletId());
2207
2208 if (ready == null) {
2209 return true;
2210 }
2211 else {
2212 return ready;
2213 }
2214 }
2215
2216
2221 public boolean isRemoteable() {
2222 return _remoteable;
2223 }
2224
2225
2232 public boolean isRestoreCurrentView() {
2233 return _restoreCurrentView;
2234 }
2235
2236
2241 public boolean isScopeable() {
2242 return _scopeable;
2243 }
2244
2245
2252 public boolean isShowPortletAccessDenied() {
2253 return _showPortletAccessDenied;
2254 }
2255
2256
2262 public boolean isShowPortletInactive() {
2263 return _showPortletInactive;
2264 }
2265
2266
2273 public boolean isStatic() {
2274 return _staticPortlet;
2275 }
2276
2277
2284 public boolean isStaticEnd() {
2285 return !_staticPortletStart;
2286 }
2287
2288
2295 public boolean isStaticStart() {
2296 return _staticPortletStart;
2297 }
2298
2299
2306 public boolean isSystem() {
2307 return _system;
2308 }
2309
2310
2316 public boolean isUndeployedPortlet() {
2317 return _undeployedPortlet;
2318 }
2319
2320
2325 public boolean isUseDefaultTemplate() {
2326 return _useDefaultTemplate;
2327 }
2328
2329
2333 public void linkRoles() {
2334 List<String> linkedRoles = new ArrayList<String>();
2335
2336 for (String unlinkedRole : _unlinkedRoles) {
2337 String roleLink = _roleMappers.get(unlinkedRole);
2338
2339 if (Validator.isNotNull(roleLink)) {
2340 if (_log.isDebugEnabled()) {
2341 _log.debug(
2342 "Linking role for portlet [" + getPortletId() +
2343 "] with role-name [" + unlinkedRole +
2344 "] to role-link [" + roleLink + "]");
2345 }
2346
2347 linkedRoles.add(roleLink);
2348 }
2349 else {
2350 _log.error(
2351 "Unable to link role for portlet [" + getPortletId() +
2352 "] with role-name [" + unlinkedRole +
2353 "] because role-link is null");
2354 }
2355 }
2356
2357 String[] array = linkedRoles.toArray(new String[linkedRoles.size()]);
2358
2359 Arrays.sort(array);
2360
2361 setRolesArray(array);
2362 }
2363
2364
2369 public void setActionTimeout(int actionTimeout) {
2370 _actionTimeout = actionTimeout;
2371 }
2372
2373
2380 public void setActionURLRedirect(boolean actionURLRedirect) {
2381 _actionURLRedirect = actionURLRedirect;
2382 }
2383
2384
2391 public void setAddDefaultResource(boolean addDefaultResource) {
2392 _addDefaultResource = addDefaultResource;
2393 }
2394
2395
2401 public void setAjaxable(boolean ajaxable) {
2402 _ajaxable = ajaxable;
2403 }
2404
2405
2412 public void setAssetRendererFactoryClasses(
2413 List<String> assetRendererFactoryClasses) {
2414
2415 _assetRendererFactoryClasses = assetRendererFactoryClasses;
2416 }
2417
2418
2425 public void setAtomCollectionAdapterClasses(
2426 List<String> atomCollectionAdapterClasses) {
2427
2428 _atomCollectionAdapterClasses = atomCollectionAdapterClasses;
2429 }
2430
2431
2438 public void setAutopropagatedParameters(
2439 Set<String> autopropagatedParameters) {
2440
2441 _autopropagatedParameters = autopropagatedParameters;
2442 }
2443
2444
2450 public void setConfigurationActionClass(String configurationActionClass) {
2451 _configurationActionClass = configurationActionClass;
2452 }
2453
2454
2461 public void setControlPanelEntryCategory(String controlPanelEntryCategory) {
2462 _controlPanelEntryCategory = controlPanelEntryCategory;
2463 }
2464
2465
2472 public void setControlPanelEntryClass(String controlPanelEntryClass) {
2473 _controlPanelEntryClass = controlPanelEntryClass;
2474 }
2475
2476
2484 public void setControlPanelEntryWeight(double controlPanelEntryWeight) {
2485 _controlPanelEntryWeight = controlPanelEntryWeight;
2486 }
2487
2488
2495 public void setCssClassWrapper(String cssClassWrapper) {
2496 _cssClassWrapper = cssClassWrapper;
2497 }
2498
2499
2506 public void setCustomAttributesDisplayClasses(
2507 List<String> customAttributesDisplayClasses) {
2508
2509 _customAttributesDisplayClasses = customAttributesDisplayClasses;
2510 }
2511
2512
2517 public void setDefaultPluginSetting(PluginSetting pluginSetting) {
2518 _defaultPluginSetting = pluginSetting;
2519 }
2520
2521
2526 public void setDefaultPreferences(String defaultPreferences) {
2527 _defaultPreferences = defaultPreferences;
2528 }
2529
2530
2535 public void setDisplayName(String displayName) {
2536 _displayName = displayName;
2537 }
2538
2539
2544 public void setExpCache(Integer expCache) {
2545 _expCache = expCache;
2546 }
2547
2548
2553 public void setFacebookIntegration(String facebookIntegration) {
2554 if (Validator.isNotNull(facebookIntegration)) {
2555 _facebookIntegration = facebookIntegration;
2556 }
2557 }
2558
2559
2566 public void setFooterPortalCss(List<String> footerPortalCss) {
2567 _footerPortalCss = footerPortalCss;
2568 }
2569
2570
2578 public void setFooterPortalJavaScript(List<String> footerPortalJavaScript) {
2579 _footerPortalJavaScript = footerPortalJavaScript;
2580 }
2581
2582
2589 public void setFooterPortletCss(List<String> footerPortletCss) {
2590 _footerPortletCss = footerPortletCss;
2591 }
2592
2593
2601 public void setFooterPortletJavaScript(
2602 List<String> footerPortletJavaScript) {
2603
2604 _footerPortletJavaScript = footerPortletJavaScript;
2605 }
2606
2607
2613 public void setFriendlyURLMapperClass(String friendlyURLMapperClass) {
2614 _friendlyURLMapperClass = friendlyURLMapperClass;
2615 }
2616
2617
2623 public void setFriendlyURLMapping(String friendlyURLMapping) {
2624 _friendlyURLMapping = friendlyURLMapping;
2625 }
2626
2627
2634 public void setFriendlyURLRoutes(String friendlyURLRoutes) {
2635 _friendlyURLRoutes = friendlyURLRoutes;
2636 }
2637
2638
2645 public void setHeaderPortalCss(List<String> headerPortalCss) {
2646 _headerPortalCss = headerPortalCss;
2647 }
2648
2649
2657 public void setHeaderPortalJavaScript(List<String> headerPortalJavaScript) {
2658 _headerPortalJavaScript = headerPortalJavaScript;
2659 }
2660
2661
2668 public void setHeaderPortletCss(List<String> headerPortletCss) {
2669 _headerPortletCss = headerPortletCss;
2670 }
2671
2672
2680 public void setHeaderPortletJavaScript(
2681 List<String> headerPortletJavaScript) {
2682
2683 _headerPortletJavaScript = headerPortletJavaScript;
2684 }
2685
2686
2691 public void setIcon(String icon) {
2692 _icon = icon;
2693 }
2694
2695
2702 public void setInclude(boolean include) {
2703 _include = include;
2704 }
2705
2706
2713 public void setIndexerClasses(List<String> indexerClasses) {
2714 _indexerClasses = indexerClasses;
2715 }
2716
2717
2722 public void setInitParams(Map<String, String> initParams) {
2723 _initParams = initParams;
2724 }
2725
2726
2733 public void setInstanceable(boolean instanceable) {
2734 _instanceable = instanceable;
2735 }
2736
2737
2744 public void setLayoutCacheable(boolean layoutCacheable) {
2745 _layoutCacheable = layoutCacheable;
2746 }
2747
2748
2755 public void setMaximizeEdit(boolean maximizeEdit) {
2756 _maximizeEdit = maximizeEdit;
2757 }
2758
2759
2766 public void setMaximizeHelp(boolean maximizeHelp) {
2767 _maximizeHelp = maximizeHelp;
2768 }
2769
2770
2775 public void setOpenSearchClass(String openSearchClass) {
2776 _openSearchClass = openSearchClass;
2777 }
2778
2779
2784 public void setParentStrutsPath(String parentStrutsPath) {
2785 _parentStrutsPath = parentStrutsPath;
2786 }
2787
2788
2791 public void setPermissionPropagatorClass(String permissionPropagatorClass) {
2792 _permissionPropagatorClass = permissionPropagatorClass;
2793 }
2794
2795
2800 public void setPluginPackage(PluginPackage pluginPackage) {
2801 _pluginPackage = pluginPackage;
2802 }
2803
2804
2810 public void setPollerProcessorClass(String pollerProcessorClass) {
2811 _pollerProcessorClass = pollerProcessorClass;
2812 }
2813
2814
2820 public void setPopMessageListenerClass(String popMessageListenerClass) {
2821 _popMessageListenerClass = popMessageListenerClass;
2822 }
2823
2824
2831 public void setPopUpPrint(boolean popUpPrint) {
2832 _popUpPrint = popUpPrint;
2833 }
2834
2835
2840 public void setPortletApp(PortletApp portletApp) {
2841 _portletApp = portletApp;
2842
2843 _portletApp.addPortlet(this);
2844 }
2845
2846
2851 public void setPortletClass(String portletClass) {
2852 _portletClass = portletClass;
2853 }
2854
2855
2861 public void setPortletDataHandlerClass(String portletDataHandlerClass) {
2862 _portletDataHandlerClass = portletDataHandlerClass;
2863 }
2864
2865
2872 public void setPortletDisplayTemplateHandlerClass(
2873 String portletDisplayTemplateHandlerClass) {
2874
2875 _portletDisplayTemplateHandlerClass =
2876 portletDisplayTemplateHandlerClass;
2877 }
2878
2879
2884 public void setPortletFilters(Map<String, PortletFilter> portletFilters) {
2885 _portletFilters = portletFilters;
2886 }
2887
2888
2893 public void setPortletInfo(PortletInfo portletInfo) {
2894 _portletInfo = portletInfo;
2895 }
2896
2897
2903 public void setPortletLayoutListenerClass(
2904 String portletLayoutListenerClass) {
2905
2906 _portletLayoutListenerClass = portletLayoutListenerClass;
2907 }
2908
2909
2914 public void setPortletModes(Map<String, Set<String>> portletModes) {
2915 _portletModes = portletModes;
2916 }
2917
2918
2923 public void setPortletName(String portletName) {
2924 _portletName = portletName;
2925 }
2926
2927
2932 public void setPortletURLClass(String portletURLClass) {
2933 _portletURLClass = portletURLClass;
2934 }
2935
2936
2943 public void setPreferencesCompanyWide(boolean preferencesCompanyWide) {
2944 _preferencesCompanyWide = preferencesCompanyWide;
2945 }
2946
2947
2956 public void setPreferencesOwnedByGroup(boolean preferencesOwnedByGroup) {
2957 _preferencesOwnedByGroup = preferencesOwnedByGroup;
2958 }
2959
2960
2966 public void setPreferencesUniquePerLayout(
2967 boolean preferencesUniquePerLayout) {
2968
2969 _preferencesUniquePerLayout = preferencesUniquePerLayout;
2970 }
2971
2972
2978 public void setPreferencesValidator(String preferencesValidator) {
2979 if (preferencesValidator != null) {
2980
2981
2982
2983
2984 _preferencesValidator = preferencesValidator.trim();
2985 }
2986 else {
2987 _preferencesValidator = null;
2988 }
2989 }
2990
2991
2999 public void setPrivateRequestAttributes(boolean privateRequestAttributes) {
3000 _privateRequestAttributes = privateRequestAttributes;
3001 }
3002
3003
3010 public void setPrivateSessionAttributes(boolean privateSessionAttributes) {
3011 _privateSessionAttributes = privateSessionAttributes;
3012 }
3013
3014
3019 public void setProcessingEvents(Set<QName> processingEvents) {
3020 for (QName processingEvent : processingEvents) {
3021 addProcessingEvent(processingEvent);
3022 }
3023 }
3024
3025
3031 public void setPublicRenderParameters(
3032 Set<PublicRenderParameter> publicRenderParameters) {
3033
3034 for (PublicRenderParameter publicRenderParameter :
3035 publicRenderParameters) {
3036
3037 addPublicRenderParameter(publicRenderParameter);
3038 }
3039 }
3040
3041
3046 public void setPublishingEvents(Set<QName> publishingEvents) {
3047 for (QName publishingEvent : publishingEvents) {
3048 addPublishingEvent(publishingEvent);
3049 }
3050 }
3051
3052
3057 public void setReady(boolean ready) {
3058 _readyMap.put(getRootPortletId(), ready);
3059 }
3060
3061
3067 public void setRemoteable(boolean remoteable) {
3068 _remoteable = remoteable;
3069 }
3070
3071
3076 public void setRenderTimeout(int renderTimeout) {
3077 _renderTimeout = renderTimeout;
3078 }
3079
3080
3085 public void setRenderWeight(int renderWeight) {
3086 _renderWeight = renderWeight;
3087 }
3088
3089
3094 public void setResourceBundle(String resourceBundle) {
3095 _resourceBundle = resourceBundle;
3096 }
3097
3098
3105 public void setRestoreCurrentView(boolean restoreCurrentView) {
3106 _restoreCurrentView = restoreCurrentView;
3107 }
3108
3109
3114 public void setRoleMappers(Map<String, String> roleMappers) {
3115 _roleMappers = roleMappers;
3116 }
3117
3118
3123 @Override
3124 public void setRoles(String roles) {
3125 _rolesArray = StringUtil.split(roles);
3126
3127 super.setRoles(roles);
3128 }
3129
3130
3135 public void setRolesArray(String[] rolesArray) {
3136 _rolesArray = rolesArray;
3137
3138 super.setRoles(StringUtil.merge(rolesArray));
3139 }
3140
3141
3146 public void setSchedulerEntries(List<SchedulerEntry> schedulerEntries) {
3147 for (SchedulerEntry schedulerEntry : schedulerEntries) {
3148 addSchedulerEntry(schedulerEntry);
3149 }
3150 }
3151
3152
3158 public void setScopeable(boolean scopeable) {
3159 _scopeable = scopeable;
3160 }
3161
3162
3169 public void setShowPortletAccessDenied(boolean showPortletAccessDenied) {
3170 _showPortletAccessDenied = showPortletAccessDenied;
3171 }
3172
3173
3179 public void setShowPortletInactive(boolean showPortletInactive) {
3180 _showPortletInactive = showPortletInactive;
3181 }
3182
3183
3189 public void setSocialActivityInterpreterClass(
3190 String socialActivityInterpreterClass) {
3191
3192 _socialActivityInterpreterClass = socialActivityInterpreterClass;
3193 }
3194
3195
3201 public void setSocialRequestInterpreterClass(
3202 String socialRequestInterpreterClass) {
3203
3204 _socialRequestInterpreterClass = socialRequestInterpreterClass;
3205 }
3206
3207
3212
3213
3220 public void setStagedModelDataHandlerClasses(
3221 List<String> stagedModelDataHandlerClasses) {
3222
3223 _stagedModelDataHandlerClasses = stagedModelDataHandlerClasses;
3224 }
3225
3226
3233 public void setStatic(boolean staticPortlet) {
3234 _staticPortlet = staticPortlet;
3235 }
3236
3237
3244 public void setStaticStart(boolean staticPortletStart) {
3245 _staticPortletStart = staticPortletStart;
3246 }
3247
3248
3253 public void setStrutsPath(String strutsPath) {
3254 _strutsPath = strutsPath;
3255 }
3256
3257
3262 public void setSupportedLocales(Set<String> supportedLocales) {
3263 _supportedLocales = supportedLocales;
3264 }
3265
3266
3273 public void setSystem(boolean system) {
3274 _system = system;
3275 }
3276
3277
3282 public void setTimestamp(long timestamp) {
3283 _timestamp = timestamp;
3284 }
3285
3286
3293 public void setTrashHandlerClasses(List<String> trashHandlerClasses) {
3294 _trashHandlerClasses = trashHandlerClasses;
3295 }
3296
3297
3303 public void setUndeployedPortlet(boolean undeployedPortlet) {
3304 _undeployedPortlet = undeployedPortlet;
3305 }
3306
3307
3312 public void setUnlinkedRoles(Set<String> unlinkedRoles) {
3313 _unlinkedRoles = unlinkedRoles;
3314 }
3315
3316
3321 public void setURLEncoderClass(String urlEncoderClass) {
3322 _urlEncoderClass = urlEncoderClass;
3323 }
3324
3325
3331 public void setUseDefaultTemplate(boolean useDefaultTemplate) {
3332 _useDefaultTemplate = useDefaultTemplate;
3333 }
3334
3335
3340 public void setUserPrincipalStrategy(String userPrincipalStrategy) {
3341 if (Validator.isNotNull(userPrincipalStrategy)) {
3342 _userPrincipalStrategy = userPrincipalStrategy;
3343 }
3344 }
3345
3346
3351 public void setVirtualPath(String virtualPath) {
3352 if (_portletApp.isWARFile() && Validator.isNull(virtualPath)) {
3353 virtualPath = PropsValues.PORTLET_VIRTUAL_PATH;
3354 }
3355
3356 _virtualPath = virtualPath;
3357 }
3358
3359
3365 public void setWebDAVStorageClass(String webDAVStorageClass) {
3366 _webDAVStorageClass = webDAVStorageClass;
3367 }
3368
3369
3375 public void setWebDAVStorageToken(String webDAVStorageToken) {
3376 _webDAVStorageToken = webDAVStorageToken;
3377 }
3378
3379
3384 public void setWindowStates(Map<String, Set<String>> windowStates) {
3385 _windowStates = windowStates;
3386 }
3387
3388
3395 public void setWorkflowHandlerClasses(List<String> workflowHandlerClasses) {
3396 _workflowHandlerClasses = workflowHandlerClasses;
3397 }
3398
3399
3405 public void setXmlRpcMethodClass(String xmlRpcMethodClass) {
3406 _xmlRpcMethodClass = xmlRpcMethodClass;
3407 }
3408
3409
3412 private static Log _log = LogFactoryUtil.getLog(PortletImpl.class);
3413
3414
3417 private static Map<String, Boolean> _readyMap =
3418 new ConcurrentHashMap<String, Boolean>();
3419
3420
3423 private int _actionTimeout;
3424
3425
3429 private boolean _actionURLRedirect;
3430
3431
3435 private boolean _addDefaultResource;
3436
3437
3440 private boolean _ajaxable = true;
3441
3442
3446 private List<String> _assetRendererFactoryClasses;
3447
3448
3452 private List<String> _atomCollectionAdapterClasses;
3453
3454
3458 private Set<String> _autopropagatedParameters;
3459
3460
3463 private String _configurationActionClass;
3464
3465
3469 private String _controlPanelEntryCategory;
3470
3471
3475 private String _controlPanelEntryClass;
3476
3477
3481 private double _controlPanelEntryWeight = 100;
3482
3483
3487 private String _cssClassWrapper = StringPool.BLANK;
3488
3489
3493 private List<String> _customAttributesDisplayClasses;
3494
3495
3498 private PluginSetting _defaultPluginSetting;
3499
3500
3503 private String _defaultPreferences;
3504
3505
3508 private String _displayName;
3509
3510
3513 private Integer _expCache;
3514
3515
3518 private String _facebookIntegration =
3519 PortletConstants.FACEBOOK_INTEGRATION_IFRAME;
3520
3521
3525 private List<String> _footerPortalCss;
3526
3527
3531 private List<String> _footerPortalJavaScript;
3532
3533
3537 private List<String> _footerPortletCss;
3538
3539
3543 private List<String> _footerPortletJavaScript;
3544
3545
3548 private String _friendlyURLMapperClass;
3549
3550
3553 private String _friendlyURLMapping;
3554
3555
3559 private String _friendlyURLRoutes;
3560
3561
3565 private List<String> _headerPortalCss;
3566
3567
3571 private List<String> _headerPortalJavaScript;
3572
3573
3577 private List<String> _headerPortletCss;
3578
3579
3583 private List<String> _headerPortletJavaScript;
3584
3585
3588 private String _icon;
3589
3590
3594 private boolean _include = true;
3595
3596
3600 private List<String> _indexerClasses;
3601
3602
3605 private Map<String, String> _initParams;
3606
3607
3610 private boolean _instanceable;
3611
3612
3615 private boolean _layoutCacheable;
3616
3617
3621 private boolean _maximizeEdit;
3622
3623
3627 private boolean _maximizeHelp;
3628
3629
3632 private String _openSearchClass;
3633
3634
3637 private String _parentStrutsPath;
3638
3639
3642 private String _permissionPropagatorClass;
3643
3644
3647 private PluginPackage _pluginPackage;
3648
3649
3652 private String _pollerProcessorClass;
3653
3654
3657 private String _popMessageListenerClass;
3658
3659
3663 private boolean _popUpPrint = true;
3664
3665
3668 private PortletApp _portletApp;
3669
3670
3673 private String _portletClass;
3674
3675
3678 private String _portletDataHandlerClass;
3679
3680
3683 private String _portletDisplayTemplateHandlerClass;
3684
3685
3688 private Map<String, PortletFilter> _portletFilters;
3689
3690
3693 private PortletInfo _portletInfo;
3694
3695
3698 private String _portletLayoutListenerClass;
3699
3700
3703 private Map<String, Set<String>> _portletModes;
3704
3705
3708 private String _portletName;
3709
3710
3713 private String _portletURLClass;
3714
3715
3718 private boolean _preferencesCompanyWide;
3719
3720
3725 private boolean _preferencesOwnedByGroup = true;
3726
3727
3730 private boolean _preferencesUniquePerLayout = true;
3731
3732
3735 private String _preferencesValidator;
3736
3737
3741 private boolean _privateRequestAttributes = true;
3742
3743
3747 private boolean _privateSessionAttributes = true;
3748
3749
3752 private Set<QName> _processingEvents = new HashSet<QName>();
3753
3754
3757 private Map<String, QName> _processingEventsByQName =
3758 new HashMap<String, QName>();
3759
3760
3763 private Set<PublicRenderParameter> _publicRenderParameters =
3764 new HashSet<PublicRenderParameter>();
3765
3766
3770 private Map<String, PublicRenderParameter>
3771 _publicRenderParametersByIdentifier =
3772 new HashMap<String, PublicRenderParameter>();
3773
3774
3778 private Map<String, PublicRenderParameter>
3779 _publicRenderParametersByQName =
3780 new HashMap<String, PublicRenderParameter>();
3781
3782
3785 private Set<QName> _publishingEvents = new HashSet<QName>();
3786
3787
3790 private boolean _remoteable;
3791
3792
3795 private int _renderTimeout;
3796
3797
3800 private int _renderWeight = 1;
3801
3802
3805 private String _resourceBundle;
3806
3807
3811 private boolean _restoreCurrentView = true;
3812
3813
3816 private Map<String, String> _roleMappers;
3817
3818
3821 private String[] _rolesArray = new String[0];
3822
3823
3826 private Portlet _rootPortlet = this;
3827
3828
3831 private List<SchedulerEntry> _schedulerEntries;
3832
3833
3836 private boolean _scopeable;
3837
3838
3842 private boolean _showPortletAccessDenied =
3843 PropsValues.LAYOUT_SHOW_PORTLET_ACCESS_DENIED;
3844
3845
3848 private boolean _showPortletInactive =
3849 PropsValues.LAYOUT_SHOW_PORTLET_INACTIVE;
3850
3851
3854 private String _socialActivityInterpreterClass;
3855
3856
3859 private String _socialRequestInterpreterClass;
3860
3861
3865 private List<String> _stagedModelDataHandlerClasses;
3866
3867
3871 private boolean _staticPortlet;
3872
3873
3877 private boolean _staticPortletStart;
3878
3879
3882 private String _strutsPath;
3883
3884
3887 private Set<String> _supportedLocales;
3888
3889
3893 private boolean _system;
3894
3895
3898 private long _timestamp;
3899
3900
3904 private List<String> _trashHandlerClasses;
3905
3906
3909 private boolean _undeployedPortlet = false;
3910
3911
3914 private Set<String> _unlinkedRoles;
3915
3916
3919 private String _urlEncoderClass;
3920
3921
3924 private boolean _useDefaultTemplate = true;
3925
3926
3929 private String _userPrincipalStrategy =
3930 PortletConstants.USER_PRINCIPAL_STRATEGY_USER_ID;
3931
3932
3935 private String _virtualPath;
3936
3937
3940 private String _webDAVStorageClass;
3941
3942
3945 private String _webDAVStorageToken;
3946
3947
3950 private Map<String, Set<String>> _windowStates;
3951
3952
3956 private List<String> _workflowHandlerClasses;
3957
3958
3961 private String _xmlRpcMethodClass;
3962
3963 }