| PortletImpl.java |
1 /**
2 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3 *
4 * This library is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 2.1 of the License, or (at your option)
7 * any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
13 */
14
15 package com.liferay.portal.model.impl;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.plugin.PluginPackage;
20 import com.liferay.portal.kernel.poller.PollerProcessor;
21 import com.liferay.portal.kernel.pop.MessageListener;
22 import com.liferay.portal.kernel.portlet.ConfigurationAction;
23 import com.liferay.portal.kernel.portlet.FriendlyURLMapper;
24 import com.liferay.portal.kernel.portlet.PortletBag;
25 import com.liferay.portal.kernel.portlet.PortletBagPool;
26 import com.liferay.portal.kernel.portlet.PortletLayoutListener;
27 import com.liferay.portal.kernel.scheduler.SchedulerEntry;
28 import com.liferay.portal.kernel.search.Indexer;
29 import com.liferay.portal.kernel.search.OpenSearch;
30 import com.liferay.portal.kernel.servlet.URLEncoder;
31 import com.liferay.portal.kernel.util.ContentTypes;
32 import com.liferay.portal.kernel.util.InstancePool;
33 import com.liferay.portal.kernel.util.StringPool;
34 import com.liferay.portal.kernel.util.StringUtil;
35 import com.liferay.portal.kernel.util.Validator;
36 import com.liferay.portal.kernel.workflow.WorkflowHandler;
37 import com.liferay.portal.kernel.xml.QName;
38 import com.liferay.portal.kernel.xmlrpc.Method;
39 import com.liferay.portal.lar.PortletDataHandler;
40 import com.liferay.portal.model.Plugin;
41 import com.liferay.portal.model.PluginSetting;
42 import com.liferay.portal.model.Portlet;
43 import com.liferay.portal.model.PortletApp;
44 import com.liferay.portal.model.PortletConstants;
45 import com.liferay.portal.model.PortletFilter;
46 import com.liferay.portal.model.PortletInfo;
47 import com.liferay.portal.model.PublicRenderParameter;
48 import com.liferay.portal.model.User;
49 import com.liferay.portal.security.permission.ActionKeys;
50 import com.liferay.portal.security.permission.PermissionChecker;
51 import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil;
52 import com.liferay.portal.security.permission.PermissionThreadLocal;
53 import com.liferay.portal.service.UserLocalServiceUtil;
54 import com.liferay.portal.service.permission.PortletPermissionUtil;
55 import com.liferay.portal.util.PortalUtil;
56 import com.liferay.portal.util.PropsValues;
57 import com.liferay.portal.webdav.WebDAVStorage;
58 import com.liferay.portlet.ControlPanelEntry;
59 import com.liferay.portlet.PortletBagImpl;
60 import com.liferay.portlet.PortletQNameUtil;
61 import com.liferay.portlet.asset.model.AssetRendererFactory;
62 import com.liferay.portlet.expando.model.CustomAttributesDisplay;
63 import com.liferay.portlet.social.model.SocialActivityInterpreter;
64 import com.liferay.portlet.social.model.SocialRequestInterpreter;
65
66 import java.util.ArrayList;
67 import java.util.Arrays;
68 import java.util.HashMap;
69 import java.util.HashSet;
70 import java.util.Hashtable;
71 import java.util.Iterator;
72 import java.util.LinkedHashMap;
73 import java.util.List;
74 import java.util.Map;
75 import java.util.Set;
76 import java.util.TreeSet;
77
78 import javax.portlet.PortletMode;
79 import javax.portlet.WindowState;
80
81 /**
82 * <a href="PortletImpl.java.html"><b><i>View Source</i></b></a>
83 *
84 * @author Brian Wing Shun Chan
85 */
86 public class PortletImpl extends PortletModelImpl implements Portlet {
87
88 /**
89 * Constructs a portlet with no parameters.
90 */
91 public PortletImpl() {
92 }
93
94 /**
95 * Constructs a portlet with the specified parameters.
96 */
97 public PortletImpl(long companyId, String portletId) {
98 setCompanyId(companyId);
99 setPortletId(portletId);
100 setStrutsPath(portletId);
101 setActive(true);
102 _schedulerEntries = new ArrayList<SchedulerEntry>();
103 _assetRendererFactoryClasses = new ArrayList<String>();
104 _customAttributesDisplayClasses = new ArrayList<String>();
105 _workflowHandlerClasses = new ArrayList<String>();
106 _headerPortalCss = new ArrayList<String>();
107 _headerPortletCss = new ArrayList<String>();
108 _headerPortalJavaScript = new ArrayList<String>();
109 _headerPortletJavaScript = new ArrayList<String>();
110 _footerPortalCss = new ArrayList<String>();
111 _footerPortletCss = new ArrayList<String>();
112 _footerPortalJavaScript = new ArrayList<String>();
113 _footerPortletJavaScript = new ArrayList<String>();
114 _unlinkedRoles = new HashSet<String>();
115 _roleMappers = new LinkedHashMap<String, String>();
116 _initParams = new HashMap<String, String>();
117 _portletModes = new HashMap<String, Set<String>>();
118 _windowStates = new HashMap<String, Set<String>>();
119 _supportedLocales = new HashSet<String>();
120 _portletFilters = new LinkedHashMap<String, PortletFilter>();
121 _processingEvents = new HashSet<QName>();
122 _publishingEvents = new HashSet<QName>();
123 _publicRenderParameters = new HashSet<PublicRenderParameter>();
124 }
125
126 /**
127 * Constructs a portlet with the specified parameters.
128 */
129 public PortletImpl(
130 String portletId, PluginPackage pluginPackage,
131 PluginSetting pluginSetting, long companyId, long timestamp,
132 String icon, String virtualPath, String strutsPath, String portletName,
133 String displayName, String portletClass,
134 String configurationActionClass, String indexerClass,
135 String openSearchClass, List<SchedulerEntry> schedulerEntries,
136 String portletURLClass, String friendlyURLMapperClass,
137 String urlEncoderClass, String portletDataHandlerClass,
138 String portletLayoutListenerClass, String pollerProcessorClass,
139 String popMessageListenerClass, String socialActivityInterpreterClass,
140 String socialRequestInterpreterClass, String webDAVStorageToken,
141 String webDAVStorageClass, String xmlRpcMethodClass,
142 String controlPanelEntryCategory, double controlPanelEntryWeight,
143 String controlPanelClass, List<String> assetRendererFactoryClasses,
144 List<String> customAttributesDisplayClasses,
145 List<String> workflowHandlerClasses, String defaultPreferences,
146 String preferencesValidator, boolean preferencesCompanyWide,
147 boolean preferencesUniquePerLayout, boolean preferencesOwnedByGroup,
148 boolean useDefaultTemplate, boolean showPortletAccessDenied,
149 boolean showPortletInactive, boolean actionURLRedirect,
150 boolean restoreCurrentView, boolean maximizeEdit, boolean maximizeHelp,
151 boolean popUpPrint, boolean layoutCacheable, boolean instanceable,
152 boolean scopeable, String userPrincipalStrategy,
153 boolean privateRequestAttributes, boolean privateSessionAttributes,
154 int renderWeight, boolean ajaxable, List<String> headerPortalCss,
155 List<String> headerPortletCss, List<String> headerPortalJavaScript,
156 List<String> headerPortletJavaScript, List<String> footerPortalCss,
157 List<String> footerPortletCss, List<String> footerPortalJavaScript,
158 List<String> footerPortletJavaScript, String cssClassWrapper,
159 String facebookIntegration, boolean addDefaultResource, String roles,
160 Set<String> unlinkedRoles, Map<String, String> roleMappers,
161 boolean system, boolean active, boolean include,
162 Map<String, String> initParams, Integer expCache,
163 Map<String, Set<String>> portletModes,
164 Map<String, Set<String>> windowStates, Set<String> supportedLocales,
165 String resourceBundle, PortletInfo portletInfo,
166 Map<String, PortletFilter> portletFilters, Set<QName> processingEvents,
167 Set<QName> publishingEvents,
168 Set<PublicRenderParameter> publicRenderParameters,
169 PortletApp portletApp) {
170
171 setPortletId(portletId);
172 _pluginPackage = pluginPackage;
173 _defaultPluginSetting = pluginSetting;
174 setCompanyId(companyId);
175 _timestamp = timestamp;
176 _icon = icon;
177 _virtualPath = virtualPath;
178 _strutsPath = strutsPath;
179 _portletName = portletName;
180 _displayName = displayName;
181 _portletClass = portletClass;
182 _configurationActionClass = configurationActionClass;
183 _indexerClass = indexerClass;
184 _openSearchClass = openSearchClass;
185 _schedulerEntries = schedulerEntries;
186 _portletURLClass = portletURLClass;
187 _friendlyURLMapperClass = friendlyURLMapperClass;
188 _urlEncoderClass = urlEncoderClass;
189 _portletDataHandlerClass = portletDataHandlerClass;
190 _portletLayoutListenerClass = portletLayoutListenerClass;
191 _pollerProcessorClass = pollerProcessorClass;
192 _popMessageListenerClass = popMessageListenerClass;
193 _socialActivityInterpreterClass = socialActivityInterpreterClass;
194 _socialRequestInterpreterClass = socialRequestInterpreterClass;
195 _webDAVStorageToken = webDAVStorageToken;
196 _webDAVStorageClass = webDAVStorageClass;
197 _xmlRpcMethodClass = xmlRpcMethodClass;
198 _controlPanelEntryCategory = controlPanelEntryCategory;
199 _controlPanelEntryWeight = controlPanelEntryWeight;
200 _controlPanelEntryClass = controlPanelClass;
201 _assetRendererFactoryClasses = assetRendererFactoryClasses;
202 _customAttributesDisplayClasses = customAttributesDisplayClasses;
203 _workflowHandlerClasses = workflowHandlerClasses;
204 _defaultPreferences = defaultPreferences;
205 _preferencesValidator = preferencesValidator;
206 _preferencesCompanyWide = preferencesCompanyWide;
207 _preferencesUniquePerLayout = preferencesUniquePerLayout;
208 _preferencesOwnedByGroup = preferencesOwnedByGroup;
209 _useDefaultTemplate = useDefaultTemplate;
210 _showPortletAccessDenied = showPortletAccessDenied;
211 _showPortletInactive = showPortletInactive;
212 _actionURLRedirect = actionURLRedirect;
213 _restoreCurrentView = restoreCurrentView;
214 _maximizeEdit = maximizeEdit;
215 _maximizeHelp = maximizeHelp;
216 _popUpPrint = popUpPrint;
217 _layoutCacheable = layoutCacheable;
218 _instanceable = instanceable;
219 _scopeable = scopeable;
220 _userPrincipalStrategy = userPrincipalStrategy;
221 _privateRequestAttributes = privateRequestAttributes;
222 _privateSessionAttributes = privateSessionAttributes;
223 _renderWeight = renderWeight;
224 _ajaxable = ajaxable;
225 _headerPortalCss = headerPortalCss;
226 _headerPortletCss = headerPortletCss;
227 _headerPortalJavaScript = headerPortalJavaScript;
228 _headerPortletJavaScript = headerPortletJavaScript;
229 _footerPortalCss = footerPortalCss;
230 _footerPortletCss = footerPortletCss;
231 _footerPortalJavaScript = footerPortalJavaScript;
232 _footerPortletJavaScript = footerPortletJavaScript;
233 _cssClassWrapper = cssClassWrapper;
234 _facebookIntegration = facebookIntegration;
235 _scopeable = scopeable;
236 _addDefaultResource = addDefaultResource;
237 setRoles(roles);
238 _unlinkedRoles = unlinkedRoles;
239 _roleMappers = roleMappers;
240 _system = system;
241 setActive(active);
242 _include = include;
243 _initParams = initParams;
244 _expCache = expCache;
245 _portletModes = portletModes;
246 _windowStates = windowStates;
247 _supportedLocales = supportedLocales;
248 _resourceBundle = resourceBundle;
249 _portletInfo = portletInfo;
250 _portletFilters = portletFilters;
251 setProcessingEvents(processingEvents);
252 setPublishingEvents(publishingEvents);
253 setPublicRenderParameters(publicRenderParameters);
254 _portletApp = portletApp;
255
256 if (_instanceable) {
257 _clonedInstances = new Hashtable<String, Portlet>();
258 }
259 }
260
261 /**
262 * Gets the root portlet id of the portlet.
263 *
264 * @return the root portlet id of the portlet
265 */
266 public String getRootPortletId() {
267 return PortletConstants.getRootPortletId(getPortletId());
268 }
269
270 /**
271 * Gets the instance id of the portlet.
272 *
273 * @return the instance id of the portlet
274 */
275 public String getInstanceId() {
276 return PortletConstants.getInstanceId(getPortletId());
277 }
278
279 /**
280 * Gets the plugin id of the portlet.
281 *
282 * @return the plugin id of the portlet
283 */
284 public String getPluginId() {
285 return getRootPortletId();
286 }
287
288 /**
289 * Gets the plugin type of the portlet.
290 *
291 * @return the plugin type of the portlet
292 */
293 public String getPluginType() {
294 return Plugin.TYPE_PORTLET;
295 }
296
297 /**
298 * Get the package to which the portlet belongs to.
299 *
300 * @return the plugin package of the portlet
301 */
302 public PluginPackage getPluginPackage() {
303 return _pluginPackage;
304 }
305
306 /**
307 * Sets the plugin package this portlet belongs to.
308 *
309 * @param pluginPackage the plugin package
310 */
311 public void setPluginPackage(PluginPackage pluginPackage) {
312 _pluginPackage = pluginPackage;
313 }
314
315 /**
316 * Get the default plugin settings of the portlet.
317 *
318 * @return the plugin settings
319 */
320 public PluginSetting getDefaultPluginSetting() {
321 return _defaultPluginSetting;
322 }
323
324 /**
325 * Sets the default plugin settings of the portlet.
326 *
327 * @param pluginSetting the plugin setting
328 */
329 public void setDefaultPluginSetting(PluginSetting pluginSetting) {
330 _defaultPluginSetting = pluginSetting;
331 }
332
333 /**
334 * Gets the timestamp of the portlet.
335 *
336 * @return the timestamp of the portlet
337 */
338 public long getTimestamp() {
339 return _timestamp;
340 }
341
342 /**
343 * Sets the timestamp of the portlet.
344 *
345 * @param timestamp the timestamp of the portlet
346 */
347 public void setTimestamp(long timestamp) {
348 _timestamp = timestamp;
349 }
350
351 /**
352 * Gets the icon of the portlet.
353 *
354 * @return the icon of the portlet
355 */
356 public String getIcon() {
357 return _icon;
358 }
359
360 /**
361 * Sets the icon of the portlet.
362 *
363 * @param icon the icon of the portlet
364 */
365 public void setIcon(String icon) {
366 _icon = icon;
367 }
368
369 /**
370 * Gets the virtual path of the portlet.
371 *
372 * @return the virtual path of the portlet
373 */
374 public String getVirtualPath() {
375 return _virtualPath;
376 }
377
378 /**
379 * Sets the virtual path of the portlet.
380 *
381 * @param virtualPath the virtual path of the portlet
382 */
383 public void setVirtualPath(String virtualPath) {
384 if (_portletApp.isWARFile() && Validator.isNull(virtualPath)) {
385 virtualPath = PropsValues.PORTLET_VIRTUAL_PATH;
386 }
387
388 _virtualPath = virtualPath;
389 }
390
391 /**
392 * Gets the struts path of the portlet.
393 *
394 * @return the struts path of the portlet
395 */
396 public String getStrutsPath() {
397 return _strutsPath;
398 }
399
400 /**
401 * Sets the struts path of the portlet.
402 *
403 * @param strutsPath the struts path of the portlet
404 */
405 public void setStrutsPath(String strutsPath) {
406 _strutsPath = strutsPath;
407 }
408
409 /**
410 * Gets the name of the portlet.
411 *
412 * @return the display name of the portlet
413 */
414 public String getPortletName() {
415 return _portletName;
416 }
417
418 /**
419 * Sets the name of the portlet.
420 *
421 * @param portletName the name of the portlet
422 */
423 public void setPortletName(String portletName) {
424 _portletName = portletName;
425 }
426
427 /**
428 * Gets the display name of the portlet.
429 *
430 * @return the display name of the portlet
431 */
432 public String getDisplayName() {
433 return _displayName;
434 }
435
436 /**
437 * Sets the display name of the portlet.
438 *
439 * @param displayName the display name of the portlet
440 */
441 public void setDisplayName(String displayName) {
442 _displayName = displayName;
443 }
444
445 /**
446 * Gets the name of the portlet class of the portlet.
447 *
448 * @return the name of the portlet class of the portlet
449 */
450 public String getPortletClass() {
451 return _portletClass;
452 }
453
454 /**
455 * Sets the name of the portlet class of the portlet.
456 *
457 * @param portletClass the name of the portlet class of the portlet
458 */
459 public void setPortletClass(String portletClass) {
460 _portletClass = portletClass;
461 }
462
463 /**
464 * Gets the configuration action class of the portlet.
465 *
466 * @return the configuration action class of the portlet
467 */
468 public String getConfigurationActionClass() {
469 return _configurationActionClass;
470 }
471
472 /**
473 * Sets the configuration action class of the portlet.
474 *
475 * @param configurationActionClass the configuration action class of the
476 * portlet
477 */
478 public void setConfigurationActionClass(String configurationActionClass) {
479 _configurationActionClass = configurationActionClass;
480 }
481
482 /**
483 * Gets the configuration action instance of the portlet.
484 *
485 * @return the configuration action instance of the portlet
486 */
487 public ConfigurationAction getConfigurationActionInstance() {
488 if (Validator.isNull(getConfigurationActionClass())) {
489 return null;
490 }
491
492 if (_portletApp.isWARFile()) {
493 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
494
495 return portletBag.getConfigurationActionInstance();
496 }
497
498 return (ConfigurationAction)InstancePool.get(
499 getConfigurationActionClass());
500 }
501
502 /**
503 * Gets the name of the indexer class of the portlet.
504 *
505 * @return the name of the indexer class of the portlet
506 */
507 public String getIndexerClass() {
508 return _indexerClass;
509 }
510
511 /**
512 * Sets the name of the indexer class of the portlet.
513 *
514 * @param indexerClass the name of the indexer class of the portlet
515 */
516 public void setIndexerClass(String indexerClass) {
517 _indexerClass = indexerClass;
518 }
519
520 /**
521 * Gets the indexer instance of the portlet.
522 *
523 * @return the indexer instance of the portlet
524 */
525 public Indexer getIndexerInstance() {
526 if (Validator.isNull(getIndexerClass())) {
527 return null;
528 }
529
530 if (_portletApp.isWARFile()) {
531 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
532
533 return portletBag.getIndexerInstance();
534 }
535
536 return (Indexer)InstancePool.get(getIndexerClass());
537 }
538
539 /**
540 * Gets the name of the open search class of the portlet.
541 *
542 * @return the name of the open search class of the portlet
543 */
544 public String getOpenSearchClass() {
545 return _openSearchClass;
546 }
547
548 /**
549 * Sets the name of the open search class of the portlet.
550 *
551 * @param openSearchClass the name of the open search class of the portlet
552 */
553 public void setOpenSearchClass(String openSearchClass) {
554 _openSearchClass = openSearchClass;
555 }
556
557 /**
558 * Gets the indexer instance of the portlet.
559 *
560 * @return the indexer instance of the portlet
561 */
562 public OpenSearch getOpenSearchInstance() {
563 if (Validator.isNull(getOpenSearchClass())) {
564 return null;
565 }
566
567 if (_portletApp.isWARFile()) {
568 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
569
570 return portletBag.getOpenSearchInstance();
571 }
572
573 return (OpenSearch)InstancePool.get(getOpenSearchClass());
574 }
575
576 /**
577 * Adds a scheduler entry.
578 */
579 public void addSchedulerEntry(SchedulerEntry schedulerEntry) {
580 _schedulerEntries.add(schedulerEntry);
581 }
582
583 /**
584 * Gets the scheduler entries of the portlet.
585 *
586 * @return the scheduler entries of the portlet
587 */
588 public List<SchedulerEntry> getSchedulerEntries() {
589 return _schedulerEntries;
590 }
591
592 /**
593 * Sets the scheduler entries of the portlet.
594 *
595 * @param schedulerEntries the scheduler entries of the portlet
596 */
597 public void setSchedulerEntries(List<SchedulerEntry> schedulerEntries) {
598 for (SchedulerEntry schedulerEntry : schedulerEntries) {
599 addSchedulerEntry(schedulerEntry);
600 }
601 }
602
603 /**
604 * Gets the name of the portlet URL class of the portlet.
605 *
606 * @return the name of the portlet URL class of the portlet
607 */
608 public String getPortletURLClass() {
609 return _portletURLClass;
610 }
611
612 /**
613 * Sets the name of the portlet URL class of the portlet.
614 *
615 * @param portletURLClass the name of the portlet URL class of the portlet
616 */
617 public void setPortletURLClass(String portletURLClass) {
618 _portletURLClass = portletURLClass;
619 }
620
621 /**
622 * Gets the name of the friendly URL mapper class of the portlet.
623 *
624 * @return the name of the friendly URL mapper class of the portlet
625 */
626 public String getFriendlyURLMapperClass() {
627 return _friendlyURLMapperClass;
628 }
629
630 /**
631 * Sets the name of the friendly URL mapper class of the portlet.
632 *
633 * @param friendlyURLMapperClass the name of the friendly URL plugin class
634 * of the portlet
635 */
636 public void setFriendlyURLMapperClass(String friendlyURLMapperClass) {
637 _friendlyURLMapperClass = friendlyURLMapperClass;
638 }
639
640 /**
641 * Gets the friendly URL mapper instance of the portlet.
642 *
643 * @return the friendly URL mapper instance of the portlet
644 */
645 public FriendlyURLMapper getFriendlyURLMapperInstance() {
646 if (Validator.isNull(getFriendlyURLMapperClass())) {
647 return null;
648 }
649
650 if (_portletApp.isWARFile()) {
651 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
652
653 return portletBag.getFriendlyURLMapperInstance();
654 }
655
656 return (FriendlyURLMapper)InstancePool.get(getFriendlyURLMapperClass());
657 }
658
659 /**
660 * Gets the name of the URL encoder class of the portlet.
661 *
662 * @return the name of the URL encoder class of the portlet
663 */
664 public String getURLEncoderClass() {
665 return _urlEncoderClass;
666 }
667
668 /**
669 * Sets the name of the URL encoder class of the portlet.
670 *
671 * @param urlEncoderClass the name of the URL encoder class of the portlet
672 */
673 public void setURLEncoderClass(String urlEncoderClass) {
674 _urlEncoderClass = urlEncoderClass;
675 }
676
677 /**
678 * Gets the URL encoder instance of the portlet.
679 *
680 * @return the URL encoder instance of the portlet
681 */
682 public URLEncoder getURLEncoderInstance() {
683 if (Validator.isNull(getURLEncoderClass())) {
684 return null;
685 }
686
687 if (_portletApp.isWARFile()) {
688 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
689
690 return portletBag.getURLEncoderInstance();
691 }
692
693 return (URLEncoder)InstancePool.get(getURLEncoderClass());
694 }
695
696 /**
697 * Gets the name of the portlet data handler class of the portlet.
698 *
699 * @return the name of the portlet data handler class of the portlet
700 */
701 public String getPortletDataHandlerClass() {
702 return _portletDataHandlerClass;
703 }
704
705 /**
706 * Sets the name of the portlet data handler class of the portlet.
707 *
708 * @param portletDataHandlerClass the name of portlet data handler class of
709 * the portlet
710 */
711 public void setPortletDataHandlerClass(String portletDataHandlerClass) {
712 _portletDataHandlerClass = portletDataHandlerClass;
713 }
714
715 /**
716 * Gets the portlet data handler instance of the portlet.
717 *
718 * @return the portlet data handler instance of the portlet
719 */
720 public PortletDataHandler getPortletDataHandlerInstance() {
721 if (Validator.isNull(getPortletDataHandlerClass())) {
722 return null;
723 }
724
725 if (_portletApp.isWARFile()) {
726 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
727 getRootPortletId());
728
729 return portletBagImpl.getPortletDataHandlerInstance();
730 }
731
732 return (PortletDataHandler)InstancePool.get(
733 getPortletDataHandlerClass());
734 }
735
736 /**
737 * Gets the portlet layout listener of the portlet.
738 *
739 * @return the name of the portlet layout listener class of the portlet
740 */
741 public PortletLayoutListener getPortletLayoutListener() {
742 if (Validator.isNull(getPortletLayoutListenerClass())) {
743 return null;
744 }
745
746 return (PortletLayoutListener)InstancePool.get(
747 getPortletLayoutListenerClass());
748 }
749
750 /**
751 * Gets the name of the portlet layout listener class of the portlet.
752 *
753 * @return the name of the portlet layout listener class of the portlet
754 */
755 public String getPortletLayoutListenerClass() {
756 return _portletLayoutListenerClass;
757 }
758
759 /**
760 * Sets the name of the portlet layout listener class of the portlet.
761 *
762 * @param portletLayoutListenerClass the name of the portlet layout listener
763 * class of the portlet
764 */
765 public void setPortletLayoutListenerClass(
766 String portletLayoutListenerClass) {
767
768 _portletLayoutListenerClass = portletLayoutListenerClass;
769 }
770
771 /**
772 * Gets the portlet layout listener instance of the portlet.
773 *
774 * @return the portlet layout listener instance of the portlet
775 */
776 public PortletLayoutListener getPortletLayoutListenerInstance() {
777 if (Validator.isNull(getPortletLayoutListenerClass())) {
778 return null;
779 }
780
781 if (_portletApp.isWARFile()) {
782 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
783
784 return portletBag.getPortletLayoutListenerInstance();
785 }
786
787 return (PortletLayoutListener)InstancePool.get(
788 getPortletLayoutListenerClass());
789 }
790
791 /**
792 * Gets the name of the poller processor class of the portlet.
793 *
794 * @return the name of the poller processor class of the portlet
795 */
796 public String getPollerProcessorClass() {
797 return _pollerProcessorClass;
798 }
799
800 /**
801 * Sets the name of the poller processor class of the portlet.
802 *
803 * @param pollerProcessorClass the name of the poller processor class of the
804 * portlet
805 */
806 public void setPollerProcessorClass(String pollerProcessorClass) {
807 _pollerProcessorClass = pollerProcessorClass;
808 }
809
810 /**
811 * Gets the poller processor instance of the portlet.
812 *
813 * @return the poller processor instance of the portlet
814 */
815 public PollerProcessor getPollerProcessorInstance() {
816 if (Validator.isNull(getPollerProcessorClass())) {
817 return null;
818 }
819
820 if (_portletApp.isWARFile()) {
821 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
822
823 return portletBag.getPollerProcessorInstance();
824 }
825
826 return (PollerProcessor)InstancePool.get(getPollerProcessorClass());
827 }
828
829 /**
830 * Gets the name of the POP message listener class of the portlet.
831 *
832 * @return the name of the POP message listener class of the portlet
833 */
834 public String getPopMessageListenerClass() {
835 return _popMessageListenerClass;
836 }
837
838 /**
839 * Sets the name of the POP message listener class of the portlet.
840 *
841 * @param popMessageListenerClass the name of the POP message listener class
842 * of the portlet
843 */
844 public void setPopMessageListenerClass(String popMessageListenerClass) {
845 _popMessageListenerClass = popMessageListenerClass;
846 }
847
848 /**
849 * Gets the POP message listener instance of the portlet.
850 *
851 * @return the POP message listener instance of the portlet
852 */
853 public MessageListener getPopMessageListenerInstance() {
854 if (Validator.isNull(getPopMessageListenerClass())) {
855 return null;
856 }
857
858 if (_portletApp.isWARFile()) {
859 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
860
861 return portletBag.getPopMessageListenerInstance();
862 }
863
864 return (MessageListener)InstancePool.get(getPopMessageListenerClass());
865 }
866
867 /**
868 * Gets the name of the social activity interpreter class of the portlet.
869 *
870 * @return the name of the social activity interpreter class of the portlet
871 */
872 public String getSocialActivityInterpreterClass() {
873 return _socialActivityInterpreterClass;
874 }
875
876 /**
877 * Sets the name of the social activity interpreter class of the portlet.
878 *
879 * @param socialActivityInterpreterClass the name of the activity
880 * interpreter class of the portlet
881 */
882 public void setSocialActivityInterpreterClass(
883 String socialActivityInterpreterClass) {
884
885 _socialActivityInterpreterClass = socialActivityInterpreterClass;
886 }
887
888 /**
889 * Gets the name of the social activity interpreter instance of the portlet.
890 *
891 * @return the name of the social activity interpreter instance of the
892 * portlet
893 */
894 public SocialActivityInterpreter getSocialActivityInterpreterInstance() {
895 if (Validator.isNull(getSocialActivityInterpreterClass())) {
896 return null;
897 }
898
899 if (_portletApp.isWARFile()) {
900 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
901 getRootPortletId());
902
903 return portletBagImpl.getSocialActivityInterpreterInstance();
904 }
905
906 return (SocialActivityInterpreter)InstancePool.get(
907 getSocialActivityInterpreterClass());
908 }
909
910 /**
911 * Gets the name of the social request interpreter class of the portlet.
912 *
913 * @return the name of the social request interpreter class of the portlet
914 */
915 public String getSocialRequestInterpreterClass() {
916 return _socialRequestInterpreterClass;
917 }
918
919 /**
920 * Sets the name of the social request interpreter class of the portlet.
921 *
922 * @param socialRequestInterpreterClass the name of the request interpreter
923 * class of the portlet
924 */
925 public void setSocialRequestInterpreterClass(
926 String socialRequestInterpreterClass) {
927
928 _socialRequestInterpreterClass = socialRequestInterpreterClass;
929 }
930
931 /**
932 * Gets the name of the social request interpreter instance of the portlet.
933 *
934 * @return the name of the social request interpreter instance of the
935 * portlet
936 */
937 public SocialRequestInterpreter getSocialRequestInterpreterInstance() {
938 if (Validator.isNull(getSocialRequestInterpreterClass())) {
939 return null;
940 }
941
942 if (_portletApp.isWARFile()) {
943 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
944 getRootPortletId());
945
946 return portletBagImpl.getSocialRequestInterpreterInstance();
947 }
948
949 return (SocialRequestInterpreter)InstancePool.get(
950 getSocialRequestInterpreterClass());
951 }
952
953 /**
954 * Gets the name of the WebDAV storage token of the portlet.
955 *
956 * @return the name of the WebDAV storage token of the portlet
957 */
958 public String getWebDAVStorageToken() {
959 return _webDAVStorageToken;
960 }
961
962 /**
963 * Sets the name of the WebDAV storage token of the portlet.
964 *
965 * @param webDAVStorageToken the name of the WebDAV storage token of the
966 * portlet
967 */
968 public void setWebDAVStorageToken(String webDAVStorageToken) {
969 _webDAVStorageToken = webDAVStorageToken;
970 }
971
972 /**
973 * Gets the name of the WebDAV storage class of the portlet.
974 *
975 * @return the name of the WebDAV storage class of the portlet
976 */
977 public String getWebDAVStorageClass() {
978 return _webDAVStorageClass;
979 }
980
981 /**
982 * Sets the name of the WebDAV storage class of the portlet.
983 *
984 * @param webDAVStorageClass the name of the WebDAV storage class of the
985 * portlet
986 */
987 public void setWebDAVStorageClass(String webDAVStorageClass) {
988 _webDAVStorageClass = webDAVStorageClass;
989 }
990
991 /**
992 * Gets the name of the WebDAV storage instance of the portlet.
993 *
994 * @return the name of the WebDAV storage instance of the portlet
995 */
996 public WebDAVStorage getWebDAVStorageInstance() {
997 if (Validator.isNull(getWebDAVStorageClass())) {
998 return null;
999 }
1000
1001 if (_portletApp.isWARFile()) {
1002 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
1003 getRootPortletId());
1004
1005 return portletBagImpl.getWebDAVStorageInstance();
1006 }
1007
1008 return (WebDAVStorage)InstancePool.get(
1009 getWebDAVStorageClass());
1010 }
1011
1012 /**
1013 * Gets the name of the XML-RPC method class of the portlet.
1014 *
1015 * @return the name of the XML-RPC method class of the portlet
1016 */
1017 public String getXmlRpcMethodClass() {
1018 return _xmlRpcMethodClass;
1019 }
1020
1021 /**
1022 * Sets the name of the XML-RPC method class of the portlet.
1023 *
1024 * @param xmlRpcMethodClass the name of the XML-RPC method class of the
1025 * portlet
1026 */
1027 public void setXmlRpcMethodClass(String xmlRpcMethodClass) {
1028 _xmlRpcMethodClass = xmlRpcMethodClass;
1029 }
1030
1031 /**
1032 * Gets the name of the XML-RPC method instance of the portlet.
1033 *
1034 * @return the name of the XML-RPC method instance of the portlet
1035 */
1036 public Method getXmlRpcMethodInstance() {
1037 if (Validator.isNull(getXmlRpcMethodClass())) {
1038 return null;
1039 }
1040
1041 if (_portletApp.isWARFile()) {
1042 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
1043 getRootPortletId());
1044
1045 return portletBagImpl.getXmlRpcMethodInstance();
1046 }
1047
1048 return (Method)InstancePool.get(getXmlRpcMethodClass());
1049 }
1050
1051 /**
1052 * Gets the name of the category of the Control Panel where the portlet will
1053 * be shown.
1054 *
1055 * @return the name of of the category of the Control Panel where the
1056 * portlet will be shown
1057 */
1058 public String getControlPanelEntryCategory() {
1059 return _controlPanelEntryCategory;
1060 }
1061
1062 /**
1063 * Set the name of the category of the Control Panel where the portlet will
1064 * be shown.
1065 *
1066 * @param controlPanelEntryCategory the name of the category of the Control
1067 * Panel where the portlet will be shown
1068 */
1069 public void setControlPanelEntryCategory(String controlPanelEntryCategory) {
1070 _controlPanelEntryCategory = controlPanelEntryCategory;
1071 }
1072
1073 /**
1074 * Gets the relative weight of the portlet with respect to the other
1075 * portlets in the same category of the Control Panel.
1076 *
1077 * @return the relative weight of the portlet with respect to the other
1078 * portlets in the same category of the Control Panel
1079 */
1080 public double getControlPanelEntryWeight() {
1081 return _controlPanelEntryWeight;
1082 }
1083
1084 /**
1085 * Sets the relative weight of the portlet with respect to the other
1086 * portlets in the same category of the Control Panel.
1087 *
1088 * @param controlPanelEntryWeight the relative weight of the portlet with
1089 * respect to the other portlets in the same category of the Control
1090 * Panel
1091 */
1092 public void setControlPanelEntryWeight(double controlPanelEntryWeight) {
1093 _controlPanelEntryWeight = controlPanelEntryWeight;
1094 }
1095
1096 /**
1097 * Gets the name of the class that will control when the portlet will be
1098 * shown in the Control Panel.
1099 *
1100 * @return the name of the class that will control when the portlet will be
1101 * shown in the Control Panel
1102 */
1103 public String getControlPanelEntryClass() {
1104 return _controlPanelEntryClass;
1105 }
1106
1107 /**
1108 * Sets the name of the class that will control when the portlet will be
1109 * shown in the Control Panel.
1110 *
1111 * @param controlPanelEntryClass the name of the class that will control
1112 * when the portlet will be shown in the Control Panel
1113 */
1114 public void setControlPanelEntryClass(String controlPanelEntryClass) {
1115 _controlPanelEntryClass = controlPanelEntryClass;
1116 }
1117
1118 /**
1119 * Gets an instance of the class that will control when the portlet will be
1120 * shown in the Control Panel.
1121 *
1122 * @return the instance of the class that will control when the portlet will
1123 * be shown in the Control Panel
1124 */
1125 public ControlPanelEntry getControlPanelEntryInstance() {
1126 if (Validator.isNull(getControlPanelEntryClass())) {
1127 return null;
1128 }
1129
1130 if (_portletApp.isWARFile()) {
1131 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
1132 getRootPortletId());
1133
1134 return portletBagImpl.getControlPanelEntryInstance();
1135 }
1136
1137 return (ControlPanelEntry)InstancePool.get(getControlPanelEntryClass());
1138 }
1139
1140 /**
1141 * Gets the names of the classes that represent asset types associated to
1142 * the portlet.
1143 *
1144 * @return the names of the classes that represent asset types associated to
1145 * the portlet
1146 */
1147 public List<String> getAssetRendererFactoryClasses() {
1148 return _assetRendererFactoryClasses;
1149 }
1150
1151 /**
1152 * Sets the name of the classes that represent asset types associated to the
1153 * portlet.
1154 *
1155 * @param assetRendererFactoryClasses the names of the classes that
1156 * represent asset types associated to the portlet
1157 */
1158 public void setAssetRendererFactoryClasses(
1159 List<String> assetRendererFactoryClasses) {
1160
1161 _assetRendererFactoryClasses = assetRendererFactoryClasses;
1162 }
1163
1164 /**
1165 * Gets the asset type instances of the portlet.
1166 *
1167 * @return the asset type instances of the portlet
1168 */
1169 public List<AssetRendererFactory> getAssetRendererFactoryInstances() {
1170 if (getAssetRendererFactoryClasses().isEmpty()) {
1171 return null;
1172 }
1173
1174 if (_portletApp.isWARFile()) {
1175 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
1176 getRootPortletId());
1177
1178 return portletBagImpl.getAssetRendererFactoryInstances();
1179 }
1180
1181 List<AssetRendererFactory> assetRendererFactoryInstances =
1182 new ArrayList<AssetRendererFactory>();
1183
1184 for (String assetRendererFactoryClass :
1185 getAssetRendererFactoryClasses()) {
1186
1187 AssetRendererFactory assetRendererFactoryInstance =
1188 (AssetRendererFactory)InstancePool.get(
1189 assetRendererFactoryClass);
1190
1191 assetRendererFactoryInstance.setClassNameId(
1192 PortalUtil.getClassNameId(
1193 assetRendererFactoryInstance.getClassName()));
1194 assetRendererFactoryInstance.setPortletId(getPortletId());
1195
1196 assetRendererFactoryInstances.add(assetRendererFactoryInstance);
1197 }
1198
1199 return assetRendererFactoryInstances;
1200 }
1201
1202 /**
1203 * Gets the names of the classes that represent custom attribute displays
1204 * associated to the portlet.
1205 *
1206 * @return the names of the classes that represent asset types associated to
1207 * the portlet
1208 */
1209 public List<String> getCustomAttributesDisplayClasses() {
1210 return _customAttributesDisplayClasses;
1211 }
1212
1213 /**
1214 * Sets the name of the classes that represent custom attribute displays
1215 * associated to the portlet.
1216 *
1217 * @param customAttributesDisplayClasses the names of the classes that
1218 * represent custom attribute displays associated to the portlet
1219 */
1220 public void setCustomAttributesDisplayClasses(
1221 List<String> customAttributesDisplayClasses) {
1222
1223 _customAttributesDisplayClasses = customAttributesDisplayClasses;
1224 }
1225
1226 /**
1227 * Gets the custom attribute display instances of the portlet.
1228 *
1229 * @return the custom attribute display instances of the portlet
1230 */
1231 public List<CustomAttributesDisplay> getCustomAttributesDisplayInstances() {
1232 if (getCustomAttributesDisplayClasses().isEmpty()) {
1233 return null;
1234 }
1235
1236 if (_portletApp.isWARFile()) {
1237 PortletBagImpl portletBagImpl = (PortletBagImpl)PortletBagPool.get(
1238 getRootPortletId());
1239
1240 return portletBagImpl.getCustomAttributesDisplayInstances();
1241 }
1242
1243 List<CustomAttributesDisplay> customAttributesDisplayInstances =
1244 new ArrayList<CustomAttributesDisplay>();
1245
1246 for (String customAttributesDisplayClass :
1247 getCustomAttributesDisplayClasses()) {
1248
1249 CustomAttributesDisplay customAttributesDisplayInstance =
1250 (CustomAttributesDisplay)InstancePool.get(
1251 customAttributesDisplayClass);
1252
1253 customAttributesDisplayInstance.setClassNameId(
1254 PortalUtil.getClassNameId(
1255 customAttributesDisplayInstance.getClassName()));
1256 customAttributesDisplayInstance.setPortletId(getPortletId());
1257
1258 customAttributesDisplayInstances.add(
1259 customAttributesDisplayInstance);
1260 }
1261
1262 return customAttributesDisplayInstances;
1263 }
1264
1265 /**
1266 * Gets the names of the classes that represent workflow handlers associated
1267 * to the portlet.
1268 *
1269 * @return the names of the classes that represent workflow handlers
1270 * associated to the portlet
1271 */
1272 public List<String> getWorkflowHandlerClasses() {
1273 return _workflowHandlerClasses;
1274 }
1275
1276 /**
1277 * Sets the name of the classes that represent workflow handlers associated
1278 * to the portlet.
1279 *
1280 * @param workflowHandlerClasses the names of the classes that represent
1281 * workflow handlers associated to the portlet
1282 */
1283 public void setWorkflowHandlerClasses(List<String> workflowHandlerClasses) {
1284 _workflowHandlerClasses = workflowHandlerClasses;
1285 }
1286
1287 /**
1288 * Gets the workflow handler instances of the portlet.
1289 *
1290 * @return the workflow handler instances of the portlet
1291 */
1292 public List<WorkflowHandler> getWorkflowHandlerInstances() {
1293 if (getWorkflowHandlerClasses().isEmpty()) {
1294 return null;
1295 }
1296
1297 if (_portletApp.isWARFile()) {
1298 PortletBag portletBag = PortletBagPool.get(getRootPortletId());
1299
1300 return portletBag.getWorkflowHandlerInstances();
1301 }
1302
1303 List<WorkflowHandler> workflowHandlerInstances =
1304 new ArrayList<WorkflowHandler>();
1305
1306 for (String workflowHandlerClass : getWorkflowHandlerClasses()) {
1307 WorkflowHandler workflowHandlerInstance =
1308 (WorkflowHandler)InstancePool.get(workflowHandlerClass);
1309
1310 workflowHandlerInstances.add(workflowHandlerInstance);
1311 }
1312
1313 return workflowHandlerInstances;
1314 }
1315
1316 /**
1317 * Gets the default preferences of the portlet.
1318 *
1319 * @return the default preferences of the portlet
1320 */
1321 public String getDefaultPreferences() {
1322 if (Validator.isNull(_defaultPreferences)) {
1323 return PortletConstants.DEFAULT_PREFERENCES;
1324 }
1325 else {
1326 return _defaultPreferences;
1327 }
1328 }
1329
1330 /**
1331 * Sets the default preferences of the portlet.
1332 *
1333 * @param defaultPreferences the default preferences of the portlet
1334 */
1335 public void setDefaultPreferences(String defaultPreferences) {
1336 _defaultPreferences = defaultPreferences;
1337 }
1338
1339 /**
1340 * Gets the name of the preferences validator class of the portlet.
1341 *
1342 * @return the name of the preferences validator class of the portlet
1343 */
1344 public String getPreferencesValidator() {
1345 return _preferencesValidator;
1346 }
1347
1348 /**
1349 * Sets the name of the preferences validator class of the portlet.
1350 *
1351 * @param preferencesValidator the name of the preferences validator class
1352 * of the portlet
1353 */
1354 public void setPreferencesValidator(String preferencesValidator) {
1355 if (preferencesValidator != null) {
1356
1357 // Trim this because XDoclet generates preferences validators with
1358 // extra white spaces
1359
1360 _preferencesValidator = preferencesValidator.trim();
1361 }
1362 else {
1363 _preferencesValidator = null;
1364 }
1365 }
1366
1367 /**
1368 * Returns true if preferences are shared across the entire company.
1369 *
1370 * @return true if preferences are shared across the entire company
1371 */
1372 public boolean getPreferencesCompanyWide() {
1373 return _preferencesCompanyWide;
1374 }
1375
1376 /**
1377 * Returns true if preferences are shared across the entire company.
1378 *
1379 * @return true if preferences are shared across the entire company
1380 */
1381 public boolean isPreferencesCompanyWide() {
1382 return _preferencesCompanyWide;
1383 }
1384
1385 /**
1386 * Set to true if preferences are shared across the entire company.
1387 *
1388 * @param preferencesCompanyWide boolean value for whether preferences are
1389 * shared across the entire company
1390 */
1391 public void setPreferencesCompanyWide(boolean preferencesCompanyWide) {
1392 _preferencesCompanyWide = preferencesCompanyWide;
1393 }
1394
1395 /**
1396 * Returns true if preferences are unique per layout.
1397 *
1398 * @return true if preferences are unique per layout
1399 */
1400 public boolean getPreferencesUniquePerLayout() {
1401 return _preferencesUniquePerLayout;
1402 }
1403
1404 /**
1405 * Returns true if preferences are unique per layout.
1406 *
1407 * @return true if preferences are unique per layout
1408 */
1409 public boolean isPreferencesUniquePerLayout() {
1410 return _preferencesUniquePerLayout;
1411 }
1412
1413 /**
1414 * Set to true if preferences are unique per layout.
1415 *
1416 * @param preferencesUniquePerLayout boolean value for whether preferences
1417 * are unique per layout
1418 */
1419 public void setPreferencesUniquePerLayout(
1420 boolean preferencesUniquePerLayout) {
1421
1422 _preferencesUniquePerLayout = preferencesUniquePerLayout;
1423 }
1424
1425 /**
1426 * Returns true if preferences are owned by the group when the portlet is
1427 * shown in a group layout. Returns false if preferences are owned by the
1428 * user at all times.
1429 *
1430 * @return true if preferences are owned by the group when the portlet is
1431 * shown in a group layout; false if preferences are owned by the
1432 * user at all times.
1433 */
1434 public boolean getPreferencesOwnedByGroup() {
1435 return _preferencesOwnedByGroup;
1436 }
1437
1438 /**
1439 * Returns true if preferences are owned by the group when the portlet is
1440 * shown in a group layout. Returns false if preferences are owned by the
1441 * user at all times.
1442 *
1443 * @return true if preferences are owned by the group when the portlet is
1444 * shown in a group layout; false if preferences are owned by the
1445 * user at all times.
1446 */
1447 public boolean isPreferencesOwnedByGroup() {
1448 return _preferencesOwnedByGroup;
1449 }
1450
1451 /**
1452 * Set to true if preferences are owned by the group when the portlet is
1453 * shown in a group layout. Set to false if preferences are owned by the
1454 * user at all times.
1455 *
1456 * @param preferencesOwnedByGroup boolean value for whether preferences are
1457 * owned by the group when the portlet is shown in a group layout or
1458 * preferences are owned by the user at all times
1459 */
1460 public void setPreferencesOwnedByGroup(boolean preferencesOwnedByGroup) {
1461 _preferencesOwnedByGroup = preferencesOwnedByGroup;
1462 }
1463
1464 /**
1465 * Returns true if the portlet uses the default template.
1466 *
1467 * @return true if the portlet uses the default template
1468 */
1469 public boolean getUseDefaultTemplate() {
1470 return _useDefaultTemplate;
1471 }
1472
1473 /**
1474 * Returns true if the portlet uses the default template.
1475 *
1476 * @return true if the portlet uses the default template
1477 */
1478 public boolean isUseDefaultTemplate() {
1479 return _useDefaultTemplate;
1480 }
1481
1482 /**
1483 * Set to true if the portlet uses the default template.
1484 *
1485 * @param useDefaultTemplate boolean value for whether the portlet uses the
1486 * default template
1487 */
1488 public void setUseDefaultTemplate(boolean useDefaultTemplate) {
1489 _useDefaultTemplate = useDefaultTemplate;
1490 }
1491
1492 /**
1493 * Returns true if users are shown that they do not have access to the
1494 * portlet.
1495 *
1496 * @return true if users are shown that they do not have access to the
1497 * portlet
1498 */
1499 public boolean getShowPortletAccessDenied() {
1500 return _showPortletAccessDenied;
1501 }
1502
1503 /**
1504 * Returns true if users are shown that they do not have access to the
1505 * portlet.
1506 *
1507 * @return true if users are shown that they do not have access to the
1508 * portlet
1509 */
1510 public boolean isShowPortletAccessDenied() {
1511 return _showPortletAccessDenied;
1512 }
1513
1514 /**
1515 * Set to true if users are shown that they do not have access to the
1516 * portlet.
1517 *
1518 * @param showPortletAccessDenied boolean value for whether users are shown
1519 * that they do not have access to the portlet
1520 */
1521 public void setShowPortletAccessDenied(boolean showPortletAccessDenied) {
1522 _showPortletAccessDenied = showPortletAccessDenied;
1523 }
1524
1525 /**
1526 * Returns true if users are shown that the portlet is inactive.
1527 *
1528 * @return true if users are shown that the portlet is inactive
1529 */
1530 public boolean getShowPortletInactive() {
1531 return _showPortletInactive;
1532 }
1533
1534 /**
1535 * Returns true if users are shown that the portlet is inactive.
1536 *
1537 * @return true if users are shown that the portlet is inactive
1538 */
1539 public boolean isShowPortletInactive() {
1540 return _showPortletInactive;
1541 }
1542
1543 /**
1544 * Set to true if users are shown that the portlet is inactive.
1545 *
1546 * @param showPortletInactive boolean value for whether users are shown that
1547 * the portlet is inactive
1548 */
1549 public void setShowPortletInactive(boolean showPortletInactive) {
1550 _showPortletInactive = showPortletInactive;
1551 }
1552
1553 /**
1554 * Returns true if an action URL for this portlet should cause an auto
1555 * redirect.
1556 *
1557 * @return true if an action URL for this portlet should cause an auto
1558 * redirect
1559 */
1560 public boolean getActionURLRedirect() {
1561 return _actionURLRedirect;
1562 }
1563
1564 /**
1565 * Returns true if an action URL for this portlet should cause an auto
1566 * redirect.
1567 *
1568 * @return true if an action URL for this portlet should cause an auto
1569 * redirect
1570 */
1571 public boolean isActionURLRedirect() {
1572 return _actionURLRedirect;
1573 }
1574
1575 /**
1576 * Set to true if an action URL for this portlet should cause an auto
1577 * redirect.
1578 *
1579 * @param actionURLRedirect boolean value for whether an action URL for this
1580 * portlet should cause an auto redirect
1581 */
1582 public void setActionURLRedirect(boolean actionURLRedirect) {
1583 _actionURLRedirect = actionURLRedirect;
1584 }
1585
1586 /**
1587 * Returns true if the portlet restores to the current view from the
1588 * maximized state.
1589 *
1590 * @return true if the portlet restores to the current view from the
1591 * maximized state
1592 */
1593 public boolean getRestoreCurrentView() {
1594 return _restoreCurrentView;
1595 }
1596
1597 /**
1598 * Returns true if the portlet restores to the current view from the
1599 * maximized state.
1600 *
1601 * @return true if the portlet restores to the current view from the
1602 * maximized state
1603 */
1604 public boolean isRestoreCurrentView() {
1605 return _restoreCurrentView;
1606 }
1607
1608 /**
1609 * Set to true if the portlet restores to the current view from the
1610 * maximized state.
1611 *
1612 * @param restoreCurrentView boolean value for whether the portlet restores
1613 * to the current view from the maximized state
1614 */
1615 public void setRestoreCurrentView(boolean restoreCurrentView) {
1616 _restoreCurrentView = restoreCurrentView;
1617 }
1618
1619 /**
1620 * Returns true if the portlet goes into the maximized state when the user
1621 * goes into the edit mode.
1622 *
1623 * @return true if the portlet goes into the maximized state when the user
1624 * goes into the edit mode
1625 */
1626 public boolean getMaximizeEdit() {
1627 return _maximizeEdit;
1628 }
1629
1630 /**
1631 * Returns true if the portlet goes into the maximized state when the user
1632 * goes into the edit mode.
1633 *
1634 * @return true if the portlet goes into the maximized state when the user
1635 * goes into the edit mode
1636 */
1637 public boolean isMaximizeEdit() {
1638 return _maximizeEdit;
1639 }
1640
1641 /**
1642 * Set to true if the portlet goes into the maximized state when the user
1643 * goes into the edit mode.
1644 *
1645 * @param maximizeEdit boolean value for whether the portlet goes into the
1646 * maximized state when the user goes into the edit mode
1647 */
1648 public void setMaximizeEdit(boolean maximizeEdit) {
1649 _maximizeEdit = maximizeEdit;
1650 }
1651
1652 /**
1653 * Returns true if the portlet goes into the maximized state when the user
1654 * goes into the help mode.
1655 *
1656 * @return true if the portlet goes into the maximized state when the user
1657 * goes into the help mode
1658 */
1659 public boolean getMaximizeHelp() {
1660 return _maximizeHelp;
1661 }
1662
1663 /**
1664 * Returns true if the portlet goes into the maximized state when the user
1665 * goes into the help mode.
1666 *
1667 * @return true if the portlet goes into the maximized state when the user
1668 * goes into the help mode
1669 */
1670 public boolean isMaximizeHelp() {
1671 return _maximizeHelp;
1672 }
1673
1674 /**
1675 * Set to true if the portlet goes into the maximized state when the user
1676 * goes into the help mode.
1677 *
1678 * @param maximizeHelp boolean value for whether the portlet goes into the
1679 * maximized state when the user goes into the help mode
1680 */
1681 public void setMaximizeHelp(boolean maximizeHelp) {
1682 _maximizeHelp = maximizeHelp;
1683 }
1684
1685 /**
1686 * Returns true if the portlet goes into the pop up state when the user goes
1687 * into the print mode.
1688 *
1689 * @return true if the portlet goes into the pop up state when the user goes
1690 * into the print mode
1691 */
1692 public boolean getPopUpPrint() {
1693 return _popUpPrint;
1694 }
1695
1696 /**
1697 * Returns true if the portlet goes into the pop up state when the user goes
1698 * into the print mode.
1699 *
1700 * @return true if the portlet goes into the pop up state when the user goes
1701 * into the print mode
1702 */
1703 public boolean isPopUpPrint() {
1704 return _popUpPrint;
1705 }
1706
1707 /**
1708 * Set to true if the portlet goes into the pop up state when the user goes
1709 * into the print mode.
1710 *
1711 * @param popUpPrint boolean value for whether the portlet goes into the pop
1712 * up state when the user goes into the print mode
1713 */
1714 public void setPopUpPrint(boolean popUpPrint) {
1715 _popUpPrint = popUpPrint;
1716 }
1717
1718 /**
1719 * Returns true to allow the portlet to be cached within the layout.
1720 *
1721 * @return true if the portlet can be cached within the layout
1722 */
1723 public boolean getLayoutCacheable() {
1724 return _layoutCacheable;
1725 }
1726
1727 /**
1728 * Returns true to allow the portlet to be cached within the layout.
1729 *
1730 * @return true if the portlet can be cached within the layout
1731 */
1732 public boolean isLayoutCacheable() {
1733 return _layoutCacheable;
1734 }
1735
1736 /**
1737 * Set to true to allow the portlet to be cached within the layout.
1738 *
1739 * @param layoutCacheable boolean value for whether the portlet can be
1740 * cached within the layout
1741 */
1742 public void setLayoutCacheable(boolean layoutCacheable) {
1743 _layoutCacheable = layoutCacheable;
1744 }
1745
1746 /**
1747 * Returns true if the portlet can be added multiple times to a layout.
1748 *
1749 * @return true if the portlet can be added multiple times to a layout
1750 */
1751 public boolean getInstanceable() {
1752 return _instanceable;
1753 }
1754
1755 /**
1756 * Returns true if the portlet can be added multiple times to a layout.
1757 *
1758 * @return true if the portlet can be added multiple times to a layout
1759 */
1760 public boolean isInstanceable() {
1761 return _instanceable;
1762 }
1763
1764 /**
1765 * Set to true if the portlet can be added multiple times to a layout.
1766 *
1767 * @param instanceable boolean value for whether the portlet can be added
1768 * multiple times to a layout
1769 */
1770 public void setInstanceable(boolean instanceable) {
1771 _instanceable = instanceable;
1772 }
1773
1774 /**
1775 * Returns true if the portlet supports scoping of data.
1776 *
1777 * @return true if the portlet supports scoping of data
1778 */
1779 public boolean getScopeable() {
1780 return _scopeable;
1781 }
1782
1783 /**
1784 * Returns true if the portlet supports scoping of data.
1785 *
1786 * @return true if the portlet supports scoping of data
1787 */
1788 public boolean isScopeable() {
1789 return _scopeable;
1790 }
1791
1792 /**
1793 * Set to true if the portlet supports scoping of data.
1794 *
1795 * @param scopeable boolean value for whether or not the the portlet
1796 * supports scoping of data
1797 */
1798 public void setScopeable(boolean scopeable) {
1799 _scopeable = scopeable;
1800 }
1801
1802 /**
1803 * Gets the user principal strategy of the portlet.
1804 *
1805 * @return the user principal strategy of the portlet
1806 */
1807 public String getUserPrincipalStrategy() {
1808 return _userPrincipalStrategy;
1809 }
1810
1811 /**
1812 * Sets the user principal strategy of the portlet.
1813 *
1814 * @param userPrincipalStrategy the user principal strategy of the portlet
1815 */
1816 public void setUserPrincipalStrategy(String userPrincipalStrategy) {
1817 if (Validator.isNotNull(userPrincipalStrategy)) {
1818 _userPrincipalStrategy = userPrincipalStrategy;
1819 }
1820 }
1821
1822 /**
1823 * Returns true if the portlet does not share request attributes with the
1824 * portal or portlets from another WAR.
1825 *
1826 * @return true if the portlet does not share request attributes with the
1827 * portal or portlets from another WAR
1828 */
1829 public boolean getPrivateRequestAttributes() {
1830 return _privateRequestAttributes;
1831 }
1832
1833 /**
1834 * Returns true if the portlet does not share request attributes with the
1835 * portal or portlets from another WAR.
1836 *
1837 * @return true if the portlet does not share request attributes with the
1838 * portal or portlets from another WAR
1839 */
1840 public boolean isPrivateRequestAttributes() {
1841 return _privateRequestAttributes;
1842 }
1843
1844 /**
1845 * Set to true if the portlet does not share request attributes with the
1846 * portal or portlets from another WAR.
1847 *
1848 * @param privateRequestAttributes boolean value for whether the portlet
1849 * shares request attributes with the portal or portlets from another
1850 * WAR
1851 */
1852 public void setPrivateRequestAttributes(boolean privateRequestAttributes) {
1853 _privateRequestAttributes = privateRequestAttributes;
1854 }
1855
1856 /**
1857 * Returns true if the portlet does not share session attributes with the
1858 * portal.
1859 *
1860 * @return true if the portlet does not share session attributes with the
1861 * portal
1862 */
1863 public boolean getPrivateSessionAttributes() {
1864 return _privateSessionAttributes;
1865 }
1866
1867 /**
1868 * Returns true if the portlet does not share session attributes with the
1869 * portal.
1870 *
1871 * @return true if the portlet does not share session attributes with the
1872 * portal
1873 */
1874 public boolean isPrivateSessionAttributes() {
1875 return _privateSessionAttributes;
1876 }
1877
1878 /**
1879 * Set to true if the portlet does not share session attributes with the
1880 * portal.
1881 *
1882 * @param privateSessionAttributes boolean value for whether the portlet
1883 * shares session attributes with the portal
1884 */
1885 public void setPrivateSessionAttributes(boolean privateSessionAttributes) {
1886 _privateSessionAttributes = privateSessionAttributes;
1887 }
1888
1889 /**
1890 * Returns the render weight of the portlet.
1891 *
1892 * @return the render weight of the portlet
1893 */
1894 public int getRenderWeight() {
1895 return _renderWeight;
1896 }
1897
1898 /**
1899 * Sets the render weight of the portlet.
1900 *
1901 * @param renderWeight int value for the render weight of the portlet
1902 */
1903 public void setRenderWeight(int renderWeight) {
1904 _renderWeight = renderWeight;
1905 }
1906
1907 /**
1908 * Returns true if the portlet can be displayed via Ajax.
1909 *
1910 * @return true if the portlet can be displayed via Ajax
1911 */
1912 public boolean getAjaxable() {
1913 return _ajaxable;
1914 }
1915
1916 /**
1917 * Returns true if the portlet can be displayed via Ajax.
1918 *
1919 * @return true if the portlet can be displayed via Ajax
1920 */
1921 public boolean isAjaxable() {
1922 return _ajaxable;
1923 }
1924
1925 /**
1926 * Set to true if the portlet can be displayed via Ajax.
1927 *
1928 * @param ajaxable boolean value for whether the portlet can be displayed
1929 * via Ajax
1930 */
1931 public void setAjaxable(boolean ajaxable) {
1932 _ajaxable = ajaxable;
1933 }
1934
1935 /**
1936 * Gets a list of CSS files that will be referenced from the page's header
1937 * relative to the portal's context path.
1938 *
1939 * @return a list of CSS files that will be referenced from the page's
1940 * header relative to the portal's context path
1941 */
1942 public List<String> getHeaderPortalCss() {
1943 return _headerPortalCss;
1944 }
1945
1946 /**
1947 * Sets a list of CSS files that will be referenced from the page's header
1948 * relative to the portal's context path.
1949 *
1950 * @param headerPortalCss a list of CSS files that will be referenced from
1951 * the page's header relative to the portal's context path
1952 */
1953 public void setHeaderPortalCss(List<String> headerPortalCss) {
1954 _headerPortalCss = headerPortalCss;
1955 }
1956
1957 /**
1958 * Gets a list of CSS files that will be referenced from the page's header
1959 * relative to the portlet's context path.
1960 *
1961 * @return a list of CSS files that will be referenced from the page's
1962 * header relative to the portlet's context path
1963 */
1964 public List<String> getHeaderPortletCss() {
1965 return _headerPortletCss;
1966 }
1967
1968 /**
1969 * Sets a list of CSS files that will be referenced from the page's header
1970 * relative to the portlet's context path.
1971 *
1972 * @param headerPortletCss a list of CSS files that will be referenced from
1973 * the page's header relative to the portlet's context path
1974 */
1975 public void setHeaderPortletCss(List<String> headerPortletCss) {
1976 _headerPortletCss = headerPortletCss;
1977 }
1978
1979 /**
1980 * Gets a list of JavaScript files that will be referenced from the page's
1981 * header relative to the portal's context path.
1982 *
1983 * @return a list of JavaScript files that will be referenced from the
1984 * page's header relative to the portal's context path
1985 */
1986 public List<String> getHeaderPortalJavaScript() {
1987 return _headerPortalJavaScript;
1988 }
1989
1990 /**
1991 * Sets a list of JavaScript files that will be referenced from the page's
1992 * header relative to the portal's context path.
1993 *
1994 * @param headerPortalJavaScript a list of JavaScript files that will be
1995 * referenced from the page's header relative to the portal's context
1996 * path
1997 */
1998 public void setHeaderPortalJavaScript(List<String> headerPortalJavaScript) {
1999 _headerPortalJavaScript = headerPortalJavaScript;
2000 }
2001
2002 /**
2003 * Gets a list of JavaScript files that will be referenced from the page's
2004 * header relative to the portlet's context path.
2005 *
2006 * @return a list of JavaScript files that will be referenced from the
2007 * page's header relative to the portlet's context path
2008 */
2009 public List<String> getHeaderPortletJavaScript() {
2010 return _headerPortletJavaScript;
2011 }
2012
2013 /**
2014 * Sets a list of JavaScript files that will be referenced from the page's
2015 * header relative to the portlet's context path.
2016 *
2017 * @param headerPortletJavaScript a list of JavaScript files that will be
2018 * referenced from the page's header relative to the portlet's
2019 * context path
2020 */
2021 public void setHeaderPortletJavaScript(
2022 List<String> headerPortletJavaScript) {
2023
2024 _headerPortletJavaScript = headerPortletJavaScript;
2025 }
2026
2027 /**
2028 * Gets a list of CSS files that will be referenced from the page's footer
2029 * relative to the portal's context path.
2030 *
2031 * @return a list of CSS files that will be referenced from the page's
2032 * footer relative to the portal's context path
2033 */
2034 public List<String> getFooterPortalCss() {
2035 return _footerPortalCss;
2036 }
2037
2038 /**
2039 * Sets a list of CSS files that will be referenced from the page's footer
2040 * relative to the portal's context path.
2041 *
2042 * @param footerPortalCss a list of CSS files that will be referenced from
2043 * the page's footer relative to the portal's context path
2044 */
2045 public void setFooterPortalCss(List<String> footerPortalCss) {
2046 _footerPortalCss = footerPortalCss;
2047 }
2048
2049 /**
2050 * Gets a list of CSS files that will be referenced from the page's footer
2051 * relative to the portlet's context path.
2052 *
2053 * @return a list of CSS files that will be referenced from the page's
2054 * footer relative to the portlet's context path
2055 */
2056 public List<String> getFooterPortletCss() {
2057 return _footerPortletCss;
2058 }
2059
2060 /**
2061 * Sets a list of CSS files that will be referenced from the page's footer
2062 * relative to the portlet's context path.
2063 *
2064 * @param footerPortletCss a list of CSS files that will be referenced from
2065 * the page's footer relative to the portlet's context path
2066 */
2067 public void setFooterPortletCss(List<String> footerPortletCss) {
2068 _footerPortletCss = footerPortletCss;
2069 }
2070
2071 /**
2072 * Gets a list of JavaScript files that will be referenced from the page's
2073 * footer relative to the portal's context path.
2074 *
2075 * @return a list of JavaScript files that will be referenced from the
2076 * page's footer relative to the portal's context path
2077 */
2078 public List<String> getFooterPortalJavaScript() {
2079 return _footerPortalJavaScript;
2080 }
2081
2082 /**
2083 * Sets a list of JavaScript files that will be referenced from the page's
2084 * footer relative to the portal's context path.
2085 *
2086 * @param footerPortalJavaScript a list of JavaScript files that will be
2087 * referenced from the page's footer relative to the portal's context
2088 * path
2089 */
2090 public void setFooterPortalJavaScript(List<String> footerPortalJavaScript) {
2091 _footerPortalJavaScript = footerPortalJavaScript;
2092 }
2093
2094 /**
2095 * Gets a list of JavaScript files that will be referenced from the page's
2096 * footer relative to the portlet's context path.
2097 *
2098 * @return a list of JavaScript files that will be referenced from the
2099 * page's footer relative to the portlet's context path
2100 */
2101 public List<String> getFooterPortletJavaScript() {
2102 return _footerPortletJavaScript;
2103 }
2104
2105 /**
2106 * Sets a list of JavaScript files that will be referenced from the page's
2107 * footer relative to the portlet's context path.
2108 *
2109 * @param footerPortletJavaScript a list of JavaScript files that will be
2110 * referenced from the page's footer relative to the portlet's
2111 * context path
2112 */
2113 public void setFooterPortletJavaScript(
2114 List<String> footerPortletJavaScript) {
2115
2116 _footerPortletJavaScript = footerPortletJavaScript;
2117 }
2118
2119 /**
2120 * Gets the name of the CSS class that will be injected in the DIV that
2121 * wraps this portlet.
2122 *
2123 * @return the name of the CSS class that will be injected in the DIV that
2124 * wraps this portlet
2125 */
2126 public String getCssClassWrapper() {
2127 return _cssClassWrapper;
2128 }
2129
2130 /**
2131 * Sets the name of the CSS class that will be injected in the DIV that
2132 * wraps this portlet.
2133 *
2134 * @param cssClassWrapper the name of the CSS class that will be injected in
2135 * the DIV that wraps this portlet
2136 */
2137 public void setCssClassWrapper(String cssClassWrapper) {
2138 _cssClassWrapper = cssClassWrapper;
2139 }
2140
2141 /**
2142 * Gets the Facebook integration method of the portlet.
2143 *
2144 * @return the Facebook integration method of the portlet
2145 */
2146 public String getFacebookIntegration() {
2147 return _facebookIntegration;
2148 }
2149
2150 /**
2151 * Sets the Facebook integration method of the portlet.
2152 *
2153 * @param facebookIntegration the Facebook integration method of the portlet
2154 */
2155 public void setFacebookIntegration(String facebookIntegration) {
2156 if (Validator.isNotNull(facebookIntegration)) {
2157 _facebookIntegration = facebookIntegration;
2158 }
2159 }
2160
2161 /**
2162 * Returns true if default resources for the portlet are added to a page.
2163 *
2164 * @return true if default resources for the portlet are added to a page
2165 */
2166 public boolean getAddDefaultResource() {
2167 return _addDefaultResource;
2168 }
2169
2170 /**
2171 * Returns true if default resources for the portlet are added to a page.
2172 *
2173 * @return true if default resources for the portlet are added to a page
2174 */
2175 public boolean isAddDefaultResource() {
2176 return _addDefaultResource;
2177 }
2178
2179 /**
2180 * Set to true if default resources for the portlet are added to a page.
2181 *
2182 * @param addDefaultResource boolean value for whether or not default
2183 * resources for the portlet are added to a page
2184 */
2185 public void setAddDefaultResource(boolean addDefaultResource) {
2186 _addDefaultResource = addDefaultResource;
2187 }
2188
2189 /**
2190 * Sets a string of ordered comma delimited portlet ids.
2191 *
2192 * @param roles a string of ordered comma delimited portlet ids
2193 */
2194 public void setRoles(String roles) {
2195 _rolesArray = StringUtil.split(roles);
2196
2197 super.setRoles(roles);
2198 }
2199
2200 /**
2201 * Gets an array of required roles of the portlet.
2202 *
2203 * @return an array of required roles of the portlet
2204 */
2205 public String[] getRolesArray() {
2206 return _rolesArray;
2207 }
2208
2209 /**
2210 * Sets an array of required roles of the portlet.
2211 *
2212 * @param rolesArray an array of required roles of the portlet
2213 */
2214 public void setRolesArray(String[] rolesArray) {
2215 _rolesArray = rolesArray;
2216
2217 super.setRoles(StringUtil.merge(rolesArray));
2218 }
2219
2220 /**
2221 * Gets the unlinked roles of the portlet.
2222 *
2223 * @return unlinked roles of the portlet
2224 */
2225 public Set<String> getUnlinkedRoles() {
2226 return _unlinkedRoles;
2227 }
2228
2229 /**
2230 * Sets the unlinked roles of the portlet.
2231 *
2232 * @param unlinkedRoles the unlinked roles of the portlet
2233 */
2234 public void setUnlinkedRoles(Set<String> unlinkedRoles) {
2235 _unlinkedRoles = unlinkedRoles;
2236 }
2237
2238 /**
2239 * Gets the role mappers of the portlet.
2240 *
2241 * @return role mappers of the portlet
2242 */
2243 public Map<String, String> getRoleMappers() {
2244 return _roleMappers;
2245 }
2246
2247 /**
2248 * Sets the role mappers of the portlet.
2249 *
2250 * @param roleMappers the role mappers of the portlet
2251 */
2252 public void setRoleMappers(Map<String, String> roleMappers) {
2253 _roleMappers = roleMappers;
2254 }
2255
2256 /**
2257 * Link the role names set in portlet.xml with the Liferay roles set in
2258 * liferay-portlet.xml.
2259 */
2260 public void linkRoles() {
2261 List<String> linkedRoles = new ArrayList<String>();
2262
2263 Iterator<String> itr = _unlinkedRoles.iterator();
2264
2265 while (itr.hasNext()) {
2266 String unlinkedRole = itr.next();
2267
2268 String roleLink = _roleMappers.get(unlinkedRole);
2269
2270 if (Validator.isNotNull(roleLink)) {
2271 if (_log.isDebugEnabled()) {
2272 _log.debug(
2273 "Linking role for portlet [" + getPortletId() +
2274 "] with role-name [" + unlinkedRole +
2275 "] to role-link [" + roleLink + "]");
2276 }
2277
2278 linkedRoles.add(roleLink);
2279 }
2280 else {
2281 _log.error(
2282 "Unable to link role for portlet [" + getPortletId() +
2283 "] with role-name [" + unlinkedRole +
2284 "] because role-link is null");
2285 }
2286 }
2287
2288 String[] array = linkedRoles.toArray(new String[linkedRoles.size()]);
2289
2290 Arrays.sort(array);
2291
2292 setRolesArray(array);
2293 }
2294
2295 /**
2296 * Returns true if the portlet has a role with the specified name.
2297 *
2298 * @return true if the portlet has a role with the specified name
2299 */
2300 public boolean hasRoleWithName(String roleName) {
2301 if ((_rolesArray == null) || (_rolesArray.length == 0)) {
2302 return false;
2303 }
2304
2305 for (int i = 0; i < _rolesArray.length; i++) {
2306 if (_rolesArray[i].equalsIgnoreCase(roleName)) {
2307 return true;
2308 }
2309 }
2310
2311 return false;
2312 }
2313
2314 /**
2315 * Returns true if the user has the permission to add the portlet to a
2316 * layout.
2317 *
2318 * @return true if the user has the permission to add the portlet to a
2319 * layout
2320 */
2321 public boolean hasAddPortletPermission(long userId) {
2322 PermissionChecker permissionChecker =
2323 PermissionThreadLocal.getPermissionChecker();
2324
2325 try {
2326 if ((permissionChecker == null) ||
2327 (permissionChecker.getUserId() != userId)) {
2328
2329 User user = UserLocalServiceUtil.getUser(userId);
2330
2331 permissionChecker = PermissionCheckerFactoryUtil.create(
2332 user, true);
2333 }
2334
2335 if (PortletPermissionUtil.contains(
2336 permissionChecker, getPortletId(),
2337 ActionKeys.ADD_TO_PAGE)) {
2338
2339 return true;
2340 }
2341 }
2342 catch (Exception e) {
2343 _log.error(e, e);
2344 }
2345
2346 return false;
2347 }
2348
2349 /**
2350 * Returns true if the portlet is a system portlet that a user cannot
2351 * manually add to their page.
2352 *
2353 * @return true if the portlet is a system portlet that a user cannot
2354 * manually add to their page
2355 */
2356 public boolean getSystem() {
2357 return _system;
2358 }
2359
2360 /**
2361 * Returns true if the portlet is a system portlet that a user cannot
2362 * manually add to their page.
2363 *
2364 * @return true if the portlet is a system portlet that a user cannot
2365 * manually add to their page
2366 */
2367 public boolean isSystem() {
2368 return _system;
2369 }
2370
2371 /**
2372 * Set to true if the portlet is a system portlet that a user cannot
2373 * manually add to their page.
2374 *
2375 * @param system boolean value for whether the portlet is a system portlet
2376 * that a user cannot manually add to their page
2377 */
2378 public void setSystem(boolean system) {
2379 _system = system;
2380 }
2381
2382 /**
2383 * Returns true to include the portlet and make it available to be made
2384 * active.
2385 *
2386 * @return true to include the portlet and make it available to be made
2387 * active
2388 */
2389 public boolean getInclude() {
2390 return _include;
2391 }
2392
2393 /**
2394 * Returns true to include the portlet and make it available to be made
2395 * active.
2396 *
2397 * @return true to include the portlet and make it available to be made
2398 * active
2399 */
2400 public boolean isInclude() {
2401 return _include;
2402 }
2403
2404 /**
2405 * Set to true to include the portlet and make it available to be made
2406 * active.
2407 *
2408 * @param include boolean value for whether to include the portlet and make
2409 * it available to be made active
2410 */
2411 public void setInclude(boolean include) {
2412 _include = include;
2413 }
2414
2415 /**
2416 * Gets the init parameters of the portlet.
2417 *
2418 * @return init parameters of the portlet
2419 */
2420 public Map<String, String> getInitParams() {
2421 return _initParams;
2422 }
2423
2424 /**
2425 * Sets the init parameters of the portlet.
2426 *
2427 * @param initParams the init parameters of the portlet
2428 */
2429 public void setInitParams(Map<String, String> initParams) {
2430 _initParams = initParams;
2431 }
2432
2433 /**
2434 * Gets expiration cache of the portlet.
2435 *
2436 * @return expiration cache of the portlet
2437 */
2438 public Integer getExpCache() {
2439 return _expCache;
2440 }
2441
2442 /**
2443 * Sets expiration cache of the portlet.
2444 *
2445 * @param expCache expiration cache of the portlet
2446 */
2447 public void setExpCache(Integer expCache) {
2448 _expCache = expCache;
2449 }
2450
2451 /**
2452 * Gets the portlet modes of the portlet.
2453 *
2454 * @return portlet modes of the portlet
2455 */
2456 public Map<String, Set<String>> getPortletModes() {
2457 return _portletModes;
2458 }
2459
2460 /**
2461 * Sets the portlet modes of the portlet.
2462 *
2463 * @param portletModes the portlet modes of the portlet
2464 */
2465 public void setPortletModes(Map<String, Set<String>> portletModes) {
2466 _portletModes = portletModes;
2467 }
2468
2469 /**
2470 * Returns true if the portlet supports the specified mime type and portlet
2471 * mode.
2472 *
2473 * @return true if the portlet supports the specified mime type and portlet
2474 * mode
2475 */
2476 public boolean hasPortletMode(String mimeType, PortletMode portletMode) {
2477 if (mimeType == null) {
2478 mimeType = ContentTypes.TEXT_HTML;
2479 }
2480
2481 Set<String> mimeTypePortletModes = _portletModes.get(mimeType);
2482
2483 if (mimeTypePortletModes == null) {
2484 return false;
2485 }
2486
2487 if (mimeTypePortletModes.contains(portletMode.toString())) {
2488 return true;
2489 }
2490 else {
2491 return false;
2492 }
2493 }
2494
2495 /**
2496 * Gets a list of all portlet modes supported by the portlet.
2497 *
2498 * @return a list of all portlet modes supported by the portlet
2499 */
2500 public Set<String> getAllPortletModes() {
2501 Set<String> allPortletModes = new TreeSet<String>();
2502
2503 Iterator<Map.Entry <String, Set<String>>> itr1 =
2504 _portletModes.entrySet().iterator();
2505
2506 while (itr1.hasNext()) {
2507 Map.Entry<String, Set<String>> entry = itr1.next();
2508
2509 Set<String> mimeTypePortletModes = entry.getValue();
2510
2511 Iterator<String> itr2 = mimeTypePortletModes.iterator();
2512
2513 while (itr2.hasNext()) {
2514 String portletMode = itr2.next();
2515
2516 allPortletModes.add(portletMode);
2517 }
2518 }
2519
2520 return allPortletModes;
2521 }
2522
2523 /**
2524 * Returns true if the portlet supports more than one mime type.
2525 *
2526 * @return true if the portlet supports more than one mime type
2527 */
2528 public boolean hasMultipleMimeTypes() {
2529 if (_portletModes.size() > 1) {
2530 return true;
2531 }
2532 else {
2533 return false;
2534 }
2535 }
2536
2537 /**
2538 * Gets the window states of the portlet.
2539 *
2540 * @return window states of the portlet
2541 */
2542 public Map<String, Set<String>> getWindowStates() {
2543 return _windowStates;
2544 }
2545
2546 /**
2547 * Sets the window states of the portlet.
2548 *
2549 * @param windowStates the window states of the portlet
2550 */
2551 public void setWindowStates(Map<String, Set<String>> windowStates) {
2552 _windowStates = windowStates;
2553 }
2554
2555 /**
2556 * Returns true if the portlet supports the specified mime type and window
2557 * state.
2558 *
2559 * @return true if the portlet supports the specified mime type and window
2560 * state
2561 */
2562 public boolean hasWindowState(String mimeType, WindowState windowState) {
2563 if (mimeType == null) {
2564 mimeType = ContentTypes.TEXT_HTML;
2565 }
2566
2567 Set<String> mimeTypeWindowStates = _windowStates.get(mimeType);
2568
2569 if (mimeTypeWindowStates == null) {
2570 return false;
2571 }
2572
2573 if (mimeTypeWindowStates.contains(windowState.toString())) {
2574 return true;
2575 }
2576 else {
2577 return false;
2578 }
2579 }
2580
2581 /**
2582 * Gets a list of all window states supported by the portlet.
2583 *
2584 * @return a list of all window states supported by the portlet
2585 */
2586 public Set<String> getAllWindowStates() {
2587 Set<String> allWindowStates = new TreeSet<String>();
2588
2589 Iterator<Map.Entry <String, Set<String>>> itr1 =
2590 _windowStates.entrySet().iterator();
2591
2592 while (itr1.hasNext()) {
2593 Map.Entry<String, Set<String>> entry = itr1.next();
2594
2595 Set<String> mimeTypeWindowStates = entry.getValue();
2596
2597 Iterator<String> itr2 = mimeTypeWindowStates.iterator();
2598
2599 while (itr2.hasNext()) {
2600 String windowState = itr2.next();
2601
2602 allWindowStates.add(windowState);
2603 }
2604 }
2605
2606 return allWindowStates;
2607 }
2608
2609 /**
2610 * Gets the supported locales of the portlet.
2611 *
2612 * @return supported locales of the portlet
2613 */
2614 public Set<String> getSupportedLocales() {
2615 return _supportedLocales;
2616 }
2617
2618 /**
2619 * Sets the supported locales of the portlet.
2620 *
2621 * @param supportedLocales the supported locales of the portlet
2622 */
2623 public void setSupportedLocales(Set<String> supportedLocales) {
2624 _supportedLocales = supportedLocales;
2625 }
2626
2627 /**
2628 * Gets the resource bundle of the portlet.
2629 *
2630 * @return resource bundle of the portlet
2631 */
2632 public String getResourceBundle() {
2633 return _resourceBundle;
2634 }
2635
2636 /**
2637 * Sets the resource bundle of the portlet.
2638 *
2639 * @param resourceBundle the resource bundle of the portlet
2640 */
2641 public void setResourceBundle(String resourceBundle) {
2642 _resourceBundle = resourceBundle;
2643 }
2644
2645 /**
2646 * Gets the portlet info of the portlet.
2647 *
2648 * @return portlet info of the portlet
2649 */
2650 public PortletInfo getPortletInfo() {
2651 return _portletInfo;
2652 }
2653
2654 /**
2655 * Sets the portlet info of the portlet.
2656 *
2657 * @param portletInfo the portlet info of the portlet
2658 */
2659 public void setPortletInfo(PortletInfo portletInfo) {
2660 _portletInfo = portletInfo;
2661 }
2662
2663 /**
2664 * Gets the filters of the portlet.
2665 *
2666 * @return filters of the portlet
2667 */
2668 public Map<String, PortletFilter> getPortletFilters() {
2669 return _portletFilters;
2670 }
2671
2672 /**
2673 * Sets the filters of the portlet.
2674 *
2675 * @param portletFilters the filters of the portlet
2676 */
2677 public void setPortletFilters(Map<String, PortletFilter> portletFilters) {
2678 _portletFilters = portletFilters;
2679 }
2680
2681 /**
2682 * Adds a supported processing event.
2683 */
2684 public void addProcessingEvent(QName processingEvent) {
2685 _processingEvents.add(processingEvent);
2686 _processingEventsByQName.put(
2687 PortletQNameUtil.getKey(processingEvent), processingEvent);
2688 }
2689
2690 /**
2691 * Gets the supported processing event from a namespace URI and a local
2692 * part.
2693 *
2694 * @return the supported processing event from a namespace URI and a local
2695 * part
2696 */
2697 public QName getProcessingEvent(String uri, String localPart) {
2698 return _processingEventsByQName.get(
2699 PortletQNameUtil.getKey(uri, localPart));
2700 }
2701
2702 /**
2703 * Gets the supported processing events of the portlet.
2704 *
2705 * @return supported processing events of the portlet
2706 */
2707 public Set<QName> getProcessingEvents() {
2708 return _processingEvents;
2709 }
2710
2711 /**
2712 * Sets the supported processing events of the portlet.
2713 *
2714 * @param processingEvents the supported processing events of the portlet
2715 */
2716 public void setProcessingEvents(Set<QName> processingEvents) {
2717 for (QName processingEvent : processingEvents) {
2718 addProcessingEvent(processingEvent);
2719 }
2720 }
2721
2722 /**
2723 * Adds a supported publishing event.
2724 */
2725 public void addPublishingEvent(QName publishingEvent) {
2726 _publishingEvents.add(publishingEvent);
2727 }
2728
2729 /**
2730 * Gets the supported publishing events of the portlet.
2731 *
2732 * @return supported publishing events of the portlet
2733 */
2734 public Set<QName> getPublishingEvents() {
2735 return _publishingEvents;
2736 }
2737
2738 /**
2739 * Sets the supported publishing events of the portlet.
2740 *
2741 * @param publishingEvents the supported publishing events of the portlet
2742 */
2743 public void setPublishingEvents(Set<QName> publishingEvents) {
2744 for (QName publishingEvent : publishingEvents) {
2745 addPublishingEvent(publishingEvent);
2746 }
2747 }
2748
2749 /**
2750 * Adds a supported public render parameter.
2751 *
2752 * @param publicRenderParameter a supported public render parameter
2753 */
2754 public void addPublicRenderParameter(
2755 PublicRenderParameter publicRenderParameter) {
2756
2757 _publicRenderParameters.add(publicRenderParameter);
2758 _publicRenderParametersByIdentifier.put(
2759 publicRenderParameter.getIdentifier(), publicRenderParameter);
2760 _publicRenderParametersByQName.put(
2761 PortletQNameUtil.getKey(publicRenderParameter.getQName()),
2762 publicRenderParameter);
2763 }
2764
2765 /**
2766 * Gets the supported public render parameter from an identifier.
2767 *
2768 * @return the supported public render parameter from an identifier
2769 */
2770 public PublicRenderParameter getPublicRenderParameter(String identifier) {
2771 return _publicRenderParametersByIdentifier.get(identifier);
2772 }
2773
2774 /**
2775 * Gets the supported public render parameter from a namespace URI and a
2776 * local part.
2777 *
2778 * @return the supported public render parameter from a namespace URI and a
2779 * local part
2780 */
2781 public PublicRenderParameter getPublicRenderParameter(
2782 String uri, String localPart) {
2783
2784 return _publicRenderParametersByQName.get(
2785 PortletQNameUtil.getKey(uri, localPart));
2786 }
2787
2788 /**
2789 * Gets the supported public render parameters of the portlet.
2790 *
2791 * @return the supported public render parameters of the portlet
2792 */
2793 public Set<PublicRenderParameter> getPublicRenderParameters() {
2794 return _publicRenderParameters;
2795 }
2796
2797 /**
2798 * Sets the supported public render parameters of the portlet.
2799 *
2800 * @param publicRenderParameters the supported public render parameters of
2801 * the portlet
2802 */
2803 public void setPublicRenderParameters(
2804 Set<PublicRenderParameter> publicRenderParameters) {
2805
2806 for (PublicRenderParameter publicRenderParameter :
2807 publicRenderParameters) {
2808
2809 addPublicRenderParameter(publicRenderParameter);
2810 }
2811 }
2812
2813 /**
2814 * Gets the servlet context path of the portlet.
2815 *
2816 * @return the servlet context path of the portlet
2817 */
2818 public String getContextPath() {
2819 String virtualPath = getVirtualPath();
2820
2821 if (Validator.isNotNull(virtualPath)) {
2822 return virtualPath;
2823 }
2824
2825 if (_portletApp.isWARFile()) {
2826 return StringPool.SLASH.concat(_portletApp.getServletContextName());
2827 }
2828 else {
2829 return PortalUtil.getPathContext();
2830 }
2831 }
2832
2833 /**
2834 * Get the application this portlet belongs to.
2835 *
2836 * @return the application this portlet belongs to
2837 */
2838 public PortletApp getPortletApp() {
2839 return _portletApp;
2840 }
2841
2842 /**
2843 * Sets the application this portlet belongs to.
2844 *
2845 * @param portletApp the application this portlet belongs to
2846 */
2847 public void setPortletApp(PortletApp portletApp) {
2848 _portletApp = portletApp;
2849 }
2850
2851 /**
2852 * Returns true if the portlet is found in a WAR file.
2853 *
2854 * @param portletId the cloned instance portlet id
2855 * @return a cloned instance of the portlet
2856 */
2857 public Portlet getClonedInstance(String portletId) {
2858 if (_clonedInstances == null) {
2859
2860 // LEP-528
2861
2862 return null;
2863 }
2864
2865 Portlet clonedInstance = _clonedInstances.get(portletId);
2866
2867 if (clonedInstance == null) {
2868 clonedInstance = (Portlet)clone();
2869
2870 clonedInstance.setPortletId(portletId);
2871
2872 // Disable caching of cloned instances until we can figure out how
2873 // to elegantly refresh the cache when the portlet is dynamically
2874 // updated by the user. For example, the user might change the
2875 // portlet from one column to the next. Cloned instances that are
2876 // cached would not see the new change. We can then also cache
2877 // static portlet instances.
2878
2879 //_clonedInstances.put(portletId, clonedInstance);
2880 }
2881
2882 return clonedInstance;
2883 }
2884
2885 /**
2886 * Returns true if the portlet is a static portlet that is cannot be moved.
2887 *
2888 * @return true if the portlet is a static portlet that is cannot be moved
2889 */
2890 public boolean getStatic() {
2891 return _staticPortlet;
2892 }
2893
2894 /**
2895 * Returns true if the portlet is a static portlet that is cannot be moved.
2896 *
2897 * @return true if the portlet is a static portlet that is cannot be moved
2898 */
2899 public boolean isStatic() {
2900 return _staticPortlet;
2901 }
2902
2903 /**
2904 * Set to true if the portlet is a static portlet that is cannot be moved.
2905 *
2906 * @param staticPortlet boolean value for whether the portlet is a static
2907 * portlet that cannot be moved
2908 */
2909 public void setStatic(boolean staticPortlet) {
2910 _staticPortlet = staticPortlet;
2911 }
2912
2913 /**
2914 * Returns true if the portlet is a static portlet at the start of a list of
2915 * portlets.
2916 *
2917 * @return true if the portlet is a static portlet at the start of a list of
2918 * portlets
2919 */
2920 public boolean getStaticStart() {
2921 return _staticPortletStart;
2922 }
2923
2924 /**
2925 * Returns true if the portlet is a static portlet at the start of a list of
2926 * portlets.
2927 *
2928 * @return true if the portlet is a static portlet at the start of a list of
2929 * portlets
2930 */
2931 public boolean isStaticStart() {
2932 return _staticPortletStart;
2933 }
2934
2935 /**
2936 * Set to true if the portlet is a static portlet at the start of a list of
2937 * portlets.
2938 *
2939 * @param staticPortletStart boolean value for whether the portlet is a
2940 * static portlet at the start of a list of portlets
2941 */
2942 public void setStaticStart(boolean staticPortletStart) {
2943 _staticPortletStart = staticPortletStart;
2944 }
2945
2946 /**
2947 * Returns true if the portlet is a static portlet at the end of a list of
2948 * portlets.
2949 *
2950 * @return true if the portlet is a static portlet at the end of a list of
2951 * portlets
2952 */
2953 public boolean getStaticEnd() {
2954 return !_staticPortletStart;
2955 }
2956
2957 /**
2958 * Returns true if the portlet is a static portlet at the end of a list of
2959 * portlets.
2960 *
2961 * @return true if the portlet is a static portlet at the end of a list of
2962 * portlets
2963 */
2964 public boolean isStaticEnd() {
2965 return !_staticPortletStart;
2966 }
2967
2968 /**
2969 * Returns true if the portlet is an undeployed portlet.
2970 *
2971 * @return true if the portlet is a placeholder of an undeployed portlet
2972 */
2973 public boolean getUndeployedPortlet() {
2974 return _undeployedPortlet;
2975 }
2976
2977 /**
2978 * Returns true if the portlet is an undeployed portlet.
2979 *
2980 * @return true if the portlet is a placeholder of an undeployed portlet
2981 */
2982 public boolean isUndeployedPortlet() {
2983 return _undeployedPortlet;
2984 }
2985
2986 /**
2987 * Set to true if the portlet is an undeployed portlet.
2988 *
2989 * @param undeployedPortlet boolean value for whether the portlet is an
2990 * undeployed portlet
2991 */
2992 public void setUndeployedPortlet(boolean undeployedPortlet) {
2993 _undeployedPortlet = undeployedPortlet;
2994 }
2995
2996 /**
2997 * Creates and returns a copy of this object.
2998 *
2999 * @return a copy of this object
3000 */
3001 public Object clone() {
3002 Portlet portlet = new PortletImpl(
3003 getPortletId(), getPluginPackage(), getDefaultPluginSetting(),
3004 getCompanyId(), getTimestamp(), getIcon(), getVirtualPath(),
3005 getStrutsPath(), getPortletName(), getDisplayName(),
3006 getPortletClass(), getConfigurationActionClass(), getIndexerClass(),
3007 getOpenSearchClass(), getSchedulerEntries(), getPortletURLClass(),
3008 getFriendlyURLMapperClass(), getURLEncoderClass(),
3009 getPortletDataHandlerClass(), getPortletLayoutListenerClass(),
3010 getPollerProcessorClass(), getPopMessageListenerClass(),
3011 getSocialActivityInterpreterClass(),
3012 getSocialRequestInterpreterClass(), getWebDAVStorageToken(),
3013 getWebDAVStorageClass(), getXmlRpcMethodClass(),
3014 getControlPanelEntryCategory(), getControlPanelEntryWeight(),
3015 getControlPanelEntryClass(), getAssetRendererFactoryClasses(),
3016 getCustomAttributesDisplayClasses(), getWorkflowHandlerClasses(),
3017 getDefaultPreferences(), getPreferencesValidator(),
3018 isPreferencesCompanyWide(), isPreferencesUniquePerLayout(),
3019 isPreferencesOwnedByGroup(), isUseDefaultTemplate(),
3020 isShowPortletAccessDenied(), isShowPortletInactive(),
3021 isActionURLRedirect(), isRestoreCurrentView(), isMaximizeEdit(),
3022 isMaximizeHelp(), isPopUpPrint(), isLayoutCacheable(),
3023 isInstanceable(), isScopeable(), getUserPrincipalStrategy(),
3024 isPrivateRequestAttributes(), isPrivateSessionAttributes(),
3025 getRenderWeight(), isAjaxable(), getHeaderPortalCss(),
3026 getHeaderPortletCss(), getHeaderPortalJavaScript(),
3027 getHeaderPortletJavaScript(), getFooterPortalCss(),
3028 getFooterPortletCss(), getFooterPortalJavaScript(),
3029 getFooterPortletJavaScript(), getCssClassWrapper(),
3030 getFacebookIntegration(), isAddDefaultResource(), getRoles(),
3031 getUnlinkedRoles(), getRoleMappers(), isSystem(), isActive(),
3032 isInclude(), getInitParams(), getExpCache(), getPortletModes(),
3033 getWindowStates(), getSupportedLocales(), getResourceBundle(),
3034 getPortletInfo(), getPortletFilters(), getProcessingEvents(),
3035 getPublishingEvents(), getPublicRenderParameters(),
3036 getPortletApp());
3037
3038 portlet.setId(getId());
3039
3040 return portlet;
3041 }
3042
3043 /**
3044 * Compares this portlet to the specified object.
3045 *
3046 * @param portlet the portlet to compare this portlet against
3047 * @return the value 0 if the argument portlet is equal to this portlet; a
3048 * value less than -1 if this portlet is less than the portlet
3049 * argument; and 1 if this portlet is greater than the portlet
3050 * argument
3051 */
3052 public int compareTo(Portlet portlet) {
3053 return getPortletId().compareTo(portlet.getPortletId());
3054 }
3055
3056 /**
3057 * Checks whether this portlet is equal to the specified object.
3058 *
3059 * @param obj the object to compare this portlet against
3060 * @return true if the portlet is equal to the specified object
3061 */
3062 public boolean equals(Object obj) {
3063 Portlet portlet = (Portlet)obj;
3064
3065 return getPortletId().equals(portlet.getPortletId());
3066 }
3067
3068 /**
3069 * Log instance for this class.
3070 */
3071 private static Log _log = LogFactoryUtil.getLog(PortletImpl.class);
3072
3073 /**
3074 * Package this plugin belongs to.
3075 */
3076 private PluginPackage _pluginPackage;
3077
3078 /**
3079 * Plugin settings associated with the portlet.
3080 */
3081 private PluginSetting _defaultPluginSetting;
3082
3083 /**
3084 * The timestamp of the portlet.
3085 */
3086 private long _timestamp;
3087
3088 /**
3089 * The icon of the portlet.
3090 */
3091 private String _icon;
3092
3093 /**
3094 * The virtual path of the portlet.
3095 */
3096 private String _virtualPath;
3097
3098 /**
3099 * The struts path of the portlet.
3100 */
3101 private String _strutsPath;
3102
3103 /**
3104 * The name of the portlet.
3105 */
3106 private String _portletName;
3107
3108 /**
3109 * The display name of the portlet.
3110 */
3111 private String _displayName;
3112
3113 /**
3114 * The name of the portlet class of the portlet.
3115 */
3116 private String _portletClass;
3117
3118 /**
3119 * The configuration action class of the portlet.
3120 */
3121 private String _configurationActionClass;
3122
3123 /**
3124 * The name of the indexer class of the portlet.
3125 */
3126 private String _indexerClass;
3127
3128 /**
3129 * The name of the open search class of the portlet.
3130 */
3131 private String _openSearchClass;
3132
3133 /**
3134 * The scheduler entries of the portlet.
3135 */
3136 private List<SchedulerEntry> _schedulerEntries;
3137
3138 /**
3139 * The name of the portlet URL class of the portlet.
3140 */
3141 private String _portletURLClass;
3142
3143 /**
3144 * The name of the friendly URL mapper class of the portlet.
3145 */
3146 private String _friendlyURLMapperClass;
3147
3148 /**
3149 * The name of the URL encoder class of the portlet.
3150 */
3151 private String _urlEncoderClass;
3152
3153 /**
3154 * The name of the portlet data handler class of the portlet.
3155 */
3156 private String _portletDataHandlerClass;
3157
3158 /**
3159 * The name of the portlet data layout listener class of the portlet.
3160 */
3161 private String _portletLayoutListenerClass;
3162
3163 /**
3164 * The name of the poller processor class of the portlet.
3165 */
3166 private String _pollerProcessorClass;
3167
3168 /**
3169 * The name of the POP message listener class of the portlet.
3170 */
3171 private String _popMessageListenerClass;
3172
3173 /**
3174 * The name of the social activity interpreter class of the portlet.
3175 */
3176 private String _socialActivityInterpreterClass;
3177
3178 /**
3179 * The name of the social request interpreter class of the portlet.
3180 */
3181 private String _socialRequestInterpreterClass;
3182
3183 /**
3184 * The name of the WebDAV storage token of the portlet.
3185 */
3186 private String _webDAVStorageToken;
3187
3188 /**
3189 * The name of the WebDAV storage class of the portlet.
3190 */
3191 private String _webDAVStorageClass;
3192
3193 /**
3194 * The name of the XML-RPC method class of the portlet.
3195 */
3196 private String _xmlRpcMethodClass;
3197
3198 /**
3199 * The default preferences of the portlet.
3200 */
3201 private String _defaultPreferences;
3202
3203 /**
3204 * The name of the preferences validator class of the portlet.
3205 */
3206 private String _preferencesValidator;
3207
3208 /**
3209 * True if preferences are shared across the entire company.
3210 */
3211 private boolean _preferencesCompanyWide;
3212
3213 /**
3214 * True if preferences are unique per layout.
3215 */
3216 private boolean _preferencesUniquePerLayout = true;
3217
3218 /**
3219 * True if preferences are owned by the group when the portlet is shown in a
3220 * group layout. False if preferences are owned by the user at all times.
3221 */
3222 private boolean _preferencesOwnedByGroup = true;
3223
3224 /**
3225 * The name of the category of the Control Panel where this portlet will be
3226 * shown.
3227 */
3228 private String _controlPanelEntryCategory;
3229
3230 /**
3231 * The relative weight of this portlet with respect to the other portlets in
3232 * the same category of the Control Panel.
3233 */
3234 private double _controlPanelEntryWeight = 100;
3235
3236 /**
3237 * The name of the class that will control when this portlet will be shown
3238 * in the Control Panel.
3239 */
3240 private String _controlPanelEntryClass;
3241
3242 /**
3243 * The names of the classes that represents asset types associated with the
3244 * portlet.
3245 */
3246 private List<String> _assetRendererFactoryClasses;
3247
3248 /**
3249 * The names of the classes that represents custom attribute displays
3250 * associated with the portlet.
3251 */
3252 private List<String> _customAttributesDisplayClasses;
3253
3254 /**
3255 * The names of the classes that represents workflow handlers associated
3256 * with the portlet.
3257 */
3258 private List<String> _workflowHandlerClasses;
3259
3260 /**
3261 * True if the portlet uses the default template.
3262 */
3263 private boolean _useDefaultTemplate = true;
3264
3265 /**
3266 * True if users are shown that they do not have access to the portlet.
3267 */
3268 private boolean _showPortletAccessDenied =
3269 PropsValues.LAYOUT_SHOW_PORTLET_ACCESS_DENIED;
3270
3271 /**
3272 * True if users are shown that the portlet is inactive.
3273 */
3274 private boolean _showPortletInactive =
3275 PropsValues.LAYOUT_SHOW_PORTLET_INACTIVE;
3276
3277 /**
3278 * True if an action URL for this portlet should cause an auto redirect.
3279 */
3280 private boolean _actionURLRedirect;
3281
3282 /**
3283 * True if the portlet restores to the current view from the maximized
3284 * state.
3285 */
3286 private boolean _restoreCurrentView = true;
3287
3288 /**
3289 * True if the portlet goes into the maximized state when the user goes into
3290 * the edit mode.
3291 */
3292 private boolean _maximizeEdit;
3293
3294 /**
3295 * True if the portlet goes into the maximized state when the user goes into
3296 * the help mode.
3297 */
3298 private boolean _maximizeHelp;
3299
3300 /**
3301 * True if the portlet goes into the pop up state when the user goes into
3302 * the print mode.
3303 */
3304 private boolean _popUpPrint = true;
3305
3306 /**
3307 * True if the portlet can be cached within the layout.
3308 */
3309 private boolean _layoutCacheable;
3310
3311 /**
3312 * True if the portlet can be added multiple times to a layout.
3313 */
3314 private boolean _instanceable;
3315
3316 /**
3317 * True if the portlet supports scoping of data.
3318 */
3319 private boolean _scopeable;
3320
3321 /**
3322 * The user principal strategy of the portlet.
3323 */
3324 private String _userPrincipalStrategy =
3325 PortletConstants.USER_PRINCIPAL_STRATEGY_USER_ID;
3326
3327 /**
3328 * True if the portlet does not share request attributes with the portal or
3329 * portlets from another WAR.
3330 */
3331 private boolean _privateRequestAttributes = true;
3332
3333 /**
3334 * True if the portlet does not share session attributes with the portal.
3335 */
3336 private boolean _privateSessionAttributes = true;
3337
3338 /**
3339 * Render weight of the portlet.
3340 */
3341 private int _renderWeight = 1;
3342
3343 /**
3344 * True if the portlet can be displayed via Ajax.
3345 */
3346 private boolean _ajaxable = true;
3347
3348 /**
3349 * A list of CSS files that will be referenced from the page's header
3350 * relative to the portal's context path.
3351 */
3352 private List<String> _headerPortalCss;
3353
3354 /**
3355 * A list of CSS files that will be referenced from the page's header
3356 * relative to the portlet's context path.
3357 */
3358 private List<String> _headerPortletCss;
3359
3360 /**
3361 * A list of JavaScript files that will be referenced from the page's header
3362 * relative to the portal's context path.
3363 */
3364 private List<String> _headerPortalJavaScript;
3365
3366 /**
3367 * A list of JavaScript files that will be referenced from the page's header
3368 * relative to the portlet's context path.
3369 */
3370 private List<String> _headerPortletJavaScript;
3371
3372 /**
3373 * A list of CSS files that will be referenced from the page's footer
3374 * relative to the portal's context path.
3375 */
3376 private List<String> _footerPortalCss;
3377
3378 /**
3379 * A list of CSS files that will be referenced from the page's footer
3380 * relative to the portlet's context path.
3381 */
3382 private List<String> _footerPortletCss;
3383
3384 /**
3385 * A list of JavaScript files that will be referenced from the page's footer
3386 * relative to the portal's context path.
3387 */
3388 private List<String> _footerPortalJavaScript;
3389
3390 /**
3391 * A list of JavaScript files that will be referenced from the page's footer
3392 * relative to the portlet's context path.
3393 */
3394 private List<String> _footerPortletJavaScript;
3395
3396 /**
3397 * The name of the CSS class that will be injected in the DIV that wraps
3398 * this portlet.
3399 */
3400 private String _cssClassWrapper = StringPool.BLANK;
3401
3402 /**
3403 * The Facebook integration method of the portlet.
3404 */
3405 private String _facebookIntegration =
3406 PortletConstants.FACEBOOK_INTEGRATION_IFRAME;
3407
3408 /**
3409 * True if default resources for the portlet are added to a page.
3410 */
3411 private boolean _addDefaultResource;
3412
3413 /**
3414 * An array of required roles of the portlet.
3415 */
3416 private String[] _rolesArray;
3417
3418 /**
3419 * The unlinked roles of the portlet.
3420 */
3421 private Set<String> _unlinkedRoles;
3422
3423 /**
3424 * The role mappers of the portlet.
3425 */
3426 private Map<String, String> _roleMappers;
3427
3428 /**
3429 * True if the portlet is a system portlet that a user cannot manually add
3430 * to their page.
3431 */
3432 private boolean _system;
3433
3434 /**
3435 * True to include the portlet and make it available to be made active.
3436 */
3437 private boolean _include = true;
3438
3439 /**
3440 * The init parameters of the portlet.
3441 */
3442 private Map<String, String> _initParams;
3443
3444 /**
3445 * The expiration cache of the portlet.
3446 */
3447 private Integer _expCache;
3448
3449 /**
3450 * The portlet modes of the portlet.
3451 */
3452 private Map<String, Set<String>> _portletModes;
3453
3454 /**
3455 * The window states of the portlet.
3456 */
3457 private Map<String, Set<String>> _windowStates;
3458
3459 /**
3460 * The supported locales of the portlet.
3461 */
3462 private Set<String> _supportedLocales;
3463
3464 /**
3465 * The resource bundle of the portlet.
3466 */
3467 private String _resourceBundle;
3468
3469 /**
3470 * The portlet info of the portlet.
3471 */
3472 private PortletInfo _portletInfo;
3473
3474 /**
3475 * The filters of the portlet.
3476 */
3477 private Map<String, PortletFilter> _portletFilters;
3478
3479 /**
3480 * The supported processing events of the portlet.
3481 */
3482 private Set<QName> _processingEvents = new HashSet<QName>();
3483
3484 /**
3485 * Map of the supported processing events of the portlet keyed by the QName.
3486 */
3487 private Map<String, QName> _processingEventsByQName =
3488 new HashMap<String, QName>();
3489
3490 /**
3491 * The supported publishing events of the portlet.
3492 */
3493 private Set<QName> _publishingEvents = new HashSet<QName>();
3494
3495 /**
3496 * The supported public render parameters of the portlet.
3497 */
3498 private Set<PublicRenderParameter> _publicRenderParameters =
3499 new HashSet<PublicRenderParameter>();
3500
3501 /**
3502 * Map of the supported public render parameters of the portlet keyed by the
3503 * identifier.
3504 */
3505 private Map<String, PublicRenderParameter>
3506 _publicRenderParametersByIdentifier =
3507 new HashMap<String, PublicRenderParameter>();
3508
3509 /**
3510 * Map of the supported public render parameters of the portlet keyed by the
3511 * QName.
3512 */
3513 private Map<String, PublicRenderParameter>
3514 _publicRenderParametersByQName =
3515 new HashMap<String, PublicRenderParameter>();
3516
3517 /**
3518 * The application this portlet belongs to.
3519 */
3520 private PortletApp _portletApp;
3521
3522 /**
3523 * The cloned instances of the portlet.
3524 */
3525 private Map<String, Portlet> _clonedInstances;
3526
3527 /**
3528 * True if the portlet is a static portlet that is cannot be moved.
3529 */
3530 private boolean _staticPortlet;
3531
3532 /**
3533 * True if the portlet is a static portlet at the start of a list of
3534 * portlets.
3535 */
3536 private boolean _staticPortletStart;
3537
3538 /**
3539 * True if the portlet is an undeployed portlet.
3540 */
3541 private boolean _undeployedPortlet = false;
3542
3543}