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