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