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