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