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