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