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