1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.model.impl;
21  
22  import com.liferay.portal.kernel.job.Scheduler;
23  import com.liferay.portal.kernel.log.Log;
24  import com.liferay.portal.kernel.log.LogFactoryUtil;
25  import com.liferay.portal.kernel.plugin.PluginPackage;
26  import com.liferay.portal.kernel.poller.PollerProcessor;
27  import com.liferay.portal.kernel.pop.MessageListener;
28  import com.liferay.portal.kernel.portlet.ConfigurationAction;
29  import com.liferay.portal.kernel.portlet.FriendlyURLMapper;
30  import com.liferay.portal.kernel.portlet.PortletBag;
31  import com.liferay.portal.kernel.portlet.PortletBagPool;
32  import com.liferay.portal.kernel.portlet.PortletLayoutListener;
33  import com.liferay.portal.kernel.search.Indexer;
34  import com.liferay.portal.kernel.search.OpenSearch;
35  import com.liferay.portal.kernel.servlet.URLEncoder;
36  import com.liferay.portal.kernel.util.ContentTypes;
37  import com.liferay.portal.kernel.util.InstancePool;
38  import com.liferay.portal.kernel.util.StringPool;
39  import com.liferay.portal.kernel.util.StringUtil;
40  import com.liferay.portal.kernel.util.Validator;
41  import com.liferay.portal.kernel.xml.QName;
42  import com.liferay.portal.lar.PortletDataHandler;
43  import com.liferay.portal.model.Plugin;
44  import com.liferay.portal.model.PluginSetting;
45  import com.liferay.portal.model.Portlet;
46  import com.liferay.portal.model.PortletApp;
47  import com.liferay.portal.model.PortletConstants;
48  import com.liferay.portal.model.PortletFilter;
49  import com.liferay.portal.model.PortletInfo;
50  import com.liferay.portal.model.PublicRenderParameter;
51  import com.liferay.portal.model.RoleConstants;
52  import com.liferay.portal.model.User;
53  import com.liferay.portal.service.RoleLocalServiceUtil;
54  import com.liferay.portal.service.UserLocalServiceUtil;
55  import com.liferay.portal.util.PortalUtil;
56  import com.liferay.portal.util.PropsValues;
57  import com.liferay.portal.webdav.WebDAVStorage;
58  import com.liferay.portlet.ControlPanelEntry;
59  import com.liferay.portlet.PortletBagImpl;
60  import com.liferay.portlet.PortletQNameUtil;
61  import com.liferay.portlet.social.model.SocialActivityInterpreter;
62  import com.liferay.portlet.social.model.SocialRequestInterpreter;
63  
64  import java.util.ArrayList;
65  import java.util.Arrays;
66  import java.util.HashMap;
67  import java.util.HashSet;
68  import java.util.Hashtable;
69  import java.util.Iterator;
70  import java.util.LinkedHashMap;
71  import java.util.List;
72  import java.util.Map;
73  import java.util.Set;
74  import java.util.TreeSet;
75  
76  import javax.portlet.PortletMode;
77  
78  /**
79   * <a href="PortletImpl.java.html"><b><i>View Source</i></b></a>
80   *
81   * @author Brian Wing Shun Chan
82   *
83   */
84  public class PortletImpl extends PortletModelImpl implements Portlet {
85  
86      /**
87       * Constructs a portlet with no parameters.
88       */
89      public PortletImpl() {
90      }
91  
92      /**
93       * Constructs a portlet with the specified parameters.
94       */
95      public PortletImpl(long companyId, String portletId) {
96          setCompanyId(companyId);
97          setPortletId(portletId);
98          setStrutsPath(portletId);
99          setActive(true);
100         _headerPortalCss = new ArrayList<String>();
101         _headerPortletCss = new ArrayList<String>();
102         _headerPortalJavaScript = new ArrayList<String>();
103         _headerPortletJavaScript = new ArrayList<String>();
104         _footerPortalCss = new ArrayList<String>();
105         _footerPortletCss = new ArrayList<String>();
106         _footerPortalJavaScript = new ArrayList<String>();
107         _footerPortletJavaScript = new ArrayList<String>();
108         _unlinkedRoles = new HashSet<String>();
109         _roleMappers = new LinkedHashMap<String, String>();
110         _initParams = new HashMap<String, String>();
111         _portletModes = new HashMap<String, Set<String>>();
112         _supportedLocales = new HashSet<String>();
113         _portletFilters = new LinkedHashMap<String, PortletFilter>();
114         _processingEvents = new HashSet<QName>();
115         _publishingEvents = new HashSet<QName>();
116         _publicRenderParameters = new HashSet<PublicRenderParameter>();
117     }
118 
119     /**
120      * Constructs a portlet with the specified parameters.
121      */
122     public PortletImpl(
123         String portletId, PluginPackage pluginPackage,
124         PluginSetting pluginSetting, long companyId, long timestamp,
125         String icon, String virtualPath, String strutsPath, String portletName,
126         String displayName, String portletClass,
127         String configurationActionClass, String indexerClass,
128         String openSearchClass, String schedulerClass, String portletURLClass,
129         String friendlyURLMapperClass, String urlEncoderClass,
130         String portletDataHandlerClass, String portletLayoutListenerClass,
131         String pollerProcessorClass, String popMessageListenerClass,
132         String socialActivityInterpreterClass,
133         String socialRequestInterpreterClass, String webDAVStorageToken,
134         String webDAVStorageClass, String controlPanelEntryCategory,
135         double controlPanelEntryWeight, String controlPanelClass,
136         String defaultPreferences, String preferencesValidator,
137         boolean preferencesCompanyWide, boolean preferencesUniquePerLayout,
138         boolean preferencesOwnedByGroup, boolean useDefaultTemplate,
139         boolean showPortletAccessDenied, boolean showPortletInactive,
140         boolean actionURLRedirect, boolean restoreCurrentView,
141         boolean maximizeEdit, boolean maximizeHelp, boolean popUpPrint,
142         boolean layoutCacheable, boolean instanceable, boolean scopeable,
143         String userPrincipalStrategy, boolean privateRequestAttributes,
144         boolean privateSessionAttributes, int renderWeight, boolean ajaxable,
145         List<String> headerPortalCss, List<String> headerPortletCss,
146         List<String> headerPortalJavaScript,
147         List<String> headerPortletJavaScript, List<String> footerPortalCss,
148         List<String> footerPortletCss, List<String> footerPortalJavaScript,
149         List<String> footerPortletJavaScript, String cssClassWrapper,
150         String facebookIntegration, boolean addDefaultResource, String roles,
151         Set<String> unlinkedRoles, Map<String, String> roleMappers,
152         boolean system, boolean active, boolean include,
153         Map<String, String> initParams, Integer expCache,
154         Map<String, Set<String>> portletModes, Set<String> supportedLocales,
155         String resourceBundle, PortletInfo portletInfo,
156         Map<String, PortletFilter> portletFilters, Set<QName> processingEvents,
157         Set<QName> publishingEvents,
158         Set<PublicRenderParameter> publicRenderParameters, boolean remote,
159         String remoteConsumerId, String remoteProducerEntityId,
160         String remotePortletHandle, String remotePortletId,
161         PortletApp portletApp) {
162 
163         setPortletId(portletId);
164         _pluginPackage = pluginPackage;
165         _defaultPluginSetting = pluginSetting;
166         setCompanyId(companyId);
167         _timestamp = timestamp;
168         _icon = icon;
169         _virtualPath = virtualPath;
170         _strutsPath = strutsPath;
171         _portletName = portletName;
172         _displayName = displayName;
173         _portletClass = portletClass;
174         _configurationActionClass = configurationActionClass;
175         _indexerClass = indexerClass;
176         _openSearchClass = openSearchClass;
177         _schedulerClass = schedulerClass;
178         _portletURLClass = portletURLClass;
179         _friendlyURLMapperClass = friendlyURLMapperClass;
180         _urlEncoderClass = urlEncoderClass;
181         _portletDataHandlerClass = portletDataHandlerClass;
182         _portletLayoutListenerClass = portletLayoutListenerClass;
183         _pollerProcessorClass = pollerProcessorClass;
184         _popMessageListenerClass = popMessageListenerClass;
185         _socialActivityInterpreterClass = socialActivityInterpreterClass;
186         _socialRequestInterpreterClass = socialRequestInterpreterClass;
187         _webDAVStorageToken = webDAVStorageToken;
188         _webDAVStorageClass = webDAVStorageClass;
189         _controlPanelEntryCategory = controlPanelEntryCategory;
190         _controlPanelEntryWeight = controlPanelEntryWeight;
191         _controlPanelEntryClass = controlPanelClass;
192         _defaultPreferences = defaultPreferences;
193         _preferencesValidator = preferencesValidator;
194         _preferencesCompanyWide = preferencesCompanyWide;
195         _preferencesUniquePerLayout = preferencesUniquePerLayout;
196         _preferencesOwnedByGroup = preferencesOwnedByGroup;
197         _useDefaultTemplate = useDefaultTemplate;
198         _showPortletAccessDenied = showPortletAccessDenied;
199         _showPortletInactive = showPortletInactive;
200         _actionURLRedirect = actionURLRedirect;
201         _restoreCurrentView = restoreCurrentView;
202         _maximizeEdit = maximizeEdit;
203         _maximizeHelp = maximizeHelp;
204         _popUpPrint = popUpPrint;
205         _layoutCacheable = layoutCacheable;
206         _instanceable = instanceable;
207         _scopeable = scopeable;
208         _userPrincipalStrategy = userPrincipalStrategy;
209         _privateRequestAttributes = privateRequestAttributes;
210         _privateSessionAttributes = privateSessionAttributes;
211         _renderWeight = renderWeight;
212         _ajaxable = ajaxable;
213         _headerPortalCss = headerPortalCss;
214         _headerPortletCss = headerPortletCss;
215         _headerPortalJavaScript = headerPortalJavaScript;
216         _headerPortletJavaScript = headerPortletJavaScript;
217         _footerPortalCss = footerPortalCss;
218         _footerPortletCss = footerPortletCss;
219         _footerPortalJavaScript = footerPortalJavaScript;
220         _footerPortletJavaScript = footerPortletJavaScript;
221         _cssClassWrapper = cssClassWrapper;
222         _facebookIntegration = facebookIntegration;
223         _scopeable = scopeable;
224         _addDefaultResource = addDefaultResource;
225         setRoles(roles);
226         _unlinkedRoles = unlinkedRoles;
227         _roleMappers = roleMappers;
228         _system = system;
229         setActive(active);
230         _include = include;
231         _initParams = initParams;
232         _expCache = expCache;
233         _portletModes = portletModes;
234         _supportedLocales = supportedLocales;
235         _resourceBundle = resourceBundle;
236         _portletInfo = portletInfo;
237         _portletFilters = portletFilters;
238         setProcessingEvents(processingEvents);
239         setPublishingEvents(publishingEvents);
240         setPublicRenderParameters(publicRenderParameters);
241         _remote = remote;
242         _remoteConsumerId = remoteConsumerId;
243         _remoteProducerEntityId = remoteProducerEntityId;
244         _remotePortletHandle = remotePortletHandle;
245         _remotePortletId = remotePortletId;
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> mimeTypeModes = _portletModes.get(mimeType);
2287
2288        if (mimeTypeModes == null) {
2289            return false;
2290        }
2291
2292        if (mimeTypeModes.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> mimeTypeModes = entry.getValue();
2315
2316            Iterator<String> itr2 = mimeTypeModes.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 supported locales of the portlet.
2344     *
2345     * @return      supported locales of the portlet
2346     */
2347    public Set<String> getSupportedLocales() {
2348        return _supportedLocales;
2349    }
2350
2351    /**
2352     * Sets the supported locales of the portlet.
2353     *
2354     * @param       supportedLocales the supported locales of the portlet
2355     */
2356    public void setSupportedLocales(Set<String> supportedLocales) {
2357        _supportedLocales = supportedLocales;
2358    }
2359
2360    /**
2361     * Gets the resource bundle of the portlet.
2362     *
2363     * @return      resource bundle of the portlet
2364     */
2365    public String getResourceBundle() {
2366        return _resourceBundle;
2367    }
2368
2369    /**
2370     * Sets the resource bundle of the portlet.
2371     *
2372     * @param       resourceBundle the resource bundle of the portlet
2373     */
2374    public void setResourceBundle(String resourceBundle) {
2375        _resourceBundle = resourceBundle;
2376    }
2377
2378    /**
2379     * Gets the portlet info of the portlet.
2380     *
2381     * @return      portlet info of the portlet
2382     */
2383    public PortletInfo getPortletInfo() {
2384        return _portletInfo;
2385    }
2386
2387    /**
2388     * Sets the portlet info of the portlet.
2389     *
2390     * @param       portletInfo the portlet info of the portlet
2391     */
2392    public void setPortletInfo(PortletInfo portletInfo) {
2393        _portletInfo = portletInfo;
2394    }
2395
2396    /**
2397     * Gets the filters of the portlet.
2398     *
2399     * @return      filters of the portlet
2400     */
2401    public Map<String, PortletFilter> getPortletFilters() {
2402        return _portletFilters;
2403    }
2404
2405    /**
2406     * Sets the filters of the portlet.
2407     *
2408     * @param       portletFilters the filters of the portlet
2409     */
2410    public void setPortletFilters(Map<String, PortletFilter> portletFilters) {
2411        _portletFilters = portletFilters;
2412    }
2413
2414    /**
2415     * Adds a supported processing event.
2416     *
2417     * @param       publicRenderParameter a supported processing event
2418     */
2419    public void addProcessingEvent(QName processingEvent) {
2420        _processingEvents.add(processingEvent);
2421        _processingEventsByQName.put(
2422            PortletQNameUtil.getKey(processingEvent), processingEvent);
2423    }
2424
2425    /**
2426     * Gets the supported processing event from a namespace URI and a local
2427     * part.
2428     *
2429     * @return      the supported processing event from a namespace URI and a
2430     *              local part
2431     */
2432    public QName getProcessingEvent(String uri, String localPart) {
2433        return _processingEventsByQName.get(
2434            PortletQNameUtil.getKey(uri, localPart));
2435    }
2436
2437    /**
2438     * Gets the supported processing events of the portlet.
2439     *
2440     * @return      supported processing events of the portlet
2441     */
2442    public Set<QName> getProcessingEvents() {
2443        return _processingEvents;
2444    }
2445
2446    /**
2447     * Sets the supported processing events of the portlet.
2448     *
2449     * @param       processingEvents the supported processing events of the
2450     *              portlet
2451     */
2452    public void setProcessingEvents(Set<QName> processingEvents) {
2453        for (QName processingEvent : processingEvents) {
2454            addProcessingEvent(processingEvent);
2455        }
2456    }
2457
2458    /**
2459     * Adds a supported publishing event.
2460     *
2461     * @param       publicRenderParameter a supported publishing event
2462     */
2463    public void addPublishingEvent(QName publishingEvent) {
2464        _publishingEvents.add(publishingEvent);
2465    }
2466
2467    /**
2468     * Gets the supported publishing events of the portlet.
2469     *
2470     * @return      supported publishing events of the portlet
2471     */
2472    public Set<QName> getPublishingEvents() {
2473        return _publishingEvents;
2474    }
2475
2476    /**
2477     * Sets the supported publishing events of the portlet.
2478     *
2479     * @param       publishingEvents the supported publishing events of the
2480     *              portlet
2481     */
2482    public void setPublishingEvents(Set<QName> publishingEvents) {
2483        for (QName publishingEvent : publishingEvents) {
2484            addPublishingEvent(publishingEvent);
2485        }
2486    }
2487
2488    /**
2489     * Adds a supported public render parameter.
2490     *
2491     * @param       publicRenderParameter a supported public render parameter
2492     */
2493    public void addPublicRenderParameter(
2494        PublicRenderParameter publicRenderParameter) {
2495
2496        _publicRenderParameters.add(publicRenderParameter);
2497        _publicRenderParametersByIdentifier.put(
2498            publicRenderParameter.getIdentifier(), publicRenderParameter);
2499        _publicRenderParametersByQName.put(
2500            PortletQNameUtil.getKey(publicRenderParameter.getQName()),
2501            publicRenderParameter);
2502    }
2503
2504    /**
2505     * Gets the supported public render parameter from an identifier.
2506     *
2507     * @return      the supported public render parameter from an identifier
2508     */
2509    public PublicRenderParameter getPublicRenderParameter(String identifier) {
2510        return _publicRenderParametersByIdentifier.get(identifier);
2511    }
2512
2513    /**
2514     * Gets the supported public render parameter from a namespace URI and a
2515     * local part.
2516     *
2517     * @return      the supported public render parameter from a namespace URI
2518     *              and a local part
2519     */
2520    public PublicRenderParameter getPublicRenderParameter(
2521        String uri, String localPart) {
2522
2523        return _publicRenderParametersByQName.get(
2524            PortletQNameUtil.getKey(uri, localPart));
2525    }
2526
2527    /**
2528     * Gets the supported public render parameters of the portlet.
2529     *
2530     * @return      the supported public render parameters of the portlet
2531     */
2532    public Set<PublicRenderParameter> getPublicRenderParameters() {
2533        return _publicRenderParameters;
2534    }
2535
2536    /**
2537     * Sets the supported public render parameters of the portlet.
2538     *
2539     * @param       publicRenderParameters the supported public render
2540     *              parameters of the portlet
2541     */
2542    public void setPublicRenderParameters(
2543        Set<PublicRenderParameter> publicRenderParameters) {
2544
2545        for (PublicRenderParameter publicRenderParameter :
2546                publicRenderParameters) {
2547
2548            addPublicRenderParameter(publicRenderParameter);
2549        }
2550    }
2551
2552    /**
2553     * Returns true if the portlet is a remote portlet.
2554     *
2555     * @return      true if the portlet is a remote portlet
2556     */
2557    public boolean isRemote() {
2558        return _remote;
2559    }
2560
2561    /**
2562     * Set to true if the portlet is a remote portlet.
2563     *
2564     * @param       remote boolean value for the portlet is a remote portlet
2565     */
2566    public void setRemote(boolean remote) {
2567        _remote = remote;
2568    }
2569
2570    /**
2571     * Gets the remote consumer id of the portlet.
2572     *
2573     * @return      the remote consumer id of the portlet
2574     */
2575    public String getRemoteConsumerId() {
2576        return _remoteConsumerId;
2577    }
2578
2579    /**
2580     * Sets the remote consumer id of the portlet.
2581     *
2582     * @param       remoteConsumerId the remote consumer id of the portlet
2583     */
2584    public void setRemoteConsumerId(String remoteConsumerId) {
2585        _remoteConsumerId = remoteConsumerId;
2586    }
2587
2588    /**
2589     * Gets the remote producer entity id of the portlet.
2590     *
2591     * @return      the remote producer entity id of the portlet
2592     */
2593    public String getRemoteProducerEntityId() {
2594        return _remoteProducerEntityId;
2595    }
2596
2597    /**
2598     * Sets the remote producer entity id of the portlet.
2599     *
2600     * @param       remoteProducerEntityId the remote producer entity id of the
2601     *              portlet
2602     */
2603    public void setRemoteProducerEntityId(String remoteProducerEntityId) {
2604        _remoteProducerEntityId = remoteProducerEntityId;
2605    }
2606
2607    /**
2608     * Gets the remote portlet handle of the portlet.
2609     *
2610     * @return      the remote portlet handle of the portlet
2611     */
2612    public String getRemotePortletHandle() {
2613        return _remotePortletHandle;
2614    }
2615
2616    /**
2617     * Sets the remote portlet handle of the portlet.
2618     *
2619     * @param       remotePortletHandle the remote portlet handle of the portlet
2620     */
2621    public void setRemotePortletHandle(String remotePortletHandle) {
2622        _remotePortletHandle = remotePortletHandle;
2623    }
2624
2625    /**
2626     * Gets the remote portlet id of the portlet.
2627     *
2628     * @return      the remote portlet id of the portlet
2629     */
2630    public String getRemotePortletId() {
2631        return _remotePortletId;
2632    }
2633
2634    /**
2635     * Sets the remote portlet id of the portlet.
2636     *
2637     * @param       remotePortletId the remote portlet id of the portlet
2638     */
2639    public void setRemotePortletId(String remotePortletId) {
2640        _remotePortletId = remotePortletId;
2641    }
2642
2643    /**
2644     * Gets the servlet context path of the portlet.
2645     *
2646     * @return      the servlet context path of the portlet
2647     */
2648    public String getContextPath() {
2649        String virtualPath = getVirtualPath();
2650
2651        if (Validator.isNotNull(virtualPath)) {
2652            return virtualPath;
2653        }
2654
2655        if (_portletApp.isWARFile()) {
2656            StringBuilder sb = new StringBuilder();
2657
2658            sb.append(StringPool.SLASH);
2659            sb.append(_portletApp.getServletContextName());
2660
2661            return sb.toString();
2662        }
2663        else {
2664            return PortalUtil.getPathContext();
2665        }
2666    }
2667
2668    /**
2669     * Get the application this portlet belongs to.
2670     *
2671     * @return      the application this portlet belongs to
2672     */
2673    public PortletApp getPortletApp() {
2674        return _portletApp;
2675    }
2676
2677    /**
2678     * Sets the application this portlet belongs to.
2679     *
2680     * @param       portletApp the application this portlet belongs to
2681     */
2682    public void setPortletApp(PortletApp portletApp) {
2683        _portletApp = portletApp;
2684    }
2685
2686    /**
2687     * Returns true if the portlet is found in a WAR file.
2688     *
2689     * @param       portletId the cloned instance portlet id
2690     * @return      a cloned instance of the portlet
2691     */
2692    public Portlet getClonedInstance(String portletId) {
2693        if (_clonedInstances == null) {
2694
2695            // LEP-528
2696
2697            return null;
2698        }
2699
2700        Portlet clonedInstance = _clonedInstances.get(portletId);
2701
2702        if (clonedInstance == null) {
2703            clonedInstance = (Portlet)clone();
2704
2705            clonedInstance.setPortletId(portletId);
2706
2707            // Disable caching of cloned instances until we can figure out how
2708            // to elegantly refresh the cache when the portlet is dynamically
2709            // updated by the user. For example, the user might change the
2710            // portlet from one column to the next. Cloned instances that are
2711            // cached would not see the new change. We can then also cache
2712            // static portlet instances.
2713
2714            //_clonedInstances.put(portletId, clonedInstance);
2715        }
2716
2717        return clonedInstance;
2718    }
2719
2720    /**
2721     * Returns true if the portlet is a static portlet that is cannot be moved.
2722     *
2723     * @return      true if the portlet is a static portlet that is cannot be
2724     *              moved
2725     */
2726    public boolean getStatic() {
2727        return _staticPortlet;
2728    }
2729
2730    /**
2731     * Returns true if the portlet is a static portlet that is cannot be moved.
2732     *
2733     * @return      true if the portlet is a static portlet that is cannot be
2734     *              moved
2735     */
2736    public boolean isStatic() {
2737        return _staticPortlet;
2738    }
2739
2740    /**
2741     * Set to true if the portlet is a static portlet that is cannot be moved.
2742     *
2743     * @param       staticPortlet boolean value for whether the portlet is a
2744     *              static portlet that cannot be moved
2745     */
2746    public void setStatic(boolean staticPortlet) {
2747        _staticPortlet = staticPortlet;
2748    }
2749
2750    /**
2751     * Returns true if the portlet is a static portlet at the start of a list of
2752     * portlets.
2753     *
2754     * @return      true if the portlet is a static portlet at the start of a
2755     *              list of portlets
2756     */
2757    public boolean getStaticStart() {
2758        return _staticPortletStart;
2759    }
2760
2761    /**
2762     * Returns true if the portlet is a static portlet at the start of a list of
2763     * portlets.
2764     *
2765     * @return      true if the portlet is a static portlet at the start of a
2766     *              list of portlets
2767     */
2768    public boolean isStaticStart() {
2769        return _staticPortletStart;
2770    }
2771
2772    /**
2773     * Set to true if the portlet is a static portlet at the start of a list of
2774     * portlets.
2775     *
2776     * @param       staticPortletStart boolean value for whether the portlet is
2777     *              a static portlet at the start of a list of portlets
2778     */
2779    public void setStaticStart(boolean staticPortletStart) {
2780        _staticPortletStart = staticPortletStart;
2781    }
2782
2783    /**
2784     * Returns true if the portlet is a static portlet at the end of a list of
2785     * portlets.
2786     *
2787     * @return      true if the portlet is a static portlet at the end of a
2788     *              list of portlets
2789     */
2790    public boolean getStaticEnd() {
2791        return !_staticPortletStart;
2792    }
2793
2794    /**
2795     * Returns true if the portlet is a static portlet at the end of a list of
2796     * portlets.
2797     *
2798     * @return      true if the portlet is a static portlet at the end of a
2799     *              list of portlets
2800     */
2801    public boolean isStaticEnd() {
2802        return !_staticPortletStart;
2803    }
2804
2805    /**
2806     * Returns true if the portlet is an undeployed portlet.
2807     *
2808     * @return      true if the portlet is a placeholder of an undeployed
2809     *              portlet
2810     */
2811    public boolean getUndeployedPortlet() {
2812        return _undeployedPortlet;
2813    }
2814
2815    /**
2816     * Returns true if the portlet is an undeployed portlet.
2817     *
2818     * @return      true if the portlet is a placeholder of an undeployed
2819     *              portlet
2820     */
2821    public boolean isUndeployedPortlet() {
2822        return _undeployedPortlet;
2823    }
2824
2825    /**
2826     * Set to true if the portlet is an undeployed portlet.
2827     *
2828     * @param       undeployedPortlet boolean value for whether the portlet is
2829     *              an undeployed portlet
2830     */
2831    public void setUndeployedPortlet(boolean undeployedPortlet) {
2832        _undeployedPortlet = undeployedPortlet;
2833    }
2834
2835    /**
2836     * Creates and returns a copy of this object.
2837     *
2838     * @return      a copy of this object
2839     */
2840    public Object clone() {
2841        Portlet portlet = new PortletImpl(
2842            getPortletId(), getPluginPackage(), getDefaultPluginSetting(),
2843            getCompanyId(), getTimestamp(), getIcon(), getVirtualPath(),
2844            getStrutsPath(), getPortletName(), getDisplayName(),
2845            getPortletClass(), getConfigurationActionClass(), getIndexerClass(),
2846            getOpenSearchClass(), getSchedulerClass(), getPortletURLClass(),
2847            getFriendlyURLMapperClass(), getURLEncoderClass(),
2848            getPortletDataHandlerClass(), getPortletLayoutListenerClass(),
2849            getPollerProcessorClass(), getPopMessageListenerClass(),
2850            getSocialActivityInterpreterClass(),
2851            getSocialRequestInterpreterClass(), getWebDAVStorageToken(),
2852            getWebDAVStorageClass(), getControlPanelEntryCategory(),
2853            getControlPanelEntryWeight(), getControlPanelEntryClass(),
2854            getDefaultPreferences(), getPreferencesValidator(),
2855            isPreferencesCompanyWide(), isPreferencesUniquePerLayout(),
2856            isPreferencesOwnedByGroup(), isUseDefaultTemplate(),
2857            isShowPortletAccessDenied(), isShowPortletInactive(),
2858            isActionURLRedirect(), isRestoreCurrentView(), isMaximizeEdit(),
2859            isMaximizeHelp(), isPopUpPrint(), isLayoutCacheable(),
2860            isInstanceable(), isScopeable(), getUserPrincipalStrategy(),
2861            isPrivateRequestAttributes(), isPrivateSessionAttributes(),
2862            getRenderWeight(), isAjaxable(), getHeaderPortalCss(),
2863            getHeaderPortletCss(), getHeaderPortalJavaScript(),
2864            getHeaderPortletJavaScript(), getFooterPortalCss(),
2865            getFooterPortletCss(), getFooterPortalJavaScript(),
2866            getFooterPortletJavaScript(), getCssClassWrapper(),
2867            getFacebookIntegration(), isAddDefaultResource(), getRoles(),
2868            getUnlinkedRoles(), getRoleMappers(), isSystem(), isActive(),
2869            isInclude(), getInitParams(), getExpCache(), getPortletModes(),
2870            getSupportedLocales(), getResourceBundle(), getPortletInfo(),
2871            getPortletFilters(), getProcessingEvents(), getPublishingEvents(),
2872            getPublicRenderParameters(), isRemote(), getRemoteConsumerId(),
2873            getRemoteProducerEntityId(), getRemotePortletHandle(),
2874            getRemotePortletId(), getPortletApp());
2875
2876        portlet.setId(getId());
2877
2878        return portlet;
2879    }
2880
2881    /**
2882     * Compares this portlet to the specified object.
2883     *
2884     * @param       portlet the portlet to compare this portlet against
2885     * @return      the value 0 if the argument portlet is equal to this
2886     *              portlet; a value less than -1 if this portlet is less than
2887     *              the portlet argument; and 1 if this portlet is greater than
2888     *              the portlet argument
2889     */
2890    public int compareTo(Portlet portlet) {
2891        return getPortletId().compareTo(portlet.getPortletId());
2892    }
2893
2894    /**
2895     * Checks whether this portlet is equal to the specified object.
2896     *
2897     * @param       obj the object to compare this portlet against
2898     * @return      true if the portlet is equal to the specified object
2899     */
2900    public boolean equals(Object obj) {
2901        Portlet portlet = (Portlet)obj;
2902
2903        return getPortletId().equals(portlet.getPortletId());
2904    }
2905
2906    /**
2907     * Log instance for this class.
2908     */
2909    private static Log _log = LogFactoryUtil.getLog(PortletImpl.class);
2910
2911    /**
2912     * Package this plugin belongs to.
2913     */
2914    private PluginPackage _pluginPackage;
2915
2916    /**
2917     * Plugin settings associated with the portlet.
2918     */
2919    private PluginSetting _defaultPluginSetting;
2920
2921    /**
2922     * The timestamp of the portlet.
2923     */
2924    private long _timestamp;
2925
2926    /**
2927     * The icon of the portlet.
2928     */
2929    private String _icon;
2930
2931    /**
2932     * The virtual path of the portlet.
2933     */
2934    private String _virtualPath;
2935
2936    /**
2937     * The struts path of the portlet.
2938     */
2939    private String _strutsPath;
2940
2941    /**
2942     * The name of the portlet.
2943     */
2944    private String _portletName;
2945
2946    /**
2947     * The display name of the portlet.
2948     */
2949    private String _displayName;
2950
2951    /**
2952     * The name of the portlet class of the portlet.
2953     */
2954    private String _portletClass;
2955
2956    /**
2957     * The configuration action class of the portlet.
2958     */
2959    private String _configurationActionClass;
2960
2961    /**
2962     * The name of the indexer class of the portlet.
2963     */
2964    private String _indexerClass;
2965
2966    /**
2967     * The name of the open search class of the portlet.
2968     */
2969    private String _openSearchClass;
2970
2971    /**
2972     * The name of the scheduler class of the portlet.
2973     */
2974    private String _schedulerClass;
2975
2976    /**
2977     * The name of the portlet URL class of the portlet.
2978     */
2979    private String _portletURLClass;
2980
2981    /**
2982     * The name of the friendly URL mapper class of the portlet.
2983     */
2984    private String _friendlyURLMapperClass;
2985
2986    /**
2987     * The name of the URL encoder class of the portlet.
2988     */
2989    private String _urlEncoderClass;
2990
2991    /**
2992     * The name of the portlet data handler class of the portlet.
2993     */
2994    private String _portletDataHandlerClass;
2995
2996    /**
2997     * The name of the portlet data layout listener class of the portlet.
2998     */
2999    private String _portletLayoutListenerClass;
3000
3001    /**
3002     * The name of the poller processor class of the portlet.
3003     */
3004    private String _pollerProcessorClass;
3005
3006    /**
3007     * The name of the POP message listener class of the portlet.
3008     */
3009    private String _popMessageListenerClass;
3010
3011    /**
3012     * The name of the social activity interpreter class of the portlet.
3013     */
3014    private String _socialActivityInterpreterClass;
3015
3016    /**
3017     * The name of the social request interpreter class of the portlet.
3018     */
3019    private String _socialRequestInterpreterClass;
3020
3021    /**
3022     * The name of the WebDAV storage token of the portlet.
3023     */
3024    private String _webDAVStorageToken;
3025
3026    /**
3027     * The name of the WebDAV storage class of the portlet.
3028     */
3029    private String _webDAVStorageClass;
3030
3031    /**
3032     * The default preferences of the portlet.
3033     */
3034    private String _defaultPreferences;
3035
3036    /**
3037     * The name of the preferences validator class of the portlet.
3038     */
3039    private String _preferencesValidator;
3040
3041    /**
3042     * True if preferences are shared across the entire company.
3043     */
3044    private boolean _preferencesCompanyWide;
3045
3046    /**
3047     * True if preferences are unique per layout.
3048     */
3049    private boolean _preferencesUniquePerLayout = true;
3050
3051    /**
3052     * True if preferences are owned by the group when the portlet is shown in a
3053     * group layout. False if preferences are owned by the user at all times.
3054     */
3055    private boolean _preferencesOwnedByGroup = true;
3056
3057    /**
3058     * The name of the category of the Control Panel where this portlet will be
3059     * shown
3060     */
3061    private String _controlPanelEntryCategory;
3062
3063    /**
3064     * The relative weight of this portlet with respect to the other portlets
3065     * in the same category of the Control Panel
3066     */
3067    private double _controlPanelEntryWeight = 100;
3068
3069    /**
3070     * The name of the class that will control when this portlet will be shown
3071     * in the Control Panel
3072     */
3073    private String _controlPanelEntryClass;
3074
3075    /**
3076     * True if the portlet uses the default template.
3077     */
3078    private boolean _useDefaultTemplate = true;
3079
3080    /**
3081     * True if users are shown that they do not have access to the portlet.
3082     */
3083    private boolean _showPortletAccessDenied =
3084        PropsValues.LAYOUT_SHOW_PORTLET_ACCESS_DENIED;
3085
3086    /**
3087     * True if users are shown that the portlet is inactive.
3088     */
3089    private boolean _showPortletInactive =
3090        PropsValues.LAYOUT_SHOW_PORTLET_INACTIVE;
3091
3092    /**
3093     * True if an action URL for this portlet should cause an auto redirect.
3094     */
3095    private boolean _actionURLRedirect;
3096
3097    /**
3098     * True if the portlet restores to the current view from the maximized
3099     * state.
3100     */
3101    private boolean _restoreCurrentView = true;
3102
3103    /**
3104     * True if the portlet goes into the maximized state when the user goes into
3105     * the edit mode.
3106     */
3107    private boolean _maximizeEdit;
3108
3109    /**
3110     * True if the portlet goes into the maximized state when the user goes into
3111     * the help mode.
3112     */
3113    private boolean _maximizeHelp;
3114
3115    /**
3116     * True if the portlet goes into the pop up state when the user goes into
3117     * the print mode.
3118     */
3119    private boolean _popUpPrint = true;
3120
3121    /**
3122     * True if the portlet can be cached within the layout.
3123     */
3124    private boolean _layoutCacheable;
3125
3126    /**
3127     * True if the portlet can be added multiple times to a layout.
3128     */
3129    private boolean _instanceable;
3130
3131    /**
3132     * True if the portlet supports scoping of data.
3133     */
3134    private boolean _scopeable;
3135
3136    /**
3137     * The user principal strategy of the portlet.
3138     */
3139    private String _userPrincipalStrategy =
3140        PortletConstants.USER_PRINCIPAL_STRATEGY_USER_ID;
3141
3142    /**
3143     * True if the portlet does not share request attributes with the portal or
3144     * portlets from another WAR.
3145     */
3146    private boolean _privateRequestAttributes = true;
3147
3148    /**
3149     * True if the portlet does not share session attributes with the portal.
3150     */
3151    private boolean _privateSessionAttributes = true;
3152
3153    /**
3154     * Render weight of the portlet.
3155     */
3156    private int _renderWeight = 1;
3157
3158    /**
3159     * True if the portlet can be displayed via Ajax.
3160     */
3161    private boolean _ajaxable = true;
3162
3163    /**
3164     * A list of CSS files that will be referenced from the page's header
3165     * relative to the portal's context path.
3166     */
3167    private List<String> _headerPortalCss;
3168
3169    /**
3170     * A list of CSS files that will be referenced from the page's header
3171     * relative to the portlet's context path.
3172     */
3173    private List<String> _headerPortletCss;
3174
3175    /**
3176     * A list of JavaScript files that will be referenced from the page's header
3177     * relative to the portal's context path.
3178     */
3179    private List<String> _headerPortalJavaScript;
3180
3181    /**
3182     * A list of JavaScript files that will be referenced from the page's header
3183     * relative to the portlet's context path.
3184     */
3185    private List<String> _headerPortletJavaScript;
3186
3187    /**
3188     * A list of CSS files that will be referenced from the page's footer
3189     * relative to the portal's context path.
3190     */
3191    private List<String> _footerPortalCss;
3192
3193    /**
3194     * A list of CSS files that will be referenced from the page's footer
3195     * relative to the portlet's context path.
3196     */
3197    private List<String> _footerPortletCss;
3198
3199    /**
3200     * A list of JavaScript files that will be referenced from the page's footer
3201     * relative to the portal's context path.
3202     */
3203    private List<String> _footerPortalJavaScript;
3204
3205    /**
3206     * A list of JavaScript files that will be referenced from the page's footer
3207     * relative to the portlet's context path.
3208     */
3209    private List<String> _footerPortletJavaScript;
3210
3211    /**
3212     * The name of the CSS class that will be injected in the DIV that wraps
3213     * this portlet.
3214     */
3215    private String _cssClassWrapper = StringPool.BLANK;
3216
3217    /**
3218     * The Facebook integration method of the portlet.
3219     */
3220    private String _facebookIntegration =
3221        PortletConstants.FACEBOOK_INTEGRATION_IFRAME;
3222
3223    /**
3224     * True if default resources for the portlet are added to a page.
3225     */
3226    private boolean _addDefaultResource;
3227
3228    /**
3229     * An array of required roles of the portlet.
3230     */
3231    private String[] _rolesArray;
3232
3233    /**
3234     * The unlinked roles of the portlet.
3235     */
3236    private Set<String> _unlinkedRoles;
3237
3238    /**
3239     * The role mappers of the portlet.
3240     */
3241    private Map<String, String> _roleMappers;
3242
3243    /**
3244     * True if the portlet is a system portlet that a user cannot manually add
3245     * to their page.
3246     */
3247    private boolean _system;
3248
3249    /**
3250     * True to include the portlet and make it available to be made active.
3251     */
3252    private boolean _include = true;
3253
3254    /**
3255     * The init parameters of the portlet.
3256     */
3257    private Map<String, String> _initParams;
3258
3259    /**
3260     * The expiration cache of the portlet.
3261     */
3262    private Integer _expCache;
3263
3264    /**
3265     * The portlet modes of the portlet.
3266     */
3267    private Map<String, Set<String>> _portletModes;
3268
3269    /**
3270     * The supported locales of the portlet.
3271     */
3272    private Set<String> _supportedLocales;
3273
3274    /**
3275     * The resource bundle of the portlet.
3276     */
3277    private String _resourceBundle;
3278
3279    /**
3280     * The portlet info of the portlet.
3281     */
3282    private PortletInfo _portletInfo;
3283
3284    /**
3285     * The filters of the portlet.
3286     */
3287    private Map<String, PortletFilter> _portletFilters;
3288
3289    /**
3290     * The supported processing events of the portlet.
3291     */
3292    private Set<QName> _processingEvents = new HashSet<QName>();
3293
3294    /**
3295     * Map of the supported processing events of the portlet keyed by the QName.
3296     */
3297    private Map<String, QName> _processingEventsByQName =
3298        new HashMap<String, QName>();
3299
3300    /**
3301     * The supported publishing events of the portlet.
3302     */
3303    private Set<QName> _publishingEvents = new HashSet<QName>();
3304
3305    /**
3306     * The supported public render parameters of the portlet.
3307     */
3308    private Set<PublicRenderParameter> _publicRenderParameters =
3309        new HashSet<PublicRenderParameter>();
3310
3311    /**
3312     * Map of the supported public render parameters of the portlet keyed by the
3313     * identifier.
3314     */
3315    private Map<String, PublicRenderParameter>
3316        _publicRenderParametersByIdentifier =
3317            new HashMap<String, PublicRenderParameter>();
3318
3319    /**
3320     * Map of the supported public render parameters of the portlet keyed by the
3321     * QName.
3322     */
3323    private Map<String, PublicRenderParameter>
3324        _publicRenderParametersByQName =
3325            new HashMap<String, PublicRenderParameter>();
3326
3327    /**
3328     * True if the portlet is a remote portlet.
3329     */
3330    private boolean _remote = false;
3331
3332    /**
3333     * The remote consumer id of the portlet.
3334     */
3335    private String _remoteConsumerId;
3336
3337    /**
3338     * The remote producer entity id of the portlet.
3339     */
3340    private String _remoteProducerEntityId;
3341
3342    /**
3343     * The remote portlet handle of the portlet.
3344     */
3345    private String _remotePortletHandle;
3346
3347    /**
3348     * The remote portlet id of the portlet.
3349     */
3350    private String _remotePortletId;
3351
3352    /**
3353     * The application this portlet belongs to.
3354     */
3355    private PortletApp _portletApp;
3356
3357    /**
3358     * The cloned instances of the portlet.
3359     */
3360    private Map<String, Portlet> _clonedInstances;
3361
3362    /**
3363     * True if the portlet is a static portlet that is cannot be moved.
3364     */
3365    private boolean _staticPortlet;
3366
3367    /**
3368     * True if the portlet is a static portlet at the start of a list of
3369     * portlets.
3370     */
3371    private boolean _staticPortletStart;
3372
3373    /**
3374     * True if the portlet is an undeployed portlet.
3375     */
3376    private boolean _undeployedPortlet = false;
3377
3378}