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