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