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