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