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