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