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