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