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