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