1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.model.impl;
24  
25  import com.liferay.portal.kernel.lar.PortletDataHandler;
26  import com.liferay.portal.kernel.plugin.PluginPackage;
27  import com.liferay.portal.kernel.pop.MessageListener;
28  import com.liferay.portal.kernel.portlet.ConfigurationAction;
29  import com.liferay.portal.kernel.portlet.FriendlyURLMapper;
30  import com.liferay.portal.kernel.portlet.PortletLayoutListener;
31  import com.liferay.portal.kernel.servlet.URLEncoder;
32  import com.liferay.portal.kernel.util.ContentTypes;
33  import com.liferay.portal.kernel.util.InstancePool;
34  import com.liferay.portal.kernel.util.StringMaker;
35  import com.liferay.portal.kernel.util.StringPool;
36  import com.liferay.portal.kernel.util.StringUtil;
37  import com.liferay.portal.kernel.util.Validator;
38  import com.liferay.portal.model.ActivityTrackerInterpreter;
39  import com.liferay.portal.model.PluginSetting;
40  import com.liferay.portal.model.Portlet;
41  import com.liferay.portal.model.PortletInfo;
42  import com.liferay.portal.model.User;
43  import com.liferay.portal.service.RoleLocalServiceUtil;
44  import com.liferay.portal.service.UserLocalServiceUtil;
45  import com.liferay.portal.servlet.PortletContextPool;
46  import com.liferay.portal.servlet.PortletContextWrapper;
47  import com.liferay.portal.util.PortalUtil;
48  import com.liferay.portal.util.PropsValues;
49  
50  import java.util.ArrayList;
51  import java.util.Collections;
52  import java.util.HashMap;
53  import java.util.HashSet;
54  import java.util.Hashtable;
55  import java.util.Iterator;
56  import java.util.LinkedHashMap;
57  import java.util.LinkedHashSet;
58  import java.util.List;
59  import java.util.Map;
60  import java.util.Set;
61  import java.util.TreeSet;
62  
63  import javax.portlet.PortletMode;
64  
65  import org.apache.commons.logging.Log;
66  import org.apache.commons.logging.LogFactory;
67  
68  /**
69   * <a href="PortletImpl.java.html"><b><i>View Source</i></b></a>
70   *
71   * @author Brian Wing Shun Chan
72   *
73   */
74  public class PortletImpl extends PortletModelImpl implements Portlet {
75  
76      /**
77       * Plugin type
78       */
79      public static final String PLUGIN_TYPE = "portlet";
80  
81      /**
82       * War file separator.
83       */
84      public static final String WAR_SEPARATOR = "_WAR_";
85  
86      /**
87       * Instance separator.
88       */
89      public static final String INSTANCE_SEPARATOR = "_INSTANCE_";
90  
91      /**
92       * Layout separator.
93       */
94      public static final String LAYOUT_SEPARATOR = "_LAYOUT_";
95  
96      /**
97       * Default preferences.
98       */
99      public static final String DEFAULT_PREFERENCES = "<portlet-preferences />";
100 
101     /**
102      * User principal strategy for screen name.
103      */
104     public static final String USER_PRINCIPAL_STRATEGY_SCREEN_NAME =
105         "screenName";
106 
107     /**
108      * User principal strategy for screen name.
109      */
110     public static final String USER_PRINCIPAL_STRATEGY_USER_ID = "userId";
111 
112     /**
113      * Gets the root portlet id of the portlet.
114      *
115      * @param       portletId the portlet id of the portlet
116      * @return      the root portlet id of the portlet
117      */
118     public static String getRootPortletId(String portletId) {
119         int pos = portletId.indexOf(INSTANCE_SEPARATOR);
120 
121         if (pos == -1) {
122             return portletId;
123         }
124         else {
125             return portletId.substring(0, pos);
126         }
127     }
128 
129     /**
130      * Gets the instance id of the portlet.
131      *
132      * @param       portletId the portlet id of the portlet
133      * @return      the instance id of the portlet
134      */
135     public static String getInstanceId(String portletId) {
136         int pos = portletId.indexOf(INSTANCE_SEPARATOR);
137 
138         if (pos == -1) {
139             return null;
140         }
141         else {
142             return portletId.substring(
143                 pos + INSTANCE_SEPARATOR.length(), portletId.length());
144         }
145     }
146 
147     /**
148      * Constructs a portlet with no parameters.
149      */
150     public PortletImpl() {
151     }
152 
153     /**
154      * Constructs a portlet with the specified parameters.
155      */
156     public PortletImpl(long companyId, String portletId) {
157         setCompanyId(companyId);
158         setPortletId(portletId);
159         setStrutsPath(portletId);
160         setActive(true);
161         _headerPortalCss = new ArrayList();
162         _headerPortletCss = new ArrayList();
163         _headerPortalJavaScript = new ArrayList();
164         _headerPortletJavaScript = new ArrayList();
165         _footerPortalCss = new ArrayList();
166         _footerPortletCss = new ArrayList();
167         _footerPortalJavaScript = new ArrayList();
168         _footerPortletJavaScript = new ArrayList();
169         _unlinkedRoles = new HashSet();
170         _roleMappers = new LinkedHashMap();
171         _initParams = new HashMap();
172         _portletModes = new HashMap();
173         _supportedLocales = new HashSet();
174         _userAttributes = new LinkedHashSet();
175         _customUserAttributes = new LinkedHashMap();
176     }
177 
178     /**
179      * Constructs a portlet with the specified parameters.
180      */
181     public PortletImpl(
182         String portletId, PluginPackage pluginPackage,
183         PluginSetting pluginSetting, long companyId, String icon,
184         String virtualPath, String strutsPath, String displayName,
185         String portletClass, String configurationActionClass,
186         String indexerClass, String openSearchClass, String schedulerClass,
187         String portletURLClass, String friendlyURLMapperClass,
188         String urlEncoderClass, String portletDataHandlerClass,
189         String portletLayoutListenerClass,
190         String activityTrackerInterpreterClass, String popMessageListenerClass,
191         String defaultPreferences, String prefsValidator,
192         boolean prefsCompanyWide, boolean prefsUniquePerLayout,
193         boolean prefsOwnedByGroup, boolean useDefaultTemplate,
194         boolean showPortletAccessDenied, boolean showPortletInactive,
195         boolean actionURLRedirect, boolean restoreCurrentView,
196         boolean maximizeEdit, boolean maximizeHelp, boolean popUpPrint,
197         boolean layoutCacheable, boolean instanceable,
198         String userPrincipalStrategy, boolean privateRequestAttributes,
199         boolean privateSessionAttributes, int renderWeight, boolean ajaxable,
200         List headerPortalCss, List headerPortletCss,
201         List headerPortalJavaScript, List headerPortletJavaScript,
202         List footerPortalCss, List footerPortletCss,
203         List footerPortalJavaScript, List footerPortletJavaScript,
204         String cssClassWrapper, boolean addDefaultResource, String roles,
205         Set unlinkedRoles, Map roleMappers, boolean system, boolean active,
206         boolean include, Map initParams, Integer expCache, Map portletModes,
207         Set supportedLocales, String resourceBundle, PortletInfo portletInfo,
208         Set userAttributes, Map customUserAttributes, String servletContextName,
209         List servletURLPatterns) {
210 
211         setPortletId(portletId);
212         _pluginPackage = pluginPackage;
213         _defaultPluginSetting = pluginSetting;
214         setCompanyId(companyId);
215         _icon = icon;
216         _virtualPath = virtualPath;
217         _strutsPath = strutsPath;
218         _displayName = displayName;
219         _portletClass = portletClass;
220         _configurationActionClass = configurationActionClass;
221         _indexerClass = indexerClass;
222         _openSearchClass = openSearchClass;
223         _schedulerClass = schedulerClass;
224         _portletURLClass = portletURLClass;
225         _friendlyURLMapperClass = friendlyURLMapperClass;
226         _urlEncoderClass = urlEncoderClass;
227         _portletDataHandlerClass = portletDataHandlerClass;
228         _portletLayoutListenerClass = portletLayoutListenerClass;
229         _activityTrackerInterpreterClass = activityTrackerInterpreterClass;
230         _popMessageListenerClass = popMessageListenerClass;
231         _defaultPreferences = defaultPreferences;
232         _prefsValidator = prefsValidator;
233         _prefsCompanyWide = prefsCompanyWide;
234         _prefsUniquePerLayout = prefsUniquePerLayout;
235         _prefsOwnedByGroup = prefsOwnedByGroup;
236         _useDefaultTemplate = useDefaultTemplate;
237         _showPortletAccessDenied = showPortletAccessDenied;
238         _showPortletInactive = showPortletInactive;
239         _actionURLRedirect = actionURLRedirect;
240         _restoreCurrentView = restoreCurrentView;
241         _maximizeEdit = maximizeEdit;
242         _maximizeHelp = maximizeHelp;
243         _popUpPrint = popUpPrint;
244         _layoutCacheable = layoutCacheable;
245         _instanceable = instanceable;
246         _userPrincipalStrategy = userPrincipalStrategy;
247         _privateRequestAttributes = privateRequestAttributes;
248         _privateSessionAttributes = privateSessionAttributes;
249         _renderWeight = renderWeight;
250         _ajaxable = ajaxable;
251         _headerPortalCss = headerPortalCss;
252         _headerPortletCss = headerPortletCss;
253         _headerPortalJavaScript = headerPortalJavaScript;
254         _headerPortletJavaScript = headerPortletJavaScript;
255         _footerPortalCss = footerPortalCss;
256         _footerPortletCss = footerPortletCss;
257         _footerPortalJavaScript = footerPortalJavaScript;
258         _footerPortletJavaScript = footerPortletJavaScript;
259         _cssClassWrapper = cssClassWrapper;
260         _addDefaultResource = addDefaultResource;
261         setRoles(roles);
262         _unlinkedRoles = unlinkedRoles;
263         _roleMappers = roleMappers;
264         _system = system;
265         setActive(active);
266         _include = include;
267         _initParams = initParams;
268         _expCache = expCache;
269         _portletModes = portletModes;
270         _supportedLocales = supportedLocales;
271         _resourceBundle = resourceBundle;
272         _portletInfo = portletInfo;
273         _userAttributes = userAttributes;
274         _customUserAttributes = customUserAttributes;
275         setServletContextName(servletContextName);
276         _servletURLPatterns = servletURLPatterns;
277 
278         if (_instanceable) {
279             _clonedInstances = new Hashtable();
280         }
281     }
282 
283     /**
284      * Gets the root portlet id of the portlet.
285      *
286      * @return      the root portlet id of the portlet
287      */
288     public String getRootPortletId() {
289         return getRootPortletId(getPortletId());
290     }
291 
292     /**
293      * Gets the instance id of the portlet.
294      *
295      * @return      the instance id of the portlet
296      */
297     public String getInstanceId() {
298         return getInstanceId(getPortletId());
299     }
300 
301     /**
302      * Gets the plugin id of the portlet.
303      *
304      * @return      the plugin id of the portlet
305      */
306     public String getPluginId() {
307         return getRootPortletId();
308     }
309 
310     /**
311      * Gets the plugin type of the portlet.
312      *
313      * @return      the plugin type of the portlet
314      */
315     public String getPluginType() {
316         return PLUGIN_TYPE;
317     }
318 
319     /**
320      * Get the package to which the portlet belongs to.
321      *
322      * @return      the plugin package of the portlet
323      */
324     public PluginPackage getPluginPackage() {
325         return _pluginPackage;
326     }
327 
328     /**
329      * Sets the plugin package to which this portlet belongs to.
330      *
331      * @param       pluginPackage the plugin package
332      */
333     public void setPluginPackage(PluginPackage pluginPackage) {
334         _pluginPackage = pluginPackage;
335     }
336 
337     /**
338      * Get the default plugin settings of the portlet.
339      *
340      * @return      the plugin settings
341      */
342     public PluginSetting getDefaultPluginSetting() {
343         return _defaultPluginSetting;
344     }
345 
346     /**
347      * Sets the default plugin settings of the portlet.
348      *
349      * @param       pluginSetting the plugin setting
350      */
351     public void setDefaultPluginSetting(PluginSetting pluginSetting) {
352         _defaultPluginSetting = pluginSetting;
353     }
354 
355     /**
356      * Gets the icon of the portlet.
357      *
358      * @return      the icon of the portlet
359      */
360     public String getIcon() {
361         return _icon;
362     }
363 
364     /**
365      * Sets the icon of the portlet.
366      *
367      * @param       icon the icon of the portlet
368      */
369     public void setIcon(String icon) {
370         _icon = icon;
371     }
372 
373     /**
374      * Gets the virtual path of the portlet.
375      *
376      * @return      the virtual path of the portlet
377      */
378     public String getVirtualPath() {
379         return _virtualPath;
380     }
381 
382     /**
383      * Sets the virtual path of the portlet.
384      *
385      * @param       virtualPath the virtual path of the portlet
386      */
387     public void setVirtualPath(String virtualPath) {
388         if (_warFile && Validator.isNull(virtualPath)) {
389             virtualPath = PropsValues.PORTLET_VIRTUAL_PATH;
390         }
391 
392         _virtualPath = virtualPath;
393     }
394 
395     /**
396      * Gets the struts path of the portlet.
397      *
398      * @return      the struts path of the portlet
399      */
400     public String getStrutsPath() {
401         return _strutsPath;
402     }
403 
404     /**
405      * Sets the struts path of the portlet.
406      *
407      * @param       strutsPath the struts path of the portlet
408      */
409     public void setStrutsPath(String strutsPath) {
410         _strutsPath = strutsPath;
411     }
412 
413     /**
414      * Gets the display name of the portlet.
415      *
416      * @return      the display name of the portlet
417      */
418     public String getDisplayName() {
419         return _displayName;
420     }
421 
422     /**
423      * Sets the display name of the portlet.
424      *
425      * @param       displayName the display name of the portlet
426      */
427     public void setDisplayName(String displayName) {
428         _displayName = displayName;
429     }
430 
431     /**
432      * Gets the name of the portlet class of the portlet.
433      *
434      * @return      the name of the portlet class of the portlet
435      */
436     public String getPortletClass() {
437         return _portletClass;
438     }
439 
440     /**
441      * Sets the name of the portlet class of the portlet.
442      *
443      * @param       portletClass the name of the portlet class of the portlet
444      */
445     public void setPortletClass(String portletClass) {
446         _portletClass = portletClass;
447     }
448 
449     /**
450      * Gets the configuration action class of the portlet.
451      *
452      * @return      the configuration action class of the portlet
453      */
454     public String getConfigurationActionClass() {
455         return _configurationActionClass;
456     }
457 
458     /**
459      * Sets the configuration action class of the portlet.
460      *
461      * @param       configurationActionClass the configuration action class of
462      *              the portlet
463      */
464     public void setConfigurationActionClass(String configurationActionClass) {
465         _configurationActionClass = configurationActionClass;
466     }
467 
468     /**
469      * Gets the configuration action instance of the portlet.
470      *
471      * @return      the configuration action instance of the portlet
472      */
473     public ConfigurationAction getConfigurationActionInstance() {
474         if (Validator.isNotNull(getConfigurationActionClass())) {
475             if (isWARFile()) {
476                 PortletContextWrapper pcw =
477                     PortletContextPool.get(getRootPortletId());
478 
479                 return pcw.getConfigurationActionInstance();
480             }
481             else {
482                 return (ConfigurationAction)InstancePool.get(
483                     getConfigurationActionClass());
484             }
485         }
486 
487         return null;
488     }
489 
490     /**
491      * Gets the name of the indexer class of the portlet.
492      *
493      * @return      the name of the indexer class of the portlet
494      */
495     public String getIndexerClass() {
496         return _indexerClass;
497     }
498 
499     /**
500      * Sets the name of the indexer class of the portlet.
501      *
502      * @param       indexerClass the name of the indexer class of the portlet
503      */
504     public void setIndexerClass(String indexerClass) {
505         _indexerClass = indexerClass;
506     }
507 
508     /**
509      * Gets the name of the open search class of the portlet.
510      *
511      * @return      the name of the open search class of the portlet
512      */
513     public String getOpenSearchClass() {
514         return _openSearchClass;
515     }
516 
517     /**
518      * Sets the name of the open search class of the portlet.
519      *
520      * @param       openSearchClass the name of the open search class of the
521      *              portlet
522      */
523     public void setOpenSearchClass(String openSearchClass) {
524         _openSearchClass = openSearchClass;
525     }
526 
527     /**
528      * Gets the name of the scheduler class of the portlet.
529      *
530      * @return      the name of the scheduler class of the portlet
531      */
532     public String getSchedulerClass() {
533         return _schedulerClass;
534     }
535 
536     /**
537      * Sets the name of the scheduler class of the portlet.
538      *
539      * @param       schedulerClass the name of the scheduler class of the
540      *              portlet
541      */
542     public void setSchedulerClass(String schedulerClass) {
543         _schedulerClass = schedulerClass;
544     }
545 
546     /**
547      * Gets the name of the portlet URL class of the portlet.
548      *
549      * @return      the name of the portlet URL class of the portlet
550      */
551     public String getPortletURLClass() {
552         return _portletURLClass;
553     }
554 
555     /**
556      * Sets the name of the portlet URL class of the portlet.
557      *
558      * @param       portletURLClass the name of the portlet URL class of the
559      *              portlet
560      */
561     public void setPortletURLClass(String portletURLClass) {
562         _portletURLClass = portletURLClass;
563     }
564 
565     /**
566      * Gets the name of the friendly URL mapper class of the portlet.
567      *
568      * @return      the name of the friendly URL mapper class of the portlet
569      */
570     public String getFriendlyURLMapperClass() {
571         return _friendlyURLMapperClass;
572     }
573 
574     /**
575      * Sets the name of the friendly URL mapper class of the portlet.
576      *
577      * @param       friendlyURLMapperClass the name of the friendly URL plugin
578      *              class of the portlet
579      */
580     public void setFriendlyURLMapperClass(String friendlyURLMapperClass) {
581         _friendlyURLMapperClass = friendlyURLMapperClass;
582     }
583 
584     /**
585      * Gets the friendly URL mapper instance of the portlet.
586      *
587      * @return      the friendly URL mapper instance of the portlet
588      */
589     public FriendlyURLMapper getFriendlyURLMapperInstance() {
590         if (Validator.isNotNull(getFriendlyURLMapperClass())) {
591             if (isWARFile()) {
592                 PortletContextWrapper pcw =
593                     PortletContextPool.get(getRootPortletId());
594 
595                 return pcw.getFriendlyURLMapperInstance();
596             }
597             else {
598                 return (FriendlyURLMapper)InstancePool.get(
599                     getFriendlyURLMapperClass());
600             }
601         }
602 
603         return null;
604     }
605 
606     /**
607      * Gets the name of the URL encoder class of the portlet.
608      *
609      * @return      the name of the URL encoder class of the portlet
610      */
611     public String getURLEncoderClass() {
612         return _urlEncoderClass;
613     }
614 
615     /**
616      * Sets the name of the URL encoder class of the portlet.
617      *
618      * @param       urlEncoderClass the name of the URL encoder class of the
619      *              portlet
620      */
621     public void setURLEncoderClass(String urlEncoderClass) {
622         _urlEncoderClass = urlEncoderClass;
623     }
624 
625     /**
626      * Gets the URL encoder instance of the portlet.
627      *
628      * @return      the URL encoder instance of the portlet
629      */
630     public URLEncoder getURLEncoderInstance() {
631         if (Validator.isNotNull(getURLEncoderClass())) {
632             if (isWARFile()) {
633                 PortletContextWrapper pcw =
634                     PortletContextPool.get(getRootPortletId());
635 
636                 return pcw.getURLEncoderInstance();
637             }
638             else {
639                 return (URLEncoder)InstancePool.get(getURLEncoderClass());
640             }
641         }
642 
643         return null;
644     }
645 
646     /**
647      * Gets the name of the portlet data handler class of the portlet.
648      *
649      * @return      the name of the portlet data handler class of the portlet
650      */
651     public String getPortletDataHandlerClass() {
652         return _portletDataHandlerClass;
653     }
654 
655     /**
656      * Sets the name of the portlet data handler class of the portlet.
657      *
658      * @param       portletDataHandlerClass the name of portlet data handler
659      *              class of the portlet
660      */
661     public void setPortletDataHandlerClass(String portletDataHandlerClass) {
662         _portletDataHandlerClass = portletDataHandlerClass;
663     }
664 
665     /**
666      * Gets the portlet data handler instance of the portlet.
667      *
668      * @return      the portlet data handler instance of the portlet
669      */
670     public PortletDataHandler getPortletDataHandlerInstance() {
671         if (Validator.isNotNull(getPortletDataHandlerClass())) {
672             if (isWARFile()) {
673                 PortletContextWrapper pcw =
674                     PortletContextPool.get(getRootPortletId());
675 
676                 return pcw.getPortletDataHandlerInstance();
677             }
678             else {
679                 return (PortletDataHandler)InstancePool.get(
680                     getPortletDataHandlerClass());
681             }
682         }
683 
684         return null;
685     }
686 
687     /**
688      * Gets the portlet layout listener of the portlet.
689      *
690      * @return      the name of the portlet layout listener class of the portlet
691      */
692     public PortletLayoutListener getPortletLayoutListener() {
693         if (Validator.isNull(getPortletLayoutListenerClass())) {
694             return null;
695         }
696 
697         return (PortletLayoutListener)InstancePool.get(
698             getPortletLayoutListenerClass());
699     }
700 
701     /**
702      * Gets the name of the portlet layout listener class of the portlet.
703      *
704      * @return      the name of the portlet layout listener class of the portlet
705      */
706     public String getPortletLayoutListenerClass() {
707         return _portletLayoutListenerClass;
708     }
709 
710     /**
711      * Sets the name of the portlet layout listener class of the portlet.
712      *
713      * @param       portletLayoutListenerClass the name of the portlet layout
714      *              listener class of the portlet
715      */
716     public void setPortletLayoutListenerClass(
717         String portletLayoutListenerClass) {
718 
719         _portletLayoutListenerClass = portletLayoutListenerClass;
720     }
721 
722     /**
723      * Gets the name of the activity tracker interpreter class of the portlet.
724      *
725      * @return      the name of the activity tracker interpreter class of the
726      *              portlet
727      */
728     public String getActivityTrackerInterpreterClass() {
729         return _activityTrackerInterpreterClass;
730     }
731 
732     /**
733      * Sets the name of the activity tracker interpreter class of the portlet.
734      *
735      * @param       activityTrackerInterpreterClass the name of the activity
736      *              tracker interpreter class of the portlet
737      */
738     public void setActivityTrackerInterpreterClass(
739         String activityTrackerInterpreterClass) {
740 
741         _activityTrackerInterpreterClass = activityTrackerInterpreterClass;
742     }
743 
744     /**
745      * Gets the name of the activity tracker interpreter instance of the
746      * portlet.
747      *
748      * @return      the name of the activity tracker interpreter instance of the
749      *              portlet
750      */
751     public ActivityTrackerInterpreter getActivityTrackerInterpreterInstance() {
752         if (Validator.isNotNull(getActivityTrackerInterpreterClass())) {
753             if (isWARFile()) {
754                 PortletContextWrapper pcw =
755                     PortletContextPool.get(getRootPortletId());
756 
757                 return pcw.getActivityTrackerInterpreterInstance();
758             }
759             else {
760                 return (ActivityTrackerInterpreter)InstancePool.get(
761                     getActivityTrackerInterpreterClass());
762             }
763         }
764 
765         return null;
766     }
767 
768     /**
769      * Gets the name of the POP message listener class of the portlet.
770      *
771      * @return      the name of the POP message listener class of the portlet
772      */
773     public String getPopMessageListenerClass() {
774         return _popMessageListenerClass;
775     }
776 
777     /**
778      * Sets the name of the POP message listener class of the portlet.
779      *
780      * @param       popMessageListenerClass the name of the POP message listener
781      *              class of the portlet
782      */
783     public void setPopMessageListenerClass(String popMessageListenerClass) {
784         _popMessageListenerClass = popMessageListenerClass;
785     }
786 
787     /**
788      * Gets the POP message listener instance of the portlet.
789      *
790      * @return      the POP message listener instance of the portlet
791      */
792     public MessageListener getPopMessageListenerInstance() {
793         if (Validator.isNotNull(getPopMessageListenerClass())) {
794             if (isWARFile()) {
795                 PortletContextWrapper pcw =
796                     PortletContextPool.get(getRootPortletId());
797 
798                 return pcw.getPopMessageListenerInstance();
799             }
800             else {
801                 return (MessageListener)InstancePool.get(
802                     getPopMessageListenerClass());
803             }
804         }
805 
806         return null;
807     }
808 
809     /**
810      * Gets the default preferences of the portlet.
811      *
812      * @return      the default preferences of the portlet
813      */
814     public String getDefaultPreferences() {
815         if (Validator.isNull(_defaultPreferences)) {
816             return DEFAULT_PREFERENCES;
817         }
818         else {
819             return _defaultPreferences;
820         }
821     }
822 
823     /**
824      * Sets the default preferences of the portlet.
825      *
826      * @param       defaultPreferences the default preferences of the portlet
827      */
828     public void setDefaultPreferences(String defaultPreferences) {
829         _defaultPreferences = defaultPreferences;
830     }
831 
832     /**
833      * Gets the name of the preferences validator class of the portlet.
834      *
835      * @return      the name of the preferences validator class of the portlet
836      */
837     public String getPreferencesValidator() {
838         return _prefsValidator;
839     }
840 
841     /**
842      * Sets the name of the preferences validator class of the portlet.
843      *
844      * @param       prefsValidator the name of the preferences validator class
845      *              of the portlet
846      */
847     public void setPreferencesValidator(String prefsValidator) {
848         if (prefsValidator != null) {
849 
850             // Trim this because XDoclet generates preferences validators with
851             // extra white spaces
852 
853             _prefsValidator = prefsValidator.trim();
854         }
855         else {
856             _prefsValidator = null;
857         }
858     }
859 
860     /**
861      * Returns true if preferences are shared across the entire company.
862      *
863      * @return      true if preferences are shared across the entire company
864      */
865     public boolean getPreferencesCompanyWide() {
866         return _prefsCompanyWide;
867     }
868 
869     /**
870      * Returns true if preferences are shared across the entire company.
871      *
872      * @return      true if preferences are shared across the entire company
873      */
874     public boolean isPreferencesCompanyWide() {
875         return _prefsCompanyWide;
876     }
877 
878     /**
879      * Sets to true if preferences are shared across the entire company.
880      *
881      * @param       prefsCompanyWide boolean value for whether preferences
882      *              are shared across the entire company
883      */
884     public void setPreferencesCompanyWide(boolean prefsCompanyWide) {
885         _prefsCompanyWide = prefsCompanyWide;
886     }
887 
888     /**
889      * Returns true if preferences are unique per layout.
890      *
891      * @return      true if preferences are unique per layout
892      */
893     public boolean getPreferencesUniquePerLayout() {
894         return _prefsUniquePerLayout;
895     }
896 
897     /**
898      * Returns true if preferences are unique per layout.
899      *
900      * @return      true if preferences are unique per layout
901      */
902     public boolean isPreferencesUniquePerLayout() {
903         return _prefsUniquePerLayout;
904     }
905 
906     /**
907      * Sets to true if preferences are unique per layout.
908      *
909      * @param       prefsUniquePerLayout boolean value for whether preferences
910      *              are unique per layout
911      */
912     public void setPreferencesUniquePerLayout(boolean prefsUniquePerLayout) {
913         _prefsUniquePerLayout = prefsUniquePerLayout;
914     }
915 
916     /**
917      * Returns true if preferences are owned by the group when the portlet is
918      * shown in a group layout. Returns false if preferences are owned by the
919      * user at all times.
920      *
921      * @return      true if preferences are owned by the group when the portlet
922      *              is shown in a group layout; false if preferences are owned
923      *              by the user at all times.
924      */
925     public boolean getPreferencesOwnedByGroup() {
926         return _prefsOwnedByGroup;
927     }
928 
929     /**
930      * Returns true if preferences are owned by the group when the portlet is
931      * shown in a group layout. Returns false if preferences are owned by the
932      * user at all times.
933      *
934      * @return      true if preferences are owned by the group when the portlet
935      *              is shown in a group layout; false if preferences are owned
936      *              by the user at all times.
937      */
938     public boolean isPreferencesOwnedByGroup() {
939         return _prefsOwnedByGroup;
940     }
941 
942     /**
943      * Sets to true if preferences are owned by the group when the portlet is
944      * shown in a group layout. Sets to false if preferences are owned by the
945      * user at all times.
946      *
947      * @param       prefsOwnedByGroup boolean value for whether preferences are
948      *              owned by the group when the portlet is shown in a group
949      *              layout or preferences are owned by the user at all times
950      */
951     public void setPreferencesOwnedByGroup(boolean prefsOwnedByGroup) {
952         _prefsOwnedByGroup = prefsOwnedByGroup;
953     }
954 
955     /**
956      * Returns true if the portlet uses the default template.
957      *
958      * @return      true if the portlet uses the default template
959      */
960     public boolean getUseDefaultTemplate() {
961         return _useDefaultTemplate;
962     }
963 
964     /**
965      * Returns true if the portlet uses the default template.
966      *
967      * @return      true if the portlet uses the default template
968      */
969     public boolean isUseDefaultTemplate() {
970         return _useDefaultTemplate;
971     }
972 
973     /**
974      * Sets to true if the portlet uses the default template.
975      *
976      * @param       useDefaultTemplate boolean value for whether the portlet
977      *              uses the default template
978      */
979     public void setUseDefaultTemplate(boolean useDefaultTemplate) {
980         _useDefaultTemplate = useDefaultTemplate;
981     }
982 
983     /**
984      * Returns true if users are shown that they do not have access to the
985      * portlet.
986      *
987      * @return      true if users are shown that they do not have access to the
988      *              portlet
989      */
990     public boolean getShowPortletAccessDenied() {
991         return _showPortletAccessDenied;
992     }
993 
994     /**
995      * Returns true if users are shown that they do not have access to the
996      * portlet.
997      *
998      * @return      true if users are shown that they do not have access to the
999      *              portlet
1000     */
1001    public boolean isShowPortletAccessDenied() {
1002        return _showPortletAccessDenied;
1003    }
1004
1005    /**
1006     * Sets to true if users are shown that they do not have access to the
1007     * portlet.
1008     *
1009     * @param       showPortletAccessDenied boolean value for whether users are
1010     *              shown that they do not have access to the portlet
1011     */
1012    public void setShowPortletAccessDenied(boolean showPortletAccessDenied) {
1013        _showPortletAccessDenied = showPortletAccessDenied;
1014    }
1015
1016    /**
1017     * Returns true if users are shown that the portlet is inactive.
1018     *
1019     * @return      true if users are shown that the portlet is inactive
1020     */
1021    public boolean getShowPortletInactive() {
1022        return _showPortletInactive;
1023    }
1024
1025    /**
1026     * Returns true if users are shown that the portlet is inactive.
1027     *
1028     * @return      true if users are shown that the portlet is inactive
1029     */
1030    public boolean isShowPortletInactive() {
1031        return _showPortletInactive;
1032    }
1033
1034    /**
1035     * Sets to true if users are shown that the portlet is inactive.
1036     *
1037     * @param       showPortletInactive boolean value for whether users are
1038     *              shown that the portlet is inactive
1039     */
1040    public void setShowPortletInactive(boolean showPortletInactive) {
1041        _showPortletInactive = showPortletInactive;
1042    }
1043
1044    /**
1045     * Returns true if an action URL for this portlet should cause an auto
1046     * redirect.
1047     *
1048     * @return      true if an action URL for this portlet should cause an auto
1049     *              redirect
1050     */
1051    public boolean getActionURLRedirect() {
1052        return _actionURLRedirect;
1053    }
1054
1055    /**
1056     * Returns true if an action URL for this portlet should cause an auto
1057     * redirect.
1058     *
1059     * @return      true if an action URL for this portlet should cause an auto
1060     *              redirect
1061     */
1062    public boolean isActionURLRedirect() {
1063        return _actionURLRedirect;
1064    }
1065
1066    /**
1067     * Sets to true if an action URL for this portlet should cause an auto
1068     * redirect.
1069     *
1070     * @param       actionURLRedirect boolean value for whether an action URL
1071     *              for this portlet should cause an auto redirect
1072     */
1073    public void setActionURLRedirect(boolean actionURLRedirect) {
1074        _actionURLRedirect = actionURLRedirect;
1075    }
1076
1077    /**
1078     * Returns true if the portlet restores to the current view from the
1079     * maximized state.
1080     *
1081     * @return      true if the portlet restores to the current view from the
1082     *              maximized state
1083     */
1084    public boolean getRestoreCurrentView() {
1085        return _restoreCurrentView;
1086    }
1087
1088    /**
1089     * Returns true if the portlet restores to the current view from the
1090     * maximized state.
1091     *
1092     * @return      true if the portlet restores to the current view from the
1093     *              maximized state
1094     */
1095    public boolean isRestoreCurrentView() {
1096        return _restoreCurrentView;
1097    }
1098
1099    /**
1100     * Sets to true if the portlet restores to the current view from the
1101     * maximized state.
1102     *
1103     * @param       restoreCurrentView boolean value for whether the portlet
1104     *              restores to the current view from the maximized state
1105     */
1106    public void setRestoreCurrentView(boolean restoreCurrentView) {
1107        _restoreCurrentView = restoreCurrentView;
1108    }
1109
1110    /**
1111     * Returns true if the portlet goes into the maximized state when the user
1112     * goes into the edit mode.
1113     *
1114     * @return      true if the portlet goes into the maximized state when the
1115     *              user goes into the edit mode
1116     */
1117    public boolean getMaximizeEdit() {
1118        return _maximizeEdit;
1119    }
1120
1121    /**
1122     * Returns true if the portlet goes into the maximized state when the user
1123     * goes into the edit mode.
1124     *
1125     * @return      true if the portlet goes into the maximized state when the
1126     *              user goes into the edit mode
1127     */
1128    public boolean isMaximizeEdit() {
1129        return _maximizeEdit;
1130    }
1131
1132    /**
1133     * Sets to true if the portlet goes into the maximized state when the user
1134     * goes into the edit mode.
1135     *
1136     * @param       maximizeEdit boolean value for whether the portlet goes into
1137     *              the maximized state when the user goes into the edit mode
1138     */
1139    public void setMaximizeEdit(boolean maximizeEdit) {
1140        _maximizeEdit = maximizeEdit;
1141    }
1142
1143    /**
1144     * Returns true if the portlet goes into the maximized state when the user
1145     * goes into the help mode.
1146     *
1147     * @return      true if the portlet goes into the maximized state when the
1148     *              user goes into the help mode
1149     */
1150    public boolean getMaximizeHelp() {
1151        return _maximizeHelp;
1152    }
1153
1154    /**
1155     * Returns true if the portlet goes into the maximized state when the user
1156     * goes into the help mode.
1157     *
1158     * @return      true if the portlet goes into the maximized state when the
1159     *              user goes into the help mode
1160     */
1161    public boolean isMaximizeHelp() {
1162        return _maximizeHelp;
1163    }
1164
1165    /**
1166     * Sets to true if the portlet goes into the maximized state when the user
1167     * goes into the help mode.
1168     *
1169     * @param       maximizeHelp boolean value for whether the portlet goes into
1170     *              the maximized state when the user goes into the help mode
1171     */
1172    public void setMaximizeHelp(boolean maximizeHelp) {
1173        _maximizeHelp = maximizeHelp;
1174    }
1175
1176    /**
1177     * Returns true if the portlet goes into the pop up state when the user goes
1178     * into the print mode.
1179     *
1180     * @return      true if the portlet goes into the pop up state when the user
1181     *              goes into the print mode
1182     */
1183    public boolean getPopUpPrint() {
1184        return _popUpPrint;
1185    }
1186
1187    /**
1188     * Returns true if the portlet goes into the pop up state when the user goes
1189     * into the print mode.
1190     *
1191     * @return      true if the portlet goes into the pop up state when the user
1192     *              goes into the print mode
1193     */
1194    public boolean isPopUpPrint() {
1195        return _popUpPrint;
1196    }
1197
1198    /**
1199     * Sets to true if the portlet goes into the pop up state when the user goes
1200     * into the print mode.
1201     *
1202     * @param       popUpPrint boolean value for whether the portlet goes into
1203     *              the pop up state when the user goes into the print mode
1204     */
1205    public void setPopUpPrint(boolean popUpPrint) {
1206        _popUpPrint = popUpPrint;
1207    }
1208
1209    /**
1210     * Returns true to allow the portlet to be cached within the layout.
1211     *
1212     * @return      true if the portlet can be cached within the layout
1213     */
1214    public boolean getLayoutCacheable() {
1215        return _layoutCacheable;
1216    }
1217
1218    /**
1219     * Returns true to allow the portlet to be cached within the layout.
1220     *
1221     * @return      true if the portlet can be cached within the layout
1222     */
1223    public boolean isLayoutCacheable() {
1224        return _layoutCacheable;
1225    }
1226
1227    /**
1228     * Sets to true to allow the portlet to be cached within the layout.
1229     *
1230     * @param   layoutCacheable boolean value for whether the portlet can be
1231     *          cached within the layout
1232     */
1233    public void setLayoutCacheable(boolean layoutCacheable) {
1234        _layoutCacheable = layoutCacheable;
1235    }
1236
1237    /**
1238     * Returns true if the portlet can be added multiple times to a layout.
1239     *
1240     * @return      true if the portlet can be added multiple times to a layout
1241     */
1242    public boolean getInstanceable() {
1243        return _instanceable;
1244    }
1245
1246    /**
1247     * Returns true if the portlet can be added multiple times to a layout.
1248     *
1249     * @return      true if the portlet can be added multiple times to a layout
1250     */
1251    public boolean isInstanceable() {
1252        return _instanceable;
1253    }
1254
1255    /**
1256     * Sets to true if the portlet can be added multiple times to a layout.
1257     *
1258     * @param       instanceable boolean value for whether the portlet can be
1259     *              added multiple times to a layout
1260     */
1261    public void setInstanceable(boolean instanceable) {
1262        _instanceable = instanceable;
1263    }
1264
1265    /**
1266     * Gets the user principal strategy of the portlet.
1267     *
1268     * @return      the user principal strategy of the portlet
1269     */
1270    public String getUserPrincipalStrategy() {
1271        return _userPrincipalStrategy;
1272    }
1273
1274    /**
1275     * Sets the user principal strategy of the portlet.
1276     *
1277     * @param       userPrincipalStrategy the user principal strategy of the
1278     *              portlet
1279     */
1280    public void setUserPrincipalStrategy(String userPrincipalStrategy) {
1281        if (Validator.isNotNull(userPrincipalStrategy)) {
1282            _userPrincipalStrategy = userPrincipalStrategy;
1283        }
1284    }
1285
1286    /**
1287     * Returns true if the portlet does not share request attributes with the
1288     * portal or portlets from another WAR.
1289     *
1290     * @return      true if the portlet does not share request attributes with
1291     *              the portal or portlets from another WAR
1292     */
1293    public boolean getPrivateRequestAttributes() {
1294        return _privateRequestAttributes;
1295    }
1296
1297    /**
1298     * Returns true if the portlet does not share request attributes with the
1299     * portal or portlets from another WAR.
1300     *
1301     * @return      true if the portlet does not share request attributes with
1302     *              the portal or portlets from another WAR
1303     */
1304    public boolean isPrivateRequestAttributes() {
1305        return _privateRequestAttributes;
1306    }
1307
1308    /**
1309     * Sets to true if the portlet does not share request attributes with the
1310     * portal or portlets from another WAR.
1311     *
1312     * @param       privateRequestAttributes boolean value for whether the
1313     *              portlet shares request attributes with the portal or
1314     *              portlets from another WAR
1315     */
1316    public void setPrivateRequestAttributes(boolean privateRequestAttributes) {
1317        _privateRequestAttributes = privateRequestAttributes;
1318    }
1319
1320    /**
1321     * Returns true if the portlet does not share session attributes with the
1322     * portal.
1323     *
1324     * @return      true if the portlet does not share session attributes with
1325     *              the portal
1326     */
1327    public boolean getPrivateSessionAttributes() {
1328        return _privateSessionAttributes;
1329    }
1330
1331    /**
1332     * Returns true if the portlet does not share session attributes with the
1333     * portal.
1334     *
1335     * @return      true if the portlet does not share session attributes with
1336     *              the portal
1337     */
1338    public boolean isPrivateSessionAttributes() {
1339        return _privateSessionAttributes;
1340    }
1341
1342    /**
1343     * Sets to true if the portlet does not share session attributes with the
1344     * portal.
1345     *
1346     * @param       privateSessionAttributes boolean value for whether the
1347     *              portlet shares session attributes with the portal
1348     */
1349    public void setPrivateSessionAttributes(boolean privateSessionAttributes) {
1350        _privateSessionAttributes = privateSessionAttributes;
1351    }
1352
1353    /**
1354     * Returns the render weight of the portlet.
1355     *
1356     * @return      the render weight of the portlet
1357     */
1358    public int getRenderWeight() {
1359        return _renderWeight;
1360    }
1361
1362    /**
1363     * Sets the render weight of the portlet.
1364     *
1365     * @param       renderWeight int value for the render weight of the portlet
1366     */
1367    public void setRenderWeight(int renderWeight) {
1368        _renderWeight = renderWeight;
1369    }
1370
1371    /**
1372     * Returns true if the portlet can be displayed via Ajax.
1373     *
1374     * @return      true if the portlet can be displayed via Ajax
1375     */
1376    public boolean getAjaxable() {
1377        return _ajaxable;
1378    }
1379
1380    /**
1381     * Returns true if the portlet can be displayed via Ajax.
1382     *
1383     * @return      true if the portlet can be displayed via Ajax
1384     */
1385    public boolean isAjaxable() {
1386        return _ajaxable;
1387    }
1388
1389    /**
1390     * Sets to true if the portlet can be displayed via Ajax.
1391     *
1392     * @param       ajaxable boolean value for whether the portlet can be
1393     *              displayed via Ajax
1394     */
1395    public void setAjaxable(boolean ajaxable) {
1396        _ajaxable = ajaxable;
1397    }
1398
1399    /**
1400     * Gets a list of CSS files that will be referenced from the page's header
1401     * relative to the portal's context path.
1402     *
1403     * @return      a list of CSS files that will be referenced from the page's
1404     *              header relative to the portal's context path
1405     */
1406    public List getHeaderPortalCss() {
1407        return _headerPortalCss;
1408    }
1409
1410    /**
1411     * Sets a list of CSS files that will be referenced from the page's header
1412     * relative to the portal's context path.
1413     *
1414     * @param       headerPortalCss a list of CSS files that will be referenced
1415     *              from the page's header relative to the portal's context path
1416     */
1417    public void setHeaderPortalCss(List headerPortalCss) {
1418        _headerPortalCss = headerPortalCss;
1419    }
1420
1421    /**
1422     * Gets a list of CSS files that will be referenced from the page's header
1423     * relative to the portlet's context path.
1424     *
1425     * @return      a list of CSS files that will be referenced from the page's
1426     *              header relative to the portlet's context path
1427     */
1428    public List getHeaderPortletCss() {
1429        return _headerPortletCss;
1430    }
1431
1432    /**
1433     * Sets a list of CSS files that will be referenced from the page's header
1434     * relative to the portlet's context path.
1435     *
1436     * @param       headerPortletCss a list of CSS files that will be referenced
1437     *              from the page's header relative to the portlet's context
1438     *              path
1439     */
1440    public void setHeaderPortletCss(List headerPortletCss) {
1441        _headerPortletCss = headerPortletCss;
1442    }
1443
1444    /**
1445     * Gets a list of JavaScript files that will be referenced from the page's
1446     * header relative to the portal's context path.
1447     *
1448     * @return      a list of JavaScript files that will be referenced from the
1449     *              page's header relative to the portal's context path
1450     */
1451    public List getHeaderPortalJavaScript() {
1452        return _headerPortalJavaScript;
1453    }
1454
1455    /**
1456     * Sets a list of JavaScript files that will be referenced from the page's
1457     * header relative to the portal's context path.
1458     *
1459     * @param       headerPortalJavaScript a list of JavaScript files that will
1460     *              be referenced from the page's header relative to the
1461     *              portal's context path
1462     */
1463    public void setHeaderPortalJavaScript(List headerPortalJavaScript) {
1464        _headerPortalJavaScript = headerPortalJavaScript;
1465    }
1466
1467    /**
1468     * Gets a list of JavaScript files that will be referenced from the page's
1469     * header relative to the portlet's context path.
1470     *
1471     * @return      a list of JavaScript files that will be referenced from the
1472     *              page's header relative to the portlet's context path
1473     */
1474    public List getHeaderPortletJavaScript() {
1475        return _headerPortletJavaScript;
1476    }
1477
1478    /**
1479     * Sets a list of JavaScript files that will be referenced from the page's
1480     * header relative to the portlet's context path.
1481     *
1482     * @param       headerPortletJavaScript a list of JavaScript files that will
1483     *              be referenced from the page's header relative to the
1484     *              portlet's context path
1485     */
1486    public void setHeaderPortletJavaScript(List headerPortletJavaScript) {
1487        _headerPortletJavaScript = headerPortletJavaScript;
1488    }
1489
1490    /**
1491     * Gets a list of CSS files that will be referenced from the page's footer
1492     * relative to the portal's context path.
1493     *
1494     * @return      a list of CSS files that will be referenced from the page's
1495     *              footer relative to the portal's context path
1496     */
1497    public List getFooterPortalCss() {
1498        return _footerPortalCss;
1499    }
1500
1501    /**
1502     * Sets a list of CSS files that will be referenced from the page's footer
1503     * relative to the portal's context path.
1504     *
1505     * @param       footerPortalCss a list of CSS files that will be referenced
1506     *              from the page's footer relative to the portal's context path
1507     */
1508    public void setFooterPortalCss(List footerPortalCss) {
1509        _footerPortalCss = footerPortalCss;
1510    }
1511
1512    /**
1513     * Gets a list of CSS files that will be referenced from the page's footer
1514     * relative to the portlet's context path.
1515     *
1516     * @return      a list of CSS files that will be referenced from the page's
1517     *              footer relative to the portlet's context path
1518     */
1519    public List getFooterPortletCss() {
1520        return _footerPortletCss;
1521    }
1522
1523    /**
1524     * Sets a list of CSS files that will be referenced from the page's footer
1525     * relative to the portlet's context path.
1526     *
1527     * @param       footerPortletCss a list of CSS files that will be referenced
1528     *              from the page's footer relative to the portlet's context
1529     *              path
1530     */
1531    public void setFooterPortletCss(List footerPortletCss) {
1532        _footerPortletCss = footerPortletCss;
1533    }
1534
1535    /**
1536     * Gets a list of JavaScript files that will be referenced from the page's
1537     * footer relative to the portal's context path.
1538     *
1539     * @return      a list of JavaScript files that will be referenced from the
1540     *              page's footer relative to the portal's context path
1541     */
1542    public List getFooterPortalJavaScript() {
1543        return _footerPortalJavaScript;
1544    }
1545
1546    /**
1547     * Sets a list of JavaScript files that will be referenced from the page's
1548     * footer relative to the portal's context path.
1549     *
1550     * @param       footerPortalJavaScript a list of JavaScript files that will
1551     *              be referenced from the page's footer relative to the
1552     *              portal's context path
1553     */
1554    public void setFooterPortalJavaScript(List footerPortalJavaScript) {
1555        _footerPortalJavaScript = footerPortalJavaScript;
1556    }
1557
1558    /**
1559     * Gets a list of JavaScript files that will be referenced from the page's
1560     * footer relative to the portlet's context path.
1561     *
1562     * @return      a list of JavaScript files that will be referenced from the
1563     *              page's footer relative to the portlet's context path
1564     */
1565    public List getFooterPortletJavaScript() {
1566        return _footerPortletJavaScript;
1567    }
1568
1569    /**
1570     * Sets a list of JavaScript files that will be referenced from the page's
1571     * footer relative to the portlet's context path.
1572     *
1573     * @param       footerPortletJavaScript a list of JavaScript files that will
1574     *              be referenced from the page's footer relative to the
1575     *              portlet's context path
1576     */
1577    public void setFooterPortletJavaScript(List footerPortletJavaScript) {
1578        _footerPortletJavaScript = footerPortletJavaScript;
1579    }
1580
1581    /**
1582     * Gets the name of the CSS class that will be injected in the DIV that
1583     * wraps this portlet.
1584     *
1585     * @return      the name of the CSS class that will be injected in the DIV
1586     *              that wraps this portlet
1587     */
1588    public String getCssClassWrapper() {
1589        return _cssClassWrapper;
1590    }
1591
1592    /**
1593     * Sets the name of the CSS class that will be injected in the DIV that
1594     * wraps this portlet.
1595     *
1596     * @param       cssClassWrapper the name of the CSS class that will be
1597     *              injected in the DIV that wraps this portlet
1598     */
1599    public void setCssClassWrapper(String cssClassWrapper) {
1600        _cssClassWrapper = cssClassWrapper;
1601    }
1602
1603    /**
1604     * Returns true if default resources for the portlet are added to a page.
1605     *
1606     * @return      true if default resources for the portlet are added to a
1607     *              page
1608     */
1609    public boolean getAddDefaultResource() {
1610        return _addDefaultResource;
1611    }
1612
1613    /**
1614     * Returns true if default resources for the portlet are added to a page.
1615     *
1616     * @return      true if default resources for the portlet are added to a
1617     *              page
1618     */
1619    public boolean isAddDefaultResource() {
1620        return _addDefaultResource;
1621    }
1622
1623    /**
1624     * Sets to true if default resources for the portlet are added to a page.
1625     *
1626     * @param       addDefaultResource boolean value for whether or not default
1627     *              resources for the portlet are added to a page
1628     */
1629    public void setAddDefaultResource(boolean addDefaultResource) {
1630        _addDefaultResource = addDefaultResource;
1631    }
1632
1633    /**
1634     * Sets a string of ordered comma delimited portlet ids.
1635     *
1636     * @param       roles a string of ordered comma delimited portlet ids
1637     */
1638    public void setRoles(String roles) {
1639        _rolesArray = StringUtil.split(roles);
1640
1641        super.setRoles(roles);
1642    }
1643
1644    /**
1645     * Gets an array of required roles of the portlet.
1646     *
1647     * @return      an array of required roles of the portlet
1648     */
1649    public String[] getRolesArray() {
1650        return _rolesArray;
1651    }
1652
1653    /**
1654     * Sets an array of required roles of the portlet.
1655     *
1656     * @param       rolesArray an array of required roles of the portlet
1657     */
1658    public void setRolesArray(String[] rolesArray) {
1659        _rolesArray = rolesArray;
1660
1661        super.setRoles(StringUtil.merge(rolesArray));
1662    }
1663
1664    /**
1665     * Gets the unlinked roles of the portlet.
1666     *
1667     * @return      unlinked roles of the portlet
1668     */
1669    public Set getUnlinkedRoles() {
1670        return _unlinkedRoles;
1671    }
1672
1673    /**
1674     * Sets the unlinked roles of the portlet.
1675     *
1676     * @param       unlinkedRoles the unlinked roles of the portlet
1677     */
1678    public void setUnlinkedRoles(Set unlinkedRoles) {
1679        _unlinkedRoles = unlinkedRoles;
1680    }
1681
1682    /**
1683     * Gets the role mappers of the portlet.
1684     *
1685     * @return      role mappers of the portlet
1686     */
1687    public Map getRoleMappers() {
1688        return _roleMappers;
1689    }
1690
1691    /**
1692     * Sets the role mappers of the portlet.
1693     *
1694     * @param       roleMappers the role mappers of the portlet
1695     */
1696    public void setRoleMappers(Map roleMappers) {
1697        _roleMappers = roleMappers;
1698    }
1699
1700    /**
1701     * Link the role names set in portlet.xml with the Liferay roles set in
1702     * liferay-portlet.xml.
1703     */
1704    public void linkRoles() {
1705        List linkedRoles = new ArrayList();
1706
1707        Iterator itr = _unlinkedRoles.iterator();
1708
1709        while (itr.hasNext()) {
1710            String unlinkedRole = (String)itr.next();
1711
1712            String roleLink = (String)_roleMappers.get(unlinkedRole);
1713
1714            if (Validator.isNotNull(roleLink)) {
1715                if (_log.isDebugEnabled()) {
1716                    _log.debug(
1717                        "Linking role for portlet [" + getPortletId() +
1718                            "] with role-name [" + unlinkedRole +
1719                                "] to role-link [" + roleLink + "]");
1720                }
1721
1722                linkedRoles.add(roleLink);
1723            }
1724            else {
1725                _log.error(
1726                    "Unable to link role for portlet [" + getPortletId() +
1727                        "] with role-name [" + unlinkedRole +
1728                            "] because role-link is null");
1729            }
1730        }
1731
1732        Collections.sort(linkedRoles);
1733
1734        setRolesArray((String[])linkedRoles.toArray(new String[0]));
1735    }
1736
1737    /**
1738     * Returns true if the portlet has a role with the specified name.
1739     *
1740     * @return      true if the portlet has a role with the specified name
1741     */
1742    public boolean hasRoleWithName(String roleName) {
1743        for (int i = 0; i < _rolesArray.length; i++) {
1744            if (_rolesArray[i].equalsIgnoreCase(roleName)) {
1745                return true;
1746            }
1747        }
1748
1749        return false;
1750    }
1751
1752    /**
1753     * Returns true if the user has the permission to add the portlet to a
1754     * layout.
1755     *
1756     * @return      true if the user has the permission to add the portlet to a
1757     *              layout
1758     */
1759    public boolean hasAddPortletPermission(long userId) {
1760        try {
1761            if (_rolesArray.length == 0) {
1762                return true;
1763            }
1764            else if (RoleLocalServiceUtil.hasUserRoles(
1765                        userId, getCompanyId(), _rolesArray, true)) {
1766
1767                return true;
1768            }
1769            else if (RoleLocalServiceUtil.hasUserRole(
1770                        userId, getCompanyId(), RoleImpl.ADMINISTRATOR, true)) {
1771
1772                return true;
1773            }
1774            else {
1775                User user = UserLocalServiceUtil.getUserById(userId);
1776
1777                if (user.isDefaultUser() && hasRoleWithName(RoleImpl.GUEST)) {
1778                    return true;
1779                }
1780            }
1781        }
1782        catch (Exception e) {
1783            _log.error(e);
1784        }
1785
1786        return false;
1787    }
1788
1789    /**
1790     * Returns true if the portlet is a system portlet that a user cannot
1791     * manually add to their page.
1792     *
1793     * @return      true if the portlet is a system portlet that a user cannot
1794     *              manually add to their page
1795     */
1796    public boolean getSystem() {
1797        return _system;
1798    }
1799
1800    /**
1801     * Returns true if the portlet is a system portlet that a user cannot
1802     * manually add to their page.
1803     *
1804     * @return      true if the portlet is a system portlet that a user cannot
1805     *              manually add to their page
1806     */
1807    public boolean isSystem() {
1808        return _system;
1809    }
1810
1811    /**
1812     * Sets to true if the portlet is a system portlet that a user cannot
1813     * manually add to their page.
1814     *
1815     * @param       system boolean value for whether the portlet is a system
1816     *              portlet that a user cannot manually add to their page
1817     */
1818    public void setSystem(boolean system) {
1819        _system = system;
1820    }
1821
1822    /**
1823     * Returns true to include the portlet and make it available to be made
1824     * active.
1825     *
1826     * @return      true to include the portlet and make it available to be made
1827     *              active
1828     */
1829    public boolean getInclude() {
1830        return _include;
1831    }
1832
1833    /**
1834     * Returns true to include the portlet and make it available to be made
1835     * active.
1836     *
1837     * @return      true to include the portlet and make it available to be made
1838     *              active
1839     */
1840    public boolean isInclude() {
1841        return _include;
1842    }
1843
1844    /**
1845     * Sets to true to include the portlet and make it available to be made
1846     * active.
1847     *
1848     * @param       include boolean value for whether to include the portlet and
1849     *              make it available to be made active
1850     */
1851    public void setInclude(boolean include) {
1852        _include = include;
1853    }
1854
1855    /**
1856     * Gets the init parameters of the portlet.
1857     *
1858     * @return      init parameters of the portlet
1859     */
1860    public Map getInitParams() {
1861        return _initParams;
1862    }
1863
1864    /**
1865     * Sets the init parameters of the portlet.
1866     *
1867     * @param       initParams the init parameters of the portlet
1868     */
1869    public void setInitParams(Map initParams) {
1870        _initParams = initParams;
1871    }
1872
1873    /**
1874     * Gets expiration cache of the portlet.
1875     *
1876     * @return      expiration cache of the portlet
1877     */
1878    public Integer getExpCache() {
1879        return _expCache;
1880    }
1881
1882    /**
1883     * Sets expiration cache of the portlet.
1884     *
1885     * @param       expCache expiration cache of the portlet
1886     */
1887    public void setExpCache(Integer expCache) {
1888        _expCache = expCache;
1889    }
1890
1891    /**
1892     * Gets the portlet modes of the portlet.
1893     *
1894     * @return      portlet modes of the portlet
1895     */
1896    public Map getPortletModes() {
1897        return _portletModes;
1898    }
1899
1900    /**
1901     * Sets the portlet modes of the portlet.
1902     *
1903     * @param       portletModes the portlet modes of the portlet
1904     */
1905    public void setPortletModes(Map portletModes) {
1906        _portletModes = portletModes;
1907    }
1908
1909    /**
1910     * Returns true if the portlet supports the specified mime type and
1911     * portlet mode.
1912     *
1913     * @return      true if the portlet supports the specified mime type and
1914     *              portlet mode
1915     */
1916    public boolean hasPortletMode(String mimeType, PortletMode portletMode) {
1917        if (mimeType == null) {
1918            mimeType = ContentTypes.TEXT_HTML;
1919        }
1920
1921        Set mimeTypeModes = (Set)_portletModes.get(mimeType);
1922
1923        if (mimeTypeModes == null) {
1924            return false;
1925        }
1926
1927        if (mimeTypeModes.contains(portletMode.toString())) {
1928            return true;
1929        }
1930        else {
1931            return false;
1932        }
1933    }
1934
1935    /**
1936     * Gets a list of all portlet modes supported by the portlet.
1937     *
1938     * @return      a list of all portlet modes supported by the portlet
1939     */
1940    public Set getAllPortletModes() {
1941        Set allPortletModes = new TreeSet();
1942
1943        Iterator itr1 = _portletModes.entrySet().iterator();
1944
1945        while (itr1.hasNext()) {
1946            Map.Entry entry = (Map.Entry)itr1.next();
1947
1948            Set mimeTypeModes = (Set)entry.getValue();
1949
1950            Iterator itr2 = mimeTypeModes.iterator();
1951
1952            while (itr2.hasNext()) {
1953                String portletMode = (String)itr2.next();
1954
1955                allPortletModes.add(portletMode);
1956            }
1957        }
1958
1959        return allPortletModes;
1960    }
1961
1962    /**
1963     * Returns true if the portlet supports more than one mime type.
1964     *
1965     * @return      true if the portlet supports more than one mime type
1966     */
1967    public boolean hasMultipleMimeTypes() {
1968        if (_portletModes.size() > 1) {
1969            return true;
1970        }
1971        else {
1972            return false;
1973        }
1974    }
1975
1976    /**
1977     * Gets the supported locales of the portlet.
1978     *
1979     * @return      supported locales of the portlet
1980     */
1981    public Set getSupportedLocales() {
1982        return _supportedLocales;
1983    }
1984
1985    /**
1986     * Sets the supported locales of the portlet.
1987     *
1988     * @param       supportedLocales the supported locales of the portlet
1989     */
1990    public void setSupportedLocales(Set supportedLocales) {
1991        _supportedLocales = supportedLocales;
1992    }
1993
1994    /**
1995     * Gets the resource bundle of the portlet.
1996     *
1997     * @return      resource bundle of the portlet
1998     */
1999    public String getResourceBundle() {
2000        return _resourceBundle;
2001    }
2002
2003    /**
2004     * Sets the resource bundle of the portlet.
2005     *
2006     * @param       resourceBundle the resource bundle of the portlet
2007     */
2008    public void setResourceBundle(String resourceBundle) {
2009        _resourceBundle = resourceBundle;
2010    }
2011
2012    /**
2013     * Gets the portlet info of the portlet.
2014     *
2015     * @return      portlet info of the portlet
2016     */
2017    public PortletInfo getPortletInfo() {
2018        return _portletInfo;
2019    }
2020
2021    /**
2022     * Sets the portlet info of the portlet.
2023     *
2024     * @param       portletInfo the portlet info of the portlet
2025     */
2026    public void setPortletInfo(PortletInfo portletInfo) {
2027        _portletInfo = portletInfo;
2028    }
2029
2030    /**
2031     * Gets the user attributes of the portlet.
2032     *
2033     * @return      user attributes of the portlet
2034     */
2035    public Set getUserAttributes() {
2036        return _userAttributes;
2037    }
2038
2039    /**
2040     * Sets the user attributes of the portlet.
2041     *
2042     * @param       userAttributes the user attributes of the portlet
2043     */
2044    public void setUserAttributes(Set userAttributes) {
2045        _userAttributes = userAttributes;
2046    }
2047
2048    /**
2049     * Gets the custom user attributes of the portlet.
2050     *
2051     * @return      custom user attributes of the portlet
2052     */
2053    public Map getCustomUserAttributes() {
2054        return _customUserAttributes;
2055    }
2056
2057    /**
2058     * Sets the custom user attributes of the portlet.
2059     *
2060     * @param       customUserAttributes the custom user attributes of the
2061     *              portlet
2062     */
2063    public void setCustomUserAttributes(Map customUserAttributes) {
2064        _customUserAttributes = customUserAttributes;
2065    }
2066
2067    /**
2068     * Gets the servlet context name of the portlet.
2069     *
2070     * @return      the servlet context name of the portlet
2071     */
2072    public String getServletContextName() {
2073        return _servletContextName;
2074    }
2075
2076    /**
2077     * Sets the servlet context name of the portlet.
2078     *
2079     * @param       servletContextName the servlet context name of the portlet
2080     */
2081    public void setServletContextName(String servletContextName) {
2082        _servletContextName = servletContextName;
2083
2084        if (Validator.isNotNull(_servletContextName)) {
2085            _warFile = true;
2086        }
2087        else {
2088            _warFile = false;
2089        }
2090    }
2091
2092    /**
2093     * Returns true if the portlet is found in a WAR file.
2094     *
2095     * @return      true if the portlet is found in a WAR file
2096     */
2097    public boolean getWARFile() {
2098        return _warFile;
2099    }
2100
2101    /**
2102     * Returns true if the portlet is found in a WAR file.
2103     *
2104     * @return      true if the portlet is found in a WAR file
2105     */
2106    public boolean isWARFile() {
2107        return _warFile;
2108    }
2109
2110    /**
2111     * Sets to true if the portlet is found in a WAR file.
2112     *
2113     * @param       warFile boolean value for whether the portlet is found in a
2114     *              WAR file
2115     */
2116    public void setWARFile(boolean warFile) {
2117        _warFile = warFile;
2118    }
2119
2120    /**
2121     * Gets the servlet context path of the portlet.
2122     *
2123     * @return      the servlet context path of the portlet
2124     */
2125    public String getContextPath() {
2126        String virtualPath = getVirtualPath();
2127
2128        if (Validator.isNotNull(virtualPath)) {
2129            return virtualPath;
2130        }
2131
2132        if (isWARFile()) {
2133            StringMaker sm = new StringMaker();
2134
2135            sm.append(StringPool.SLASH);
2136            sm.append(getServletContextName());
2137
2138            return sm.toString();
2139        }
2140        else {
2141            return PortalUtil.getPathContext();
2142        }
2143    }
2144
2145    /**
2146     * Returns true if the portlet is found in a WAR file.
2147     *
2148     * @param       portletId the cloned instance portlet id
2149     * @return      a cloned instance of the portlet
2150     */
2151    public Portlet getClonedInstance(String portletId) {
2152        if (_clonedInstances == null) {
2153
2154            // LEP-528
2155
2156            return null;
2157        }
2158
2159        Portlet clonedInstance = (Portlet)_clonedInstances.get(portletId);
2160
2161        if (clonedInstance == null) {
2162            clonedInstance = (Portlet)clone();
2163
2164            clonedInstance.setPortletId(portletId);
2165
2166            // Disable caching of cloned instances until we can figure out how
2167            // to elegantly refresh the cache when the portlet is dynamically
2168            // updated by the user. For example, the user might change the
2169            // portlet from one column to the next. Cloned instances that are
2170            // cached would not see the new change. We can then also cache
2171            // static portlet instances.
2172
2173            //_clonedInstances.put(portletId, clonedInstance);
2174        }
2175
2176        return clonedInstance;
2177    }
2178
2179    /**
2180     * Returns true if the portlet is a static portlet that is cannot be moved.
2181     *
2182     * @return      true if the portlet is a static portlet that is cannot be
2183     *              moved
2184     */
2185    public boolean getStatic() {
2186        return _staticPortlet;
2187    }
2188
2189    /**
2190     * Returns true if the portlet is a static portlet that is cannot be moved.
2191     *
2192     * @return      true if the portlet is a static portlet that is cannot be
2193     *              moved
2194     */
2195    public boolean isStatic() {
2196        return _staticPortlet;
2197    }
2198
2199    /**
2200     * Sets to true if the portlet is a static portlet that is cannot be moved.
2201     *
2202     * @param       staticPortlet boolean value for whether the portlet is a
2203     *              static portlet that cannot be moved
2204     */
2205    public void setStatic(boolean staticPortlet) {
2206        _staticPortlet = staticPortlet;
2207    }
2208
2209    /**
2210     * Returns true if the portlet is a static portlet at the start of a list of
2211     * portlets.
2212     *
2213     * @return      true if the portlet is a static portlet at the start of a
2214     *              list of portlets
2215     */
2216    public boolean getStaticStart() {
2217        return _staticPortletStart;
2218    }
2219
2220    /**
2221     * Returns true if the portlet is a static portlet at the start of a list of
2222     * portlets.
2223     *
2224     * @return      true if the portlet is a static portlet at the start of a
2225     *              list of portlets
2226     */
2227    public boolean isStaticStart() {
2228        return _staticPortletStart;
2229    }
2230
2231    /**
2232     * Sets to true if the portlet is a static portlet at the start of a list of
2233     * portlets.
2234     *
2235     * @param       staticPortletStart boolean value for whether the portlet is
2236     *              a static portlet at the start of a list of portlets
2237     */
2238    public void setStaticStart(boolean staticPortletStart) {
2239        _staticPortletStart = staticPortletStart;
2240    }
2241
2242    /**
2243     * Returns true if the portlet is a static portlet at the end of a list of
2244     * portlets.
2245     *
2246     * @return      true if the portlet is a static portlet at the end of a
2247     *              list of portlets
2248     */
2249    public boolean getStaticEnd() {
2250        return !_staticPortletStart;
2251    }
2252
2253    /**
2254     * Returns true if the portlet is a static portlet at the end of a list of
2255     * portlets.
2256     *
2257     * @return      true if the portlet is a static portlet at the end of a
2258     *              list of portlets
2259     */
2260    public boolean isStaticEnd() {
2261        return !_staticPortletStart;
2262    }
2263
2264    /**
2265     * The servlet url patterns that are part of this application.
2266     *
2267     * @return      The servlet url patterns that are part of this application
2268     */
2269    public List getServletURLPatterns() {
2270        return _servletURLPatterns;
2271    }
2272
2273    /**
2274     * The servlet url patterns that are part of this application.
2275     *
2276     * @param       servletURLPatterns servlet url patterns that are part of
2277     *              this application
2278     */
2279    public void setServletURLPatterns(List servletURLPatterns) {
2280        _servletURLPatterns = servletURLPatterns;
2281    }
2282
2283    /**
2284     * Creates and returns a copy of this object.
2285     *
2286     * @return      a copy of this object
2287     */
2288    public Object clone() {
2289        return new PortletImpl(
2290            getPortletId(), getPluginPackage(), getDefaultPluginSetting(),
2291            getCompanyId(), getIcon(), getVirtualPath(), getStrutsPath(),
2292            getDisplayName(), getPortletClass(), getConfigurationActionClass(),
2293            getIndexerClass(), getOpenSearchClass(), getSchedulerClass(),
2294            getPortletURLClass(), getFriendlyURLMapperClass(),
2295            getURLEncoderClass(), getPortletDataHandlerClass(),
2296            getPortletLayoutListenerClass(),
2297            getActivityTrackerInterpreterClass(), getPopMessageListenerClass(),
2298            getDefaultPreferences(), getPreferencesValidator(),
2299            isPreferencesCompanyWide(), isPreferencesUniquePerLayout(),
2300            isPreferencesOwnedByGroup(), isUseDefaultTemplate(),
2301            isShowPortletAccessDenied(), isShowPortletInactive(),
2302            isActionURLRedirect(), isRestoreCurrentView(), isMaximizeEdit(),
2303            isMaximizeHelp(), isPopUpPrint(), isLayoutCacheable(),
2304            isInstanceable(), getUserPrincipalStrategy(),
2305            isPrivateRequestAttributes(), isPrivateSessionAttributes(),
2306            getRenderWeight(), isAjaxable(), getHeaderPortalCss(),
2307            getHeaderPortletCss(), getHeaderPortalJavaScript(),
2308            getHeaderPortletJavaScript(), getFooterPortalCss(),
2309            getFooterPortletCss(), getFooterPortalJavaScript(),
2310            getFooterPortletJavaScript(), getCssClassWrapper(),
2311            isAddDefaultResource(), getRoles(), getUnlinkedRoles(),
2312            getRoleMappers(), isSystem(), isActive(), isInclude(),
2313            getInitParams(), getExpCache(), getPortletModes(),
2314            getSupportedLocales(), getResourceBundle(), getPortletInfo(),
2315            getUserAttributes(), getCustomUserAttributes(),
2316            getServletContextName(), getServletURLPatterns());
2317    }
2318
2319    /**
2320     * Compares this portlet to the specified object.
2321     *
2322     * @param       obj the object to compare this portlet against
2323     * @return      the value 0 if the argument portlet is equal to this
2324     *              portlet; a value less than -1 if this portlet is less than
2325     *              the portlet argument; and 1 if this portlet is greater than
2326     *              the portlet argument
2327     */
2328    public int compareTo(Object obj) {
2329        Portlet portlet = (Portlet)obj;
2330
2331        return getPortletId().compareTo(portlet.getPortletId());
2332    }
2333
2334    /**
2335     * Checks whether this portlet is equal to the specified object.
2336     *
2337     * @param       obj the object to compare this portlet against
2338     * @return      true if the portlet is equal to the specified object
2339     */
2340    public boolean equals(Object obj) {
2341        Portlet portlet = (Portlet)obj;
2342
2343        return getPortletId().equals(portlet.getPortletId());
2344    }
2345
2346    /**
2347     * Log instance for this class.
2348     */
2349    private static Log _log = LogFactory.getLog(PortletImpl.class);
2350
2351    /**
2352     * Package to which this plugin belongs to.
2353     */
2354    private PluginPackage _pluginPackage;
2355
2356    /**
2357     * Plugin settings associated with the portlet.
2358     */
2359    private PluginSetting _defaultPluginSetting;
2360
2361    /**
2362     * The icon of the portlet.
2363     */
2364    private String _icon;
2365
2366    /**
2367     * The virtual path of the portlet.
2368     */
2369    private String _virtualPath;
2370
2371    /**
2372     * The struts path of the portlet.
2373     */
2374    private String _strutsPath;
2375
2376    /**
2377     * The display name of the portlet.
2378     */
2379    private String _displayName;
2380
2381    /**
2382     * The name of the portlet class of the portlet.
2383     */
2384    private String _portletClass;
2385
2386    /**
2387     * The configuration action class of the portlet.
2388     */
2389    private String _configurationActionClass;
2390
2391    /**
2392     * The name of the indexer class of the portlet.
2393     */
2394    private String _indexerClass;
2395
2396    /**
2397     * The name of the open search class of the portlet.
2398     */
2399    private String _openSearchClass;
2400
2401    /**
2402     * The name of the scheduler class of the portlet.
2403     */
2404    private String _schedulerClass;
2405
2406    /**
2407     * The name of the portlet URL class of the portlet.
2408     */
2409    private String _portletURLClass;
2410
2411    /**
2412     * The name of the friendly URL mapper class of the portlet.
2413     */
2414    private String _friendlyURLMapperClass;
2415
2416    /**
2417     * The name of the URL encoder class of the portlet.
2418     */
2419    private String _urlEncoderClass;
2420
2421    /**
2422     * The name of the portlet data handler class of the portlet.
2423     */
2424    private String _portletDataHandlerClass;
2425
2426    /**
2427     * The name of the portlet data layout listener class of the portlet.
2428     */
2429    private String _portletLayoutListenerClass;
2430
2431    /**
2432     * The name of the activity tracker interpreter class of the portlet.
2433     */
2434    private String _activityTrackerInterpreterClass;
2435
2436    /**
2437     * The name of the POP message listener class of the portlet.
2438     */
2439    private String _popMessageListenerClass;
2440
2441    /**
2442     * The default preferences of the portlet.
2443     */
2444    private String _defaultPreferences;
2445
2446    /**
2447     * The name of the preferences validator class of the portlet.
2448     */
2449    private String _prefsValidator;
2450
2451    /**
2452     * True if preferences are shared across the entire company.
2453     */
2454    private boolean _prefsCompanyWide;
2455
2456    /**
2457     * True if preferences are unique per layout.
2458     */
2459    private boolean _prefsUniquePerLayout = true;
2460
2461    /**
2462     * True if preferences are owned by the group when the portlet is shown in a
2463     * group layout. False if preferences are owned by the user at all times.
2464     */
2465    private boolean _prefsOwnedByGroup = true;
2466
2467    /**
2468     * True if the portlet uses the default template.
2469     */
2470    private boolean _useDefaultTemplate = true;
2471
2472    /**
2473     * True if users are shown that they do not have access to the portlet.
2474     */
2475    private boolean _showPortletAccessDenied =
2476        PropsValues.LAYOUT_SHOW_PORTLET_ACCESS_DENIED;
2477
2478    /**
2479     * True if users are shown that the portlet is inactive.
2480     */
2481    private boolean _showPortletInactive =
2482        PropsValues.LAYOUT_SHOW_PORTLET_INACTIVE;
2483
2484    /**
2485     * True if an action URL for this portlet should cause an auto redirect.
2486     */
2487    private boolean _actionURLRedirect;
2488
2489    /**
2490     * True if the portlet restores to the current view from the maximized
2491     * state.
2492     */
2493    private boolean _restoreCurrentView = true;
2494
2495    /**
2496     * True if the portlet goes into the maximized state when the user goes into
2497     * the edit mode.
2498     */
2499    private boolean _maximizeEdit;
2500
2501    /**
2502     * True if the portlet goes into the maximized state when the user goes into
2503     * the help mode.
2504     */
2505    private boolean _maximizeHelp;
2506
2507    /**
2508     * True if the portlet goes into the pop up state when the user goes into
2509     * the print mode.
2510     */
2511    private boolean _popUpPrint = true;
2512
2513    /**
2514     * True if the portlet can be cached within the layout.
2515     */
2516    private boolean _layoutCacheable;
2517
2518    /**
2519     * True if the portlet can be added multiple times to a layout.
2520     */
2521    private boolean _instanceable;
2522
2523    /**
2524     * The user principal strategy of the portlet.
2525     */
2526    private String _userPrincipalStrategy =
2527        PortletImpl.USER_PRINCIPAL_STRATEGY_USER_ID;
2528
2529    /**
2530     * True if the portlet does not share request attributes with the portal or
2531     * portlets from another WAR.
2532     */
2533    private boolean _privateRequestAttributes = true;
2534
2535    /**
2536     * True if the portlet does not share session attributes with the portal.
2537     */
2538    private boolean _privateSessionAttributes = true;
2539
2540    /**
2541     * Render weight of the portlet.
2542     */
2543    private int _renderWeight = 1;
2544
2545    /**
2546     * True if the portlet can be displayed via Ajax.
2547     */
2548    private boolean _ajaxable = true;
2549
2550    /**
2551     * A list of CSS files that will be referenced from the page's header
2552     * relative to the portal's context path.
2553     */
2554    private List _headerPortalCss;
2555
2556    /**
2557     * A list of CSS files that will be referenced from the page's header
2558     * relative to the portlet's context path.
2559     */
2560    private List _headerPortletCss;
2561
2562    /**
2563     * A list of JavaScript files that will be referenced from the page's header
2564     * relative to the portal's context path.
2565     */
2566    private List _headerPortalJavaScript;
2567
2568    /**
2569     * A list of JavaScript files that will be referenced from the page's header
2570     * relative to the portlet's context path.
2571     */
2572    private List _headerPortletJavaScript;
2573
2574    /**
2575     * A list of CSS files that will be referenced from the page's footer
2576     * relative to the portal's context path.
2577     */
2578    private List _footerPortalCss;
2579
2580    /**
2581     * A list of CSS files that will be referenced from the page's footer
2582     * relative to the portlet's context path.
2583     */
2584    private List _footerPortletCss;
2585
2586    /**
2587     * A list of JavaScript files that will be referenced from the page's footer
2588     * relative to the portal's context path.
2589     */
2590    private List _footerPortalJavaScript;
2591
2592    /**
2593     * A list of JavaScript files that will be referenced from the page's footer
2594     * relative to the portlet's context path.
2595     */
2596    private List _footerPortletJavaScript;
2597
2598    /**
2599     * The name of the CSS class that will be injected in the DIV that wraps
2600     * this portlet.
2601     */
2602    private String _cssClassWrapper;
2603
2604    /**
2605     * True if default resources for the portlet are added to a page.
2606     */
2607    private boolean _addDefaultResource;
2608
2609    /**
2610     * An array of required roles of the portlet.
2611     */
2612    private String[] _rolesArray;
2613
2614    /**
2615     * The unlinked roles of the portlet.
2616     */
2617    private Set _unlinkedRoles;
2618
2619    /**
2620     * The role mappers of the portlet.
2621     */
2622    private Map _roleMappers;
2623
2624    /**
2625     * True if the portlet is a system portlet that a user cannot manually add
2626     * to their page.
2627     */
2628    private boolean _system;
2629
2630    /**
2631     * True to include the portlet and make it available to be made active.
2632     */
2633    private boolean _include = true;
2634
2635    /**
2636     * The init parameters of the portlet.
2637     */
2638    private Map _initParams;
2639
2640    /**
2641     * The expiration cache of the portlet.
2642     */
2643    private Integer _expCache;
2644
2645    /**
2646     * The portlet modes of the portlet.
2647     */
2648    private Map _portletModes;
2649
2650    /**
2651     * The supported locales of the portlet.
2652     */
2653    private Set _supportedLocales;
2654
2655    /**
2656     * The resource bundle of the portlet.
2657     */
2658    private String _resourceBundle;
2659
2660    /**
2661     * The portlet info of the portlet.
2662     */
2663    private PortletInfo _portletInfo;
2664
2665    /**
2666     * The user attributes of the portlet.
2667     */
2668    private Set _userAttributes;
2669
2670    /**
2671     * The custom user attributes of the portlet.
2672     */
2673    private Map _customUserAttributes;
2674
2675    /**
2676     * The servlet context name of the portlet.
2677     */
2678    private String _servletContextName;
2679
2680    /**
2681     * True if the portlet is found in a WAR file.
2682     */
2683    private boolean _warFile;
2684
2685    /**
2686     * The cloned instances of the portlet.
2687     */
2688    private Map _clonedInstances;
2689
2690    /**
2691     * True if the portlet is a static portlet that is cannot be moved.
2692     */
2693    private boolean _staticPortlet;
2694
2695    /**
2696     * True if the portlet is a static portlet at the start of a list of
2697     * portlets.
2698     */
2699    private boolean _staticPortletStart;
2700
2701    /**
2702     * The servlet url patterns that are part of this application.
2703     */
2704    private List _servletURLPatterns;
2705
2706}