PortletImpl.java |
1 /** 2 * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a copy 5 * of this software and associated documentation files (the "Software"), to deal 6 * in the Software without restriction, including without limitation the rights 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 * copies of the Software, and to permit persons to whom the Software is 9 * furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included in 12 * all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 * SOFTWARE. 21 */ 22 23 package com.liferay.portal.model.impl; 24 25 import com.liferay.portal.kernel.lar.PortletDataHandler; 26 import com.liferay.portal.kernel.plugin.PluginPackage; 27 import com.liferay.portal.kernel.portlet.ConfigurationAction; 28 import com.liferay.portal.kernel.portlet.FriendlyURLMapper; 29 import com.liferay.portal.kernel.portlet.PortletLayoutListener; 30 import com.liferay.portal.kernel.servlet.URLEncoder; 31 import com.liferay.portal.kernel.smtp.MessageListener; 32 import com.liferay.portal.kernel.util.ContentTypes; 33 import com.liferay.portal.kernel.util.GetterUtil; 34 import com.liferay.portal.kernel.util.InstancePool; 35 import com.liferay.portal.kernel.util.StringMaker; 36 import com.liferay.portal.kernel.util.StringPool; 37 import com.liferay.portal.kernel.util.StringUtil; 38 import com.liferay.portal.kernel.util.Validator; 39 import com.liferay.portal.model.PluginSetting; 40 import com.liferay.portal.model.Portlet; 41 import com.liferay.portal.model.PortletInfo; 42 import com.liferay.portal.model.User; 43 import com.liferay.portal.service.RoleLocalServiceUtil; 44 import com.liferay.portal.service.UserLocalServiceUtil; 45 import com.liferay.portal.servlet.PortletContextPool; 46 import com.liferay.portal.servlet.PortletContextWrapper; 47 import com.liferay.portal.util.PortalUtil; 48 import com.liferay.portal.util.PropsUtil; 49 50 import java.util.ArrayList; 51 import java.util.Collections; 52 import java.util.HashMap; 53 import java.util.HashSet; 54 import java.util.Hashtable; 55 import java.util.Iterator; 56 import java.util.LinkedHashMap; 57 import java.util.LinkedHashSet; 58 import java.util.List; 59 import java.util.Map; 60 import java.util.Set; 61 import java.util.TreeSet; 62 63 import javax.portlet.PortletMode; 64 65 import org.apache.commons.logging.Log; 66 import org.apache.commons.logging.LogFactory; 67 68 /** 69 * <a href="PortletImpl.java.html"><b><i>View Source</i></b></a> 70 * 71 * @author Brian Wing Shun Chan 72 * 73 */ 74 public class PortletImpl extends PortletModelImpl implements Portlet { 75 76 /** 77 * Plugin type 78 */ 79 public static final String PLUGIN_TYPE = "portlet"; 80 81 /** 82 * War file separator. 83 */ 84 public static final String WAR_SEPARATOR = "_WAR_"; 85 86 /** 87 * Instance separator. 88 */ 89 public static final String INSTANCE_SEPARATOR = "_INSTANCE_"; 90 91 /** 92 * Layout separator. 93 */ 94 public static final String LAYOUT_SEPARATOR = "_LAYOUT_"; 95 96 /** 97 * Default preferences. 98 */ 99 public static final String DEFAULT_PREFERENCES = "<portlet-preferences />"; 100 101 /** 102 * Gets the root portlet id of the portlet. 103 * 104 * @param portletId the portlet id of the portlet 105 * @return the root portlet id of the portlet 106 */ 107 public static String getRootPortletId(String portletId) { 108 int pos = portletId.indexOf(INSTANCE_SEPARATOR); 109 110 if (pos == -1) { 111 return portletId; 112 } 113 else { 114 return portletId.substring(0, pos); 115 } 116 } 117 118 /** 119 * Gets the instance id of the portlet. 120 * 121 * @param portletId the portlet id of the portlet 122 * @return the instance id of the portlet 123 */ 124 public static String getInstanceId(String portletId) { 125 int pos = portletId.indexOf(INSTANCE_SEPARATOR); 126 127 if (pos == -1) { 128 return null; 129 } 130 else { 131 return portletId.substring( 132 pos + INSTANCE_SEPARATOR.length(), portletId.length()); 133 } 134 } 135 136 /** 137 * Constructs a portlet with no parameters. 138 */ 139 public PortletImpl() { 140 } 141 142 /** 143 * Constructs a portlet with the specified parameters. 144 */ 145 public PortletImpl(long companyId, String portletId) { 146 setCompanyId(companyId); 147 setPortletId(portletId); 148 setStrutsPath(portletId); 149 setActive(true); 150 _headerPortalCss = new ArrayList(); 151 _headerPortletCss = new ArrayList(); 152 _headerPortalJavaScript = new ArrayList(); 153 _headerPortletJavaScript = new ArrayList(); 154 _footerPortalCss = new ArrayList(); 155 _footerPortletCss = new ArrayList(); 156 _footerPortalJavaScript = new ArrayList(); 157 _footerPortletJavaScript = new ArrayList(); 158 _unlinkedRoles = new HashSet(); 159 _roleMappers = new LinkedHashMap(); 160 _initParams = new HashMap(); 161 _portletModes = new HashMap(); 162 _supportedLocales = new HashSet(); 163 _userAttributes = new LinkedHashSet(); 164 _customUserAttributes = new LinkedHashMap(); 165 } 166 167 /** 168 * Constructs a portlet with the specified parameters. 169 */ 170 public PortletImpl( 171 String portletId, PluginPackage pluginPackage, 172 PluginSetting pluginSetting, long companyId, String icon, 173 String virtualPath, String strutsPath, String displayName, 174 String portletClass, String configurationActionClass, 175 String indexerClass, String openSearchClass, String schedulerClass, 176 String portletURLClass, String friendlyURLMapperClass, 177 String urlEncoderClass, String portletDataHandlerClass, 178 String portletLayoutListenerClass, String smtpMessageListenerClass, 179 String defaultPreferences, String prefsValidator, 180 boolean prefsCompanyWide, boolean prefsUniquePerLayout, 181 boolean prefsOwnedByGroup, boolean useDefaultTemplate, 182 boolean showPortletAccessDenied, boolean showPortletInactive, 183 boolean actionURLRedirect, boolean restoreCurrentView, 184 boolean maximizeEdit, boolean maximizeHelp, boolean popUpPrint, 185 boolean layoutCacheable, boolean instanceable, 186 boolean privateRequestAttributes, boolean privateSessionAttributes, 187 int renderWeight, boolean ajaxable, List headerPortalCss, 188 List headerPortletCss, List headerPortalJavaScript, 189 List headerPortletJavaScript, List footerPortalCss, 190 List footerPortletCss, List footerPortalJavaScript, 191 List footerPortletJavaScript, boolean addDefaultResource, String roles, 192 Set unlinkedRoles, Map roleMappers, boolean system, boolean active, 193 boolean include, Map initParams, Integer expCache, Map portletModes, 194 Set supportedLocales, String resourceBundle, PortletInfo portletInfo, 195 Set userAttributes, Map customUserAttributes, String servletContextName, 196 List servletURLPatterns) { 197 198 setPortletId(portletId); 199 _pluginPackage = pluginPackage; 200 _defaultPluginSetting = pluginSetting; 201 setCompanyId(companyId); 202 _icon = icon; 203 _virtualPath = virtualPath; 204 _strutsPath = strutsPath; 205 _displayName = displayName; 206 _portletClass = portletClass; 207 _configurationActionClass = configurationActionClass; 208 _indexerClass = indexerClass; 209 _openSearchClass = openSearchClass; 210 _schedulerClass = schedulerClass; 211 _portletURLClass = portletURLClass; 212 _friendlyURLMapperClass = friendlyURLMapperClass; 213 _urlEncoderClass = urlEncoderClass; 214 _portletDataHandlerClass = portletDataHandlerClass; 215 _portletLayoutListenerClass = portletLayoutListenerClass; 216 _smtpMessageListenerClass = smtpMessageListenerClass; 217 _defaultPreferences = defaultPreferences; 218 _prefsValidator = prefsValidator; 219 _prefsCompanyWide = prefsCompanyWide; 220 _prefsUniquePerLayout = prefsUniquePerLayout; 221 _prefsOwnedByGroup = prefsOwnedByGroup; 222 _useDefaultTemplate = useDefaultTemplate; 223 _showPortletAccessDenied = showPortletAccessDenied; 224 _showPortletInactive = showPortletInactive; 225 _actionURLRedirect = actionURLRedirect; 226 _restoreCurrentView = restoreCurrentView; 227 _maximizeEdit = maximizeEdit; 228 _maximizeHelp = maximizeHelp; 229 _popUpPrint = popUpPrint; 230 _layoutCacheable = layoutCacheable; 231 _instanceable = instanceable; 232 _privateRequestAttributes = privateRequestAttributes; 233 _privateSessionAttributes = privateSessionAttributes; 234 _renderWeight = renderWeight; 235 _ajaxable = ajaxable; 236 _headerPortalCss = headerPortalCss; 237 _headerPortletCss = headerPortletCss; 238 _headerPortalJavaScript = headerPortalJavaScript; 239 _headerPortletJavaScript = headerPortletJavaScript; 240 _footerPortalCss = footerPortalCss; 241 _footerPortletCss = footerPortletCss; 242 _footerPortalJavaScript = footerPortalJavaScript; 243 _footerPortletJavaScript = footerPortletJavaScript; 244 _addDefaultResource = addDefaultResource; 245 setRoles(roles); 246 _unlinkedRoles = unlinkedRoles; 247 _roleMappers = roleMappers; 248 _system = system; 249 setActive(active); 250 _include = include; 251 _initParams = initParams; 252 _expCache = expCache; 253 _portletModes = portletModes; 254 _supportedLocales = supportedLocales; 255 _resourceBundle = resourceBundle; 256 _portletInfo = portletInfo; 257 _userAttributes = userAttributes; 258 _customUserAttributes = customUserAttributes; 259 setServletContextName(servletContextName); 260 _servletURLPatterns = servletURLPatterns; 261 262 if (_instanceable) { 263 _clonedInstances = new Hashtable(); 264 } 265 } 266 267 /** 268 * Gets the root portlet id of the portlet. 269 * 270 * @return the root portlet id of the portlet 271 */ 272 public String getRootPortletId() { 273 return getRootPortletId(getPortletId()); 274 } 275 276 /** 277 * Gets the instance id of the portlet. 278 * 279 * @return the instance id of the portlet 280 */ 281 public String getInstanceId() { 282 return getInstanceId(getPortletId()); 283 } 284 285 /** 286 * Gets the plugin id of the portlet. 287 * 288 * @return the plugin id of the portlet 289 */ 290 public String getPluginId() { 291 return getRootPortletId(); 292 } 293 294 /** 295 * Gets the plugin type of the portlet. 296 * 297 * @return the plugin type of the portlet 298 */ 299 public String getPluginType() { 300 return PLUGIN_TYPE; 301 } 302 303 /** 304 * Get the package to which the portlet belongs to. 305 * 306 * @return the plugin package of the portlet 307 */ 308 public PluginPackage getPluginPackage() { 309 return _pluginPackage; 310 } 311 312 /** 313 * Sets the plugin package to which this portlet belongs to. 314 * 315 * @param pluginPackage the plugin package 316 */ 317 public void setPluginPackage(PluginPackage pluginPackage) { 318 _pluginPackage = pluginPackage; 319 } 320 321 /** 322 * Get the default plugin settings of the portlet. 323 * 324 * @return the plugin settings 325 */ 326 public PluginSetting getDefaultPluginSetting() { 327 return _defaultPluginSetting; 328 } 329 330 /** 331 * Sets the default plugin settings of the portlet. 332 * 333 * @param pluginSetting the plugin setting 334 */ 335 public void setDefaultPluginSetting(PluginSetting pluginSetting) { 336 _defaultPluginSetting = pluginSetting; 337 } 338 339 /** 340 * Gets the icon of the portlet. 341 * 342 * @return the icon of the portlet 343 */ 344 public String getIcon() { 345 return _icon; 346 } 347 348 /** 349 * Sets the icon of the portlet. 350 * 351 * @param icon the icon of the portlet 352 */ 353 public void setIcon(String icon) { 354 _icon = icon; 355 } 356 357 /** 358 * Gets the virtual path of the portlet. 359 * 360 * @return the virtual path of the portlet 361 */ 362 public String getVirtualPath() { 363 return _virtualPath; 364 } 365 366 /** 367 * Sets the virtual path of the portlet. 368 * 369 * @param virtualPath the virtual path of the portlet 370 */ 371 public void setVirtualPath(String virtualPath) { 372 if (_warFile && Validator.isNull(virtualPath)) { 373 virtualPath = GetterUtil.getString( 374 PropsUtil.get(PropsUtil.PORTLET_VIRTUAL_PATH)); 375 } 376 377 _virtualPath = virtualPath; 378 } 379 380 /** 381 * Gets the struts path of the portlet. 382 * 383 * @return the struts path of the portlet 384 */ 385 public String getStrutsPath() { 386 return _strutsPath; 387 } 388 389 /** 390 * Sets the struts path of the portlet. 391 * 392 * @param strutsPath the struts path of the portlet 393 */ 394 public void setStrutsPath(String strutsPath) { 395 _strutsPath = strutsPath; 396 } 397 398 /** 399 * Gets the display name of the portlet. 400 * 401 * @return the display name of the portlet 402 */ 403 public String getDisplayName() { 404 return _displayName; 405 } 406 407 /** 408 * Sets the display name of the portlet. 409 * 410 * @param displayName the display name of the portlet 411 */ 412 public void setDisplayName(String displayName) { 413 _displayName = displayName; 414 } 415 416 /** 417 * Gets the name of the portlet class of the portlet. 418 * 419 * @return the name of the portlet class of the portlet 420 */ 421 public String getPortletClass() { 422 return _portletClass; 423 } 424 425 /** 426 * Sets the name of the portlet class of the portlet. 427 * 428 * @param portletClass the name of the portlet class of the portlet 429 */ 430 public void setPortletClass(String portletClass) { 431 _portletClass = portletClass; 432 } 433 434 /** 435 * Gets the configuration action class of the portlet. 436 * 437 * @return the configuration action class of the portlet 438 */ 439 public String getConfigurationActionClass() { 440 return _configurationActionClass; 441 } 442 443 /** 444 * Sets the configuration action class of the portlet. 445 * 446 * @param configurationActionClass the configuration action class of 447 * the portlet 448 */ 449 public void setConfigurationActionClass(String configurationActionClass) { 450 _configurationActionClass = configurationActionClass; 451 } 452 453 /** 454 * Gets the configuration action instance of the portlet. 455 * 456 * @return the configuration action instance of the portlet 457 */ 458 public ConfigurationAction getConfigurationActionInstance() { 459 if (Validator.isNotNull(getConfigurationActionClass())) { 460 if (isWARFile()) { 461 PortletContextWrapper pcw = 462 PortletContextPool.get(getRootPortletId()); 463 464 return pcw.getConfigurationActionInstance(); 465 } 466 else { 467 return (ConfigurationAction)InstancePool.get( 468 getConfigurationActionClass()); 469 } 470 } 471 472 return null; 473 } 474 475 /** 476 * Gets the name of the indexer class of the portlet. 477 * 478 * @return the name of the indexer class of the portlet 479 */ 480 public String getIndexerClass() { 481 return _indexerClass; 482 } 483 484 /** 485 * Sets the name of the indexer class of the portlet. 486 * 487 * @param indexerClass the name of the indexer class of the portlet 488 */ 489 public void setIndexerClass(String indexerClass) { 490 _indexerClass = indexerClass; 491 } 492 493 /** 494 * Gets the name of the open search class of the portlet. 495 * 496 * @return the name of the open search class of the portlet 497 */ 498 public String getOpenSearchClass() { 499 return _openSearchClass; 500 } 501 502 /** 503 * Sets the name of the open search class of the portlet. 504 * 505 * @param openSearchClass the name of the open search class of the 506 * portlet 507 */ 508 public void setOpenSearchClass(String openSearchClass) { 509 _openSearchClass = openSearchClass; 510 } 511 512 /** 513 * Gets the name of the scheduler class of the portlet. 514 * 515 * @return the name of the scheduler class of the portlet 516 */ 517 public String getSchedulerClass() { 518 return _schedulerClass; 519 } 520 521 /** 522 * Sets the name of the scheduler class of the portlet. 523 * 524 * @param schedulerClass the name of the scheduler class of the 525 * portlet 526 */ 527 public void setSchedulerClass(String schedulerClass) { 528 _schedulerClass = schedulerClass; 529 } 530 531 /** 532 * Gets the name of the portlet URL class of the portlet. 533 * 534 * @return the name of the portlet URL class of the portlet 535 */ 536 public String getPortletURLClass() { 537 return _portletURLClass; 538 } 539 540 /** 541 * Sets the name of the portlet URL class of the portlet. 542 * 543 * @param portletURLClass the name of the portlet URL class of the 544 * portlet 545 */ 546 public void setPortletURLClass(String portletURLClass) { 547 _portletURLClass = portletURLClass; 548 } 549 550 /** 551 * Gets the name of the friendly URL mapper class of the portlet. 552 * 553 * @return the name of the friendly URL mapper class of the portlet 554 */ 555 public String getFriendlyURLMapperClass() { 556 return _friendlyURLMapperClass; 557 } 558 559 /** 560 * Sets the name of the friendly URL mapper class of the portlet. 561 * 562 * @param friendlyURLMapperClass the name of the friendly URL plugin 563 * class of the portlet 564 */ 565 public void setFriendlyURLMapperClass(String friendlyURLMapperClass) { 566 _friendlyURLMapperClass = friendlyURLMapperClass; 567 } 568 569 /** 570 * Gets the friendly URL mapper instance of the portlet. 571 * 572 * @return the friendly URL mapper instance of the portlet 573 */ 574 public FriendlyURLMapper getFriendlyURLMapperInstance() { 575 if (Validator.isNotNull(getFriendlyURLMapperClass())) { 576 if (isWARFile()) { 577 PortletContextWrapper pcw = 578 PortletContextPool.get(getRootPortletId()); 579 580 return pcw.getFriendlyURLMapperInstance(); 581 } 582 else { 583 return (FriendlyURLMapper)InstancePool.get( 584 getFriendlyURLMapperClass()); 585 } 586 } 587 588 return null; 589 } 590 591 /** 592 * Gets the name of the URL encoder class of the portlet. 593 * 594 * @return the name of the URL encoder class of the portlet 595 */ 596 public String getURLEncoderClass() { 597 return _urlEncoderClass; 598 } 599 600 /** 601 * Sets the name of the URL encoder class of the portlet. 602 * 603 * @param urlEncoderClass the name of the URL encoder class of the 604 * portlet 605 */ 606 public void setURLEncoderClass(String urlEncoderClass) { 607 _urlEncoderClass = urlEncoderClass; 608 } 609 610 /** 611 * Gets the URL encoder instance of the portlet. 612 * 613 * @return the URL encoder instance of the portlet 614 */ 615 public URLEncoder getURLEncoderInstance() { 616 if (Validator.isNotNull(getURLEncoderClass())) { 617 if (isWARFile()) { 618 PortletContextWrapper pcw = 619 PortletContextPool.get(getRootPortletId()); 620 621 return pcw.getURLEncoderInstance(); 622 } 623 else { 624 return (URLEncoder)InstancePool.get(getURLEncoderClass()); 625 } 626 } 627 628 return null; 629 } 630 631 /** 632 * Gets the name of the portlet data handler class of the portlet. 633 * 634 * @return the name of the portlet data handler class of the portlet 635 */ 636 public String getPortletDataHandlerClass() { 637 return _portletDataHandlerClass; 638 } 639 640 /** 641 * Sets the name of the portlet data handler class of the portlet. 642 * 643 * @param portletDataHandlerClass the name of portlet data handler 644 * class of the portlet 645 */ 646 public void setPortletDataHandlerClass(String portletDataHandlerClass) { 647 _portletDataHandlerClass = portletDataHandlerClass; 648 } 649 650 /** 651 * Gets the portlet data handler instance of the portlet. 652 * 653 * @return the portlet data handler instance of the portlet 654 */ 655 public PortletDataHandler getPortletDataHandlerInstance() { 656 if (Validator.isNotNull(getPortletDataHandlerClass())) { 657 if (isWARFile()) { 658 PortletContextWrapper pcw = 659 PortletContextPool.get(getRootPortletId()); 660 661 return pcw.getPortletDataHandlerInstance(); 662 } 663 else { 664 return (PortletDataHandler)InstancePool.get( 665 getPortletDataHandlerClass()); 666 } 667 } 668 669 return null; 670 } 671 672 /** 673 * Gets the portlet layout listener of the portlet. 674 * 675 * @return the name of the portlet layout listener class of the portlet 676 */ 677 public PortletLayoutListener getPortletLayoutListener() { 678 if (Validator.isNull(getPortletLayoutListenerClass())) { 679 return null; 680 } 681 682 return (PortletLayoutListener)InstancePool.get( 683 getPortletLayoutListenerClass()); 684 } 685 686 /** 687 * Gets the name of the portlet layout listener class of the portlet. 688 * 689 * @return the name of the portlet layout listener class of the portlet 690 */ 691 public String getPortletLayoutListenerClass() { 692 return _portletLayoutListenerClass; 693 } 694 695 /** 696 * Sets the name of the portlet layout listener class of the portlet. 697 * 698 * @param portletLayoutListenerClass the name of the portlet layout 699 * listener class of the portlet 700 */ 701 public void setPortletLayoutListenerClass( 702 String portletLayoutListenerClass) { 703 704 _portletLayoutListenerClass = portletLayoutListenerClass; 705 } 706 707 /** 708 * Gets the name of the SMTP message listener class of the portlet. 709 * 710 * @return the name of the SMTP message listener class of the portlet 711 */ 712 public String getSmtpMessageListenerClass() { 713 return _smtpMessageListenerClass; 714 } 715 716 /** 717 * Sets the name of the SMTP message listener class of the portlet. 718 * 719 * @param smtpMessageListenerClass the name of the SMTP message 720 * listener class of the portlet 721 */ 722 public void setSmtpMessageListenerClass(String smtpMessageListenerClass) { 723 _smtpMessageListenerClass = smtpMessageListenerClass; 724 } 725 726 /** 727 * Gets the SMTP message listener instance of the portlet. 728 * 729 * @return the SMTP message listener instance of the portlet 730 */ 731 public MessageListener getSmtpMessageListenerInstance() { 732 if (Validator.isNotNull(getSmtpMessageListenerClass())) { 733 if (isWARFile()) { 734 PortletContextWrapper pcw = 735 PortletContextPool.get(getRootPortletId()); 736 737 return pcw.getSmtpMessageListenerInstance(); 738 } 739 else { 740 return (MessageListener)InstancePool.get( 741 getSmtpMessageListenerClass()); 742 } 743 } 744 745 return null; 746 } 747 748 /** 749 * Gets the default preferences of the portlet. 750 * 751 * @return the default preferences of the portlet 752 */ 753 public String getDefaultPreferences() { 754 if (Validator.isNull(_defaultPreferences)) { 755 return DEFAULT_PREFERENCES; 756 } 757 else { 758 return _defaultPreferences; 759 } 760 } 761 762 /** 763 * Sets the default preferences of the portlet. 764 * 765 * @param defaultPreferences the default preferences of the portlet 766 */ 767 public void setDefaultPreferences(String defaultPreferences) { 768 _defaultPreferences = defaultPreferences; 769 } 770 771 /** 772 * Gets the name of the preferences validator class of the portlet. 773 * 774 * @return the name of the preferences validator class of the portlet 775 */ 776 public String getPreferencesValidator() { 777 return _prefsValidator; 778 } 779 780 /** 781 * Sets the name of the preferences validator class of the portlet. 782 * 783 * @param prefsValidator the name of the preferences validator class 784 * of the portlet 785 */ 786 public void setPreferencesValidator(String prefsValidator) { 787 if (prefsValidator != null) { 788 789 // Trim this because XDoclet generates preferences validators with 790 // extra white spaces 791 792 _prefsValidator = prefsValidator.trim(); 793 } 794 else { 795 _prefsValidator = null; 796 } 797 } 798 799 /** 800 * Returns true if preferences are shared across the entire company. 801 * 802 * @return true if preferences are shared across the entire company 803 */ 804 public boolean getPreferencesCompanyWide() { 805 return _prefsCompanyWide; 806 } 807 808 /** 809 * Returns true if preferences are shared across the entire company. 810 * 811 * @return true if preferences are shared across the entire company 812 */ 813 public boolean isPreferencesCompanyWide() { 814 return _prefsCompanyWide; 815 } 816 817 /** 818 * Sets to true if preferences are shared across the entire company. 819 * 820 * @param prefsCompanyWide boolean value for whether preferences 821 * are shared across the entire company 822 */ 823 public void setPreferencesCompanyWide(boolean prefsCompanyWide) { 824 _prefsCompanyWide = prefsCompanyWide; 825 } 826 827 /** 828 * Returns true if preferences are unique per layout. 829 * 830 * @return true if preferences are unique per layout 831 */ 832 public boolean getPreferencesUniquePerLayout() { 833 return _prefsUniquePerLayout; 834 } 835 836 /** 837 * Returns true if preferences are unique per layout. 838 * 839 * @return true if preferences are unique per layout 840 */ 841 public boolean isPreferencesUniquePerLayout() { 842 return _prefsUniquePerLayout; 843 } 844 845 /** 846 * Sets to true if preferences are unique per layout. 847 * 848 * @param prefsUniquePerLayout boolean value for whether preferences 849 * are unique per layout 850 */ 851 public void setPreferencesUniquePerLayout(boolean prefsUniquePerLayout) { 852 _prefsUniquePerLayout = prefsUniquePerLayout; 853 } 854 855 /** 856 * Returns true if preferences are owned by the group when the portlet is 857 * shown in a group layout. Returns false if preferences are owned by the 858 * user at all times. 859 * 860 * @return true if preferences are owned by the group when the portlet 861 * is shown in a group layout; false if preferences are owned 862 * by the user at all times. 863 */ 864 public boolean getPreferencesOwnedByGroup() { 865 return _prefsOwnedByGroup; 866 } 867 868 /** 869 * Returns true if preferences are owned by the group when the portlet is 870 * shown in a group layout. Returns false if preferences are owned by the 871 * user at all times. 872 * 873 * @return true if preferences are owned by the group when the portlet 874 * is shown in a group layout; false if preferences are owned 875 * by the user at all times. 876 */ 877 public boolean isPreferencesOwnedByGroup() { 878 return _prefsOwnedByGroup; 879 } 880 881 /** 882 * Sets to true if preferences are owned by the group when the portlet is 883 * shown in a group layout. Sets to false if preferences are owned by the 884 * user at all times. 885 * 886 * @param prefsOwnedByGroup boolean value for whether preferences are 887 * owned by the group when the portlet is shown in a group 888 * layout or preferences are owned by the user at all times 889 */ 890 public void setPreferencesOwnedByGroup(boolean prefsOwnedByGroup) { 891 _prefsOwnedByGroup = prefsOwnedByGroup; 892 } 893 894 /** 895 * Returns true if the portlet uses the default template. 896 * 897 * @return true if the portlet uses the default template 898 */ 899 public boolean getUseDefaultTemplate() { 900 return _useDefaultTemplate; 901 } 902 903 /** 904 * Returns true if the portlet uses the default template. 905 * 906 * @return true if the portlet uses the default template 907 */ 908 public boolean isUseDefaultTemplate() { 909 return _useDefaultTemplate; 910 } 911 912 /** 913 * Sets to true if the portlet uses the default template. 914 * 915 * @param useDefaultTemplate boolean value for whether the portlet 916 * uses the default template 917 */ 918 public void setUseDefaultTemplate(boolean useDefaultTemplate) { 919 _useDefaultTemplate = useDefaultTemplate; 920 } 921 922 /** 923 * Returns true if users are shown that they do not have access to the 924 * portlet. 925 * 926 * @return true if users are shown that they do not have access to the 927 * portlet 928 */ 929 public boolean getShowPortletAccessDenied() { 930 return _showPortletAccessDenied; 931 } 932 933 /** 934 * Returns true if users are shown that they do not have access to the 935 * portlet. 936 * 937 * @return true if users are shown that they do not have access to the 938 * portlet 939 */ 940 public boolean isShowPortletAccessDenied() { 941 return _showPortletAccessDenied; 942 } 943 944 /** 945 * Sets to true if users are shown that they do not have access to the 946 * portlet. 947 * 948 * @param showPortletAccessDenied boolean value for whether users are 949 * shown that they do not have access to the portlet 950 */ 951 public void setShowPortletAccessDenied(boolean showPortletAccessDenied) { 952 _showPortletAccessDenied = showPortletAccessDenied; 953 } 954 955 /** 956 * Returns true if users are shown that the portlet is inactive. 957 * 958 * @return true if users are shown that the portlet is inactive 959 */ 960 public boolean getShowPortletInactive() { 961 return _showPortletInactive; 962 } 963 964 /** 965 * Returns true if users are shown that the portlet is inactive. 966 * 967 * @return true if users are shown that the portlet is inactive 968 */ 969 public boolean isShowPortletInactive() { 970 return _showPortletInactive; 971 } 972 973 /** 974 * Sets to true if users are shown that the portlet is inactive. 975 * 976 * @param showPortletInactive boolean value for whether users are 977 * shown that the portlet is inactive 978 */ 979 public void setShowPortletInactive(boolean showPortletInactive) { 980 _showPortletInactive = showPortletInactive; 981 } 982 983 /** 984 * Returns true if an action URL for this portlet should cause an auto 985 * redirect. 986 * 987 * @return true if an action URL for this portlet should cause an auto 988 * redirect 989 */ 990 public boolean getActionURLRedirect() { 991 return _actionURLRedirect; 992 } 993 994 /** 995 * Returns true if an action URL for this portlet should cause an auto 996 * redirect. 997 * 998 * @return true if an action URL for this portlet should cause an auto 999 * redirect 1000 */ 1001 public boolean isActionURLRedirect() { 1002 return _actionURLRedirect; 1003 } 1004 1005 /** 1006 * Sets to true if an action URL for this portlet should cause an auto 1007 * redirect. 1008 * 1009 * @param actionURLRedirect boolean value for whether an action URL 1010 * for this portlet should cause an auto redirect 1011 */ 1012 public void setActionURLRedirect(boolean actionURLRedirect) { 1013 _actionURLRedirect = actionURLRedirect; 1014 } 1015 1016 /** 1017 * Returns true if the portlet restores to the current view from the 1018 * maximized state. 1019 * 1020 * @return true if the portlet restores to the current view from the 1021 * maximized state 1022 */ 1023 public boolean getRestoreCurrentView() { 1024 return _restoreCurrentView; 1025 } 1026 1027 /** 1028 * Returns true if the portlet restores to the current view from the 1029 * maximized state. 1030 * 1031 * @return true if the portlet restores to the current view from the 1032 * maximized state 1033 */ 1034 public boolean isRestoreCurrentView() { 1035 return _restoreCurrentView; 1036 } 1037 1038 /** 1039 * Sets to true if the portlet restores to the current view from the 1040 * maximized state. 1041 * 1042 * @param restoreCurrentView boolean value for whether the portlet 1043 * restores to the current view from the maximized state 1044 */ 1045 public void setRestoreCurrentView(boolean restoreCurrentView) { 1046 _restoreCurrentView = restoreCurrentView; 1047 } 1048 1049 /** 1050 * Returns true if the portlet goes into the maximized state when the user 1051 * goes into the edit mode. 1052 * 1053 * @return true if the portlet goes into the maximized state when the 1054 * user goes into the edit mode 1055 */ 1056 public boolean getMaximizeEdit() { 1057 return _maximizeEdit; 1058 } 1059 1060 /** 1061 * Returns true if the portlet goes into the maximized state when the user 1062 * goes into the edit mode. 1063 * 1064 * @return true if the portlet goes into the maximized state when the 1065 * user goes into the edit mode 1066 */ 1067 public boolean isMaximizeEdit() { 1068 return _maximizeEdit; 1069 } 1070 1071 /** 1072 * Sets to true if the portlet goes into the maximized state when the user 1073 * goes into the edit mode. 1074 * 1075 * @param maximizeEdit boolean value for whether the portlet goes into 1076 * the maximized state when the user goes into the edit mode 1077 */ 1078 public void setMaximizeEdit(boolean maximizeEdit) { 1079 _maximizeEdit = maximizeEdit; 1080 } 1081 1082 /** 1083 * Returns true if the portlet goes into the maximized state when the user 1084 * goes into the help mode. 1085 * 1086 * @return true if the portlet goes into the maximized state when the 1087 * user goes into the help mode 1088 */ 1089 public boolean getMaximizeHelp() { 1090 return _maximizeHelp; 1091 } 1092 1093 /** 1094 * Returns true if the portlet goes into the maximized state when the user 1095 * goes into the help mode. 1096 * 1097 * @return true if the portlet goes into the maximized state when the 1098 * user goes into the help mode 1099 */ 1100 public boolean isMaximizeHelp() { 1101 return _maximizeHelp; 1102 } 1103 1104 /** 1105 * Sets to true if the portlet goes into the maximized state when the user 1106 * goes into the help mode. 1107 * 1108 * @param maximizeHelp boolean value for whether the portlet goes into 1109 * the maximized state when the user goes into the help mode 1110 */ 1111 public void setMaximizeHelp(boolean maximizeHelp) { 1112 _maximizeHelp = maximizeHelp; 1113 } 1114 1115 /** 1116 * Returns true if the portlet goes into the pop up state when the user goes 1117 * into the print mode. 1118 * 1119 * @return true if the portlet goes into the pop up state when the user 1120 * goes into the print mode 1121 */ 1122 public boolean getPopUpPrint() { 1123 return _popUpPrint; 1124 } 1125 1126 /** 1127 * Returns true if the portlet goes into the pop up state when the user goes 1128 * into the print mode. 1129 * 1130 * @return true if the portlet goes into the pop up state when the user 1131 * goes into the print mode 1132 */ 1133 public boolean isPopUpPrint() { 1134 return _popUpPrint; 1135 } 1136 1137 /** 1138 * Sets to true if the portlet goes into the pop up state when the user goes 1139 * into the print mode. 1140 * 1141 * @param popUpPrint boolean value for whether the portlet goes into 1142 * the pop up state when the user goes into the print mode 1143 */ 1144 public void setPopUpPrint(boolean popUpPrint) { 1145 _popUpPrint = popUpPrint; 1146 } 1147 1148 /** 1149 * Returns true to allow the portlet to be cached within the layout. 1150 * 1151 * @return true if the portlet can be cached within the layout 1152 */ 1153 public boolean getLayoutCacheable() { 1154 return _layoutCacheable; 1155 } 1156 1157 /** 1158 * Returns true to allow the portlet to be cached within the layout. 1159 * 1160 * @return true if the portlet can be cached within the layout 1161 */ 1162 public boolean isLayoutCacheable() { 1163 return _layoutCacheable; 1164 } 1165 1166 /** 1167 * Sets to true to allow the portlet to be cached within the layout. 1168 * 1169 * @param layoutCacheable boolean value for whether the portlet can be 1170 * cached within the layout 1171 */ 1172 public void setLayoutCacheable(boolean layoutCacheable) { 1173 _layoutCacheable = layoutCacheable; 1174 } 1175 1176 /** 1177 * Returns true if the portlet can be added multiple times to a layout. 1178 * 1179 * @return true if the portlet can be added multiple times to a layout 1180 */ 1181 public boolean getInstanceable() { 1182 return _instanceable; 1183 } 1184 1185 /** 1186 * Returns true if the portlet can be added multiple times to a layout. 1187 * 1188 * @return true if the portlet can be added multiple times to a layout 1189 */ 1190 public boolean isInstanceable() { 1191 return _instanceable; 1192 } 1193 1194 /** 1195 * Sets to true if the portlet can be added multiple times to a layout. 1196 * 1197 * @param instanceable boolean value for whether the portlet can be 1198 * added multiple times to a layout 1199 */ 1200 public void setInstanceable(boolean instanceable) { 1201 _instanceable = instanceable; 1202 } 1203 1204 /** 1205 * Returns true if the portlet does not share request attributes with the 1206 * portal or portlets from another WAR. 1207 * 1208 * @return true if the portlet does not share request attributes with 1209 * the portal or portlets from another WAR 1210 */ 1211 public boolean getPrivateRequestAttributes() { 1212 return _privateRequestAttributes; 1213 } 1214 1215 /** 1216 * Returns true if the portlet does not share request attributes with the 1217 * portal or portlets from another WAR. 1218 * 1219 * @return true if the portlet does not share request attributes with 1220 * the portal or portlets from another WAR 1221 */ 1222 public boolean isPrivateRequestAttributes() { 1223 return _privateRequestAttributes; 1224 } 1225 1226 /** 1227 * Sets to true if the portlet does not share request attributes with the 1228 * portal or portlets from another WAR. 1229 * 1230 * @param privateRequestAttributes boolean value for whether the 1231 * portlet shares request attributes with the portal or 1232 * portlets from another WAR 1233 */ 1234 public void setPrivateRequestAttributes(boolean privateRequestAttributes) { 1235 _privateRequestAttributes = privateRequestAttributes; 1236 } 1237 1238 /** 1239 * Returns true if the portlet does not share session attributes with the 1240 * portal. 1241 * 1242 * @return true if the portlet does not share session attributes with 1243 * the portal 1244 */ 1245 public boolean getPrivateSessionAttributes() { 1246 return _privateSessionAttributes; 1247 } 1248 1249 /** 1250 * Returns true if the portlet does not share session attributes with the 1251 * portal. 1252 * 1253 * @return true if the portlet does not share session attributes with 1254 * the portal 1255 */ 1256 public boolean isPrivateSessionAttributes() { 1257 return _privateSessionAttributes; 1258 } 1259 1260 /** 1261 * Sets to true if the portlet does not share session attributes with the 1262 * portal. 1263 * 1264 * @param privateSessionAttributes boolean value for whether the 1265 * portlet shares session attributes with the portal 1266 */ 1267 public void setPrivateSessionAttributes(boolean privateSessionAttributes) { 1268 _privateSessionAttributes = privateSessionAttributes; 1269 } 1270 1271 /** 1272 * Returns the render weight of the portlet. 1273 * 1274 * @return the render weight of the portlet 1275 */ 1276 public int getRenderWeight() { 1277 return _renderWeight; 1278 } 1279 1280 /** 1281 * Sets the render weight of the portlet. 1282 * 1283 * @param renderWeight int value for the render weight of the portlet 1284 */ 1285 public void setRenderWeight(int renderWeight) { 1286 _renderWeight = renderWeight; 1287 } 1288 1289 /** 1290 * Returns true if the portlet can be displayed via Ajax. 1291 * 1292 * @return true if the portlet can be displayed via Ajax 1293 */ 1294 public boolean getAjaxable() { 1295 return _ajaxable; 1296 } 1297 1298 /** 1299 * Returns true if the portlet can be displayed via Ajax. 1300 * 1301 * @return true if the portlet can be displayed via Ajax 1302 */ 1303 public boolean isAjaxable() { 1304 return _ajaxable; 1305 } 1306 1307 /** 1308 * Sets to true if the portlet can be displayed via Ajax. 1309 * 1310 * @param ajaxable boolean value for whether the portlet can be 1311 * displayed via Ajax 1312 */ 1313 public void setAjaxable(boolean ajaxable) { 1314 _ajaxable = ajaxable; 1315 } 1316 1317 /** 1318 * Gets a list of CSS files that will be referenced from the page's header 1319 * relative to the portal's context path. 1320 * 1321 * @return a list of CSS files that will be referenced from the page's 1322 * header relative to the portal's context path 1323 */ 1324 public List getHeaderPortalCss() { 1325 return _headerPortalCss; 1326 } 1327 1328 /** 1329 * Sets a list of CSS files that will be referenced from the page's header 1330 * relative to the portal's context path. 1331 * 1332 * @param headerPortalCss a list of CSS files that will be referenced 1333 * from the page's header relative to the portal's context path 1334 */ 1335 public void setHeaderPortalCss(List headerPortalCss) { 1336 _headerPortalCss = headerPortalCss; 1337 } 1338 1339 /** 1340 * Gets a list of CSS files that will be referenced from the page's header 1341 * relative to the portlet's context path. 1342 * 1343 * @return a list of CSS files that will be referenced from the page's 1344 * header relative to the portlet's context path 1345 */ 1346 public List getHeaderPortletCss() { 1347 return _headerPortletCss; 1348 } 1349 1350 /** 1351 * Sets a list of CSS files that will be referenced from the page's header 1352 * relative to the portlet's context path. 1353 * 1354 * @param headerPortletCss a list of CSS files that will be referenced 1355 * from the page's header relative to the portlet's context 1356 * path 1357 */ 1358 public void setHeaderPortletCss(List headerPortletCss) { 1359 _headerPortletCss = headerPortletCss; 1360 } 1361 1362 /** 1363 * Gets a list of JavaScript files that will be referenced from the page's 1364 * header relative to the portal's context path. 1365 * 1366 * @return a list of JavaScript files that will be referenced from the 1367 * page's header relative to the portal's context path 1368 */ 1369 public List getHeaderPortalJavaScript() { 1370 return _headerPortalJavaScript; 1371 } 1372 1373 /** 1374 * Sets a list of JavaScript files that will be referenced from the page's 1375 * header relative to the portal's context path. 1376 * 1377 * @param headerPortalJavaScript a list of JavaScript files that will 1378 * be referenced from the page's header relative to the 1379 * portal's context path 1380 */ 1381 public void setHeaderPortalJavaScript(List headerPortalJavaScript) { 1382 _headerPortalJavaScript = headerPortalJavaScript; 1383 } 1384 1385 /** 1386 * Gets a list of JavaScript files that will be referenced from the page's 1387 * header relative to the portlet's context path. 1388 * 1389 * @return a list of JavaScript files that will be referenced from the 1390 * page's header relative to the portlet's context path 1391 */ 1392 public List getHeaderPortletJavaScript() { 1393 return _headerPortletJavaScript; 1394 } 1395 1396 /** 1397 * Sets a list of JavaScript files that will be referenced from the page's 1398 * header relative to the portlet's context path. 1399 * 1400 * @param headerPortletJavaScript a list of JavaScript files that will 1401 * be referenced from the page's header relative to the 1402 * portlet's context path 1403 */ 1404 public void setHeaderPortletJavaScript(List headerPortletJavaScript) { 1405 _headerPortletJavaScript = headerPortletJavaScript; 1406 } 1407 1408 /** 1409 * Gets a list of CSS files that will be referenced from the page's footer 1410 * relative to the portal's context path. 1411 * 1412 * @return a list of CSS files that will be referenced from the page's 1413 * footer relative to the portal's context path 1414 */ 1415 public List getFooterPortalCss() { 1416 return _footerPortalCss; 1417 } 1418 1419 /** 1420 * Sets a list of CSS files that will be referenced from the page's footer 1421 * relative to the portal's context path. 1422 * 1423 * @param footerPortalCss a list of CSS files that will be referenced 1424 * from the page's footer relative to the portal's context path 1425 */ 1426 public void setFooterPortalCss(List footerPortalCss) { 1427 _footerPortalCss = footerPortalCss; 1428 } 1429 1430 /** 1431 * Gets a list of CSS files that will be referenced from the page's footer 1432 * relative to the portlet's context path. 1433 * 1434 * @return a list of CSS files that will be referenced from the page's 1435 * footer relative to the portlet's context path 1436 */ 1437 public List getFooterPortletCss() { 1438 return _footerPortletCss; 1439 } 1440 1441 /** 1442 * Sets a list of CSS files that will be referenced from the page's footer 1443 * relative to the portlet's context path. 1444 * 1445 * @param footerPortletCss a list of CSS files that will be referenced 1446 * from the page's footer relative to the portlet's context 1447 * path 1448 */ 1449 public void setFooterPortletCss(List footerPortletCss) { 1450 _footerPortletCss = footerPortletCss; 1451 } 1452 1453 /** 1454 * Gets a list of JavaScript files that will be referenced from the page's 1455 * footer relative to the portal's context path. 1456 * 1457 * @return a list of JavaScript files that will be referenced from the 1458 * page's footer relative to the portal's context path 1459 */ 1460 public List getFooterPortalJavaScript() { 1461 return _footerPortalJavaScript; 1462 } 1463 1464 /** 1465 * Sets a list of JavaScript files that will be referenced from the page's 1466 * footer relative to the portal's context path. 1467 * 1468 * @param footerPortalJavaScript a list of JavaScript files that will 1469 * be referenced from the page's footer relative to the 1470 * portal's context path 1471 */ 1472 public void setFooterPortalJavaScript(List footerPortalJavaScript) { 1473 _footerPortalJavaScript = footerPortalJavaScript; 1474 } 1475 1476 /** 1477 * Gets a list of JavaScript files that will be referenced from the page's 1478 * footer relative to the portlet's context path. 1479 * 1480 * @return a list of JavaScript files that will be referenced from the 1481 * page's footer relative to the portlet's context path 1482 */ 1483 public List getFooterPortletJavaScript() { 1484 return _footerPortletJavaScript; 1485 } 1486 1487 /** 1488 * Sets a list of JavaScript files that will be referenced from the page's 1489 * footer relative to the portlet's context path. 1490 * 1491 * @param footerPortletJavaScript a list of JavaScript files that will 1492 * be referenced from the page's footer relative to the 1493 * portlet's context path 1494 */ 1495 public void setFooterPortletJavaScript(List footerPortletJavaScript) { 1496 _footerPortletJavaScript = footerPortletJavaScript; 1497 } 1498 1499 /** 1500 * Returns true if default resources for the portlet are added to a page. 1501 * 1502 * @return true if default resources for the portlet are added to a 1503 * page 1504 */ 1505 public boolean getAddDefaultResource() { 1506 return _addDefaultResource; 1507 } 1508 1509 /** 1510 * Returns true if default resources for the portlet are added to a page. 1511 * 1512 * @return true if default resources for the portlet are added to a 1513 * page 1514 */ 1515 public boolean isAddDefaultResource() { 1516 return _addDefaultResource; 1517 } 1518 1519 /** 1520 * Sets to true if default resources for the portlet are added to a page. 1521 * 1522 * @param addDefaultResource boolean value for whether or not default 1523 * resources for the portlet are added to a page 1524 */ 1525 public void setAddDefaultResource(boolean addDefaultResource) { 1526 _addDefaultResource = addDefaultResource; 1527 } 1528 1529 /** 1530 * Sets a string of ordered comma delimited portlet ids. 1531 * 1532 * @param roles a string of ordered comma delimited portlet ids 1533 */ 1534 public void setRoles(String roles) { 1535 _rolesArray = StringUtil.split(roles); 1536 1537 super.setRoles(roles); 1538 } 1539 1540 /** 1541 * Gets an array of required roles of the portlet. 1542 * 1543 * @return an array of required roles of the portlet 1544 */ 1545 public String[] getRolesArray() { 1546 return _rolesArray; 1547 } 1548 1549 /** 1550 * Sets an array of required roles of the portlet. 1551 * 1552 * @param rolesArray an array of required roles of the portlet 1553 */ 1554 public void setRolesArray(String[] rolesArray) { 1555 _rolesArray = rolesArray; 1556 1557 super.setRoles(StringUtil.merge(rolesArray)); 1558 } 1559 1560 /** 1561 * Gets the unlinked roles of the portlet. 1562 * 1563 * @return unlinked roles of the portlet 1564 */ 1565 public Set getUnlinkedRoles() { 1566 return _unlinkedRoles; 1567 } 1568 1569 /** 1570 * Sets the unlinked roles of the portlet. 1571 * 1572 * @param unlinkedRoles the unlinked roles of the portlet 1573 */ 1574 public void setUnlinkedRoles(Set unlinkedRoles) { 1575 _unlinkedRoles = unlinkedRoles; 1576 } 1577 1578 /** 1579 * Gets the role mappers of the portlet. 1580 * 1581 * @return role mappers of the portlet 1582 */ 1583 public Map getRoleMappers() { 1584 return _roleMappers; 1585 } 1586 1587 /** 1588 * Sets the role mappers of the portlet. 1589 * 1590 * @param roleMappers the role mappers of the portlet 1591 */ 1592 public void setRoleMappers(Map roleMappers) { 1593 _roleMappers = roleMappers; 1594 } 1595 1596 /** 1597 * Link the role names set in portlet.xml with the Liferay roles set in 1598 * liferay-portlet.xml. 1599 */ 1600 public void linkRoles() { 1601 List linkedRoles = new ArrayList(); 1602 1603 Iterator itr = _unlinkedRoles.iterator(); 1604 1605 while (itr.hasNext()) { 1606 String unlinkedRole = (String)itr.next(); 1607 1608 String roleLink = (String)_roleMappers.get(unlinkedRole); 1609 1610 if (Validator.isNotNull(roleLink)) { 1611 if (_log.isDebugEnabled()) { 1612 _log.debug( 1613 "Linking role for portlet [" + getPortletId() + 1614 "] with role-name [" + unlinkedRole + 1615 "] to role-link [" + roleLink + "]"); 1616 } 1617 1618 linkedRoles.add(roleLink); 1619 } 1620 else { 1621 _log.error( 1622 "Unable to link role for portlet [" + getPortletId() + 1623 "] with role-name [" + unlinkedRole + 1624 "] because role-link is null"); 1625 } 1626 } 1627 1628 Collections.sort(linkedRoles); 1629 1630 setRolesArray((String[])linkedRoles.toArray(new String[0])); 1631 } 1632 1633 /** 1634 * Returns true if the portlet has a role with the specified name. 1635 * 1636 * @return true if the portlet has a role with the specified name 1637 */ 1638 public boolean hasRoleWithName(String roleName) { 1639 for (int i = 0; i < _rolesArray.length; i++) { 1640 if (_rolesArray[i].equalsIgnoreCase(roleName)) { 1641 return true; 1642 } 1643 } 1644 1645 return false; 1646 } 1647 1648 /** 1649 * Returns true if the user has the permission to add the portlet to a 1650 * layout. 1651 * 1652 * @return true if the user has the permission to add the portlet to a 1653 * layout 1654 */ 1655 public boolean hasAddPortletPermission(long userId) { 1656 try { 1657 if (_rolesArray.length == 0) { 1658 return true; 1659 } 1660 else if (RoleLocalServiceUtil.hasUserRoles( 1661 userId, getCompanyId(), _rolesArray, true)) { 1662 1663 return true; 1664 } 1665 else if (RoleLocalServiceUtil.hasUserRole( 1666 userId, getCompanyId(), RoleImpl.ADMINISTRATOR, true)) { 1667 1668 return true; 1669 } 1670 else { 1671 User user = UserLocalServiceUtil.getUserById(userId); 1672 1673 if (user.isDefaultUser() && hasRoleWithName(RoleImpl.GUEST)) { 1674 return true; 1675 } 1676 } 1677 } 1678 catch (Exception e) { 1679 _log.error(e); 1680 } 1681 1682 return false; 1683 } 1684 1685 /** 1686 * Returns true if the portlet is a system portlet that a user cannot 1687 * manually add to their page. 1688 * 1689 * @return true if the portlet is a system portlet that a user cannot 1690 * manually add to their page 1691 */ 1692 public boolean getSystem() { 1693 return _system; 1694 } 1695 1696 /** 1697 * Returns true if the portlet is a system portlet that a user cannot 1698 * manually add to their page. 1699 * 1700 * @return true if the portlet is a system portlet that a user cannot 1701 * manually add to their page 1702 */ 1703 public boolean isSystem() { 1704 return _system; 1705 } 1706 1707 /** 1708 * Sets to true if the portlet is a system portlet that a user cannot 1709 * manually add to their page. 1710 * 1711 * @param system boolean value for whether the portlet is a system 1712 * portlet that a user cannot manually add to their page 1713 */ 1714 public void setSystem(boolean system) { 1715 _system = system; 1716 } 1717 1718 /** 1719 * Returns true to include the portlet and make it available to be made 1720 * active. 1721 * 1722 * @return true to include the portlet and make it available to be made 1723 * active 1724 */ 1725 public boolean getInclude() { 1726 return _include; 1727 } 1728 1729 /** 1730 * Returns true to include the portlet and make it available to be made 1731 * active. 1732 * 1733 * @return true to include the portlet and make it available to be made 1734 * active 1735 */ 1736 public boolean isInclude() { 1737 return _include; 1738 } 1739 1740 /** 1741 * Sets to true to include the portlet and make it available to be made 1742 * active. 1743 * 1744 * @param include boolean value for whether to include the portlet and 1745 * make it available to be made active 1746 */ 1747 public void setInclude(boolean include) { 1748 _include = include; 1749 } 1750 1751 /** 1752 * Gets the init parameters of the portlet. 1753 * 1754 * @return init parameters of the portlet 1755 */ 1756 public Map getInitParams() { 1757 return _initParams; 1758 } 1759 1760 /** 1761 * Sets the init parameters of the portlet. 1762 * 1763 * @param initParams the init parameters of the portlet 1764 */ 1765 public void setInitParams(Map initParams) { 1766 _initParams = initParams; 1767 } 1768 1769 /** 1770 * Gets expiration cache of the portlet. 1771 * 1772 * @return expiration cache of the portlet 1773 */ 1774 public Integer getExpCache() { 1775 return _expCache; 1776 } 1777 1778 /** 1779 * Sets expiration cache of the portlet. 1780 * 1781 * @param expCache expiration cache of the portlet 1782 */ 1783 public void setExpCache(Integer expCache) { 1784 _expCache = expCache; 1785 } 1786 1787 /** 1788 * Gets the portlet modes of the portlet. 1789 * 1790 * @return portlet modes of the portlet 1791 */ 1792 public Map getPortletModes() { 1793 return _portletModes; 1794 } 1795 1796 /** 1797 * Sets the portlet modes of the portlet. 1798 * 1799 * @param portletModes the portlet modes of the portlet 1800 */ 1801 public void setPortletModes(Map portletModes) { 1802 _portletModes = portletModes; 1803 } 1804 1805 /** 1806 * Returns true if the portlet supports the specified mime type and 1807 * portlet mode. 1808 * 1809 * @return true if the portlet supports the specified mime type and 1810 * portlet mode 1811 */ 1812 public boolean hasPortletMode(String mimeType, PortletMode portletMode) { 1813 if (mimeType == null) { 1814 mimeType = ContentTypes.TEXT_HTML; 1815 } 1816 1817 Set mimeTypeModes = (Set)_portletModes.get(mimeType); 1818 1819 if (mimeTypeModes == null) { 1820 return false; 1821 } 1822 1823 if (mimeTypeModes.contains(portletMode.toString())) { 1824 return true; 1825 } 1826 else { 1827 return false; 1828 } 1829 } 1830 1831 /** 1832 * Gets a list of all portlet modes supported by the portlet. 1833 * 1834 * @return a list of all portlet modes supported by the portlet 1835 */ 1836 public Set getAllPortletModes() { 1837 Set allPortletModes = new TreeSet(); 1838 1839 Iterator itr1 = _portletModes.entrySet().iterator(); 1840 1841 while (itr1.hasNext()) { 1842 Map.Entry entry = (Map.Entry)itr1.next(); 1843 1844 Set mimeTypeModes = (Set)entry.getValue(); 1845 1846 Iterator itr2 = mimeTypeModes.iterator(); 1847 1848 while (itr2.hasNext()) { 1849 String portletMode = (String)itr2.next(); 1850 1851 allPortletModes.add(portletMode); 1852 } 1853 } 1854 1855 return allPortletModes; 1856 } 1857 1858 /** 1859 * Returns true if the portlet supports more than one mime type. 1860 * 1861 * @return true if the portlet supports more than one mime type 1862 */ 1863 public boolean hasMultipleMimeTypes() { 1864 if (_portletModes.size() > 1) { 1865 return true; 1866 } 1867 else { 1868 return false; 1869 } 1870 } 1871 1872 /** 1873 * Gets the supported locales of the portlet. 1874 * 1875 * @return supported locales of the portlet 1876 */ 1877 public Set getSupportedLocales() { 1878 return _supportedLocales; 1879 } 1880 1881 /** 1882 * Sets the supported locales of the portlet. 1883 * 1884 * @param supportedLocales the supported locales of the portlet 1885 */ 1886 public void setSupportedLocales(Set supportedLocales) { 1887 _supportedLocales = supportedLocales; 1888 } 1889 1890 /** 1891 * Gets the resource bundle of the portlet. 1892 * 1893 * @return resource bundle of the portlet 1894 */ 1895 public String getResourceBundle() { 1896 return _resourceBundle; 1897 } 1898 1899 /** 1900 * Sets the resource bundle of the portlet. 1901 * 1902 * @param resourceBundle the resource bundle of the portlet 1903 */ 1904 public void setResourceBundle(String resourceBundle) { 1905 _resourceBundle = resourceBundle; 1906 } 1907 1908 /** 1909 * Gets the portlet info of the portlet. 1910 * 1911 * @return portlet info of the portlet 1912 */ 1913 public PortletInfo getPortletInfo() { 1914 return _portletInfo; 1915 } 1916 1917 /** 1918 * Sets the portlet info of the portlet. 1919 * 1920 * @param portletInfo the portlet info of the portlet 1921 */ 1922 public void setPortletInfo(PortletInfo portletInfo) { 1923 _portletInfo = portletInfo; 1924 } 1925 1926 /** 1927 * Gets the user attributes of the portlet. 1928 * 1929 * @return user attributes of the portlet 1930 */ 1931 public Set getUserAttributes() { 1932 return _userAttributes; 1933 } 1934 1935 /** 1936 * Sets the user attributes of the portlet. 1937 * 1938 * @param userAttributes the user attributes of the portlet 1939 */ 1940 public void setUserAttributes(Set userAttributes) { 1941 _userAttributes = userAttributes; 1942 } 1943 1944 /** 1945 * Gets the custom user attributes of the portlet. 1946 * 1947 * @return custom user attributes of the portlet 1948 */ 1949 public Map getCustomUserAttributes() { 1950 return _customUserAttributes; 1951 } 1952 1953 /** 1954 * Sets the custom user attributes of the portlet. 1955 * 1956 * @param customUserAttributes the custom user attributes of the 1957 * portlet 1958 */ 1959 public void setCustomUserAttributes(Map customUserAttributes) { 1960 _customUserAttributes = customUserAttributes; 1961 } 1962 1963 /** 1964 * Gets the servlet context name of the portlet. 1965 * 1966 * @return the servlet context name of the portlet 1967 */ 1968 public String getServletContextName() { 1969 return _servletContextName; 1970 } 1971 1972 /** 1973 * Sets the servlet context name of the portlet. 1974 * 1975 * @param servletContextName the servlet context name of the portlet 1976 */ 1977 public void setServletContextName(String servletContextName) { 1978 _servletContextName = servletContextName; 1979 1980 if (Validator.isNotNull(_servletContextName)) { 1981 _warFile = true; 1982 } 1983 else { 1984 _warFile = false; 1985 } 1986 } 1987 1988 /** 1989 * Returns true if the portlet is found in a WAR file. 1990 * 1991 * @return true if the portlet is found in a WAR file 1992 */ 1993 public boolean getWARFile() { 1994 return _warFile; 1995 } 1996 1997 /** 1998 * Returns true if the portlet is found in a WAR file. 1999 * 2000 * @return true if the portlet is found in a WAR file 2001 */ 2002 public boolean isWARFile() { 2003 return _warFile; 2004 } 2005 2006 /** 2007 * Sets to true if the portlet is found in a WAR file. 2008 * 2009 * @param warFile boolean value for whether the portlet is found in a 2010 * WAR file 2011 */ 2012 public void setWARFile(boolean warFile) { 2013 _warFile = warFile; 2014 } 2015 2016 /** 2017 * Gets the servlet context path of the portlet. 2018 * 2019 * @return the servlet context path of the portlet 2020 */ 2021 public String getContextPath() { 2022 String virtualPath = getVirtualPath(); 2023 2024 if (Validator.isNotNull(virtualPath)) { 2025 return virtualPath; 2026 } 2027 2028 if (isWARFile()) { 2029 StringMaker sm = new StringMaker(); 2030 2031 sm.append(StringPool.SLASH); 2032 sm.append(getServletContextName()); 2033 2034 return sm.toString(); 2035 } 2036 else { 2037 return PortalUtil.getPathContext(); 2038 } 2039 } 2040 2041 /** 2042 * Returns true if the portlet is found in a WAR file. 2043 * 2044 * @param portletId the cloned instance portlet id 2045 * @return a cloned instance of the portlet 2046 */ 2047 public Portlet getClonedInstance(String portletId) { 2048 if (_clonedInstances == null) { 2049 2050 // LEP-528 2051 2052 return null; 2053 } 2054 2055 Portlet clonedInstance = (Portlet)_clonedInstances.get(portletId); 2056 2057 if (clonedInstance == null) { 2058 clonedInstance = (Portlet)clone(); 2059 2060 clonedInstance.setPortletId(portletId); 2061 2062 // Disable caching of cloned instances until we can figure out how 2063 // to elegantly refresh the cache when the portlet is dynamically 2064 // updated by the user. For example, the user might change the 2065 // portlet from one column to the next. Cloned instances that are 2066 // cached would not see the new change. We can then also cache 2067 // static portlet instances. 2068 2069 //_clonedInstances.put(portletId, clonedInstance); 2070 } 2071 2072 return clonedInstance; 2073 } 2074 2075 /** 2076 * Returns true if the portlet is a static portlet that is cannot be moved. 2077 * 2078 * @return true if the portlet is a static portlet that is cannot be 2079 * moved 2080 */ 2081 public boolean getStatic() { 2082 return _staticPortlet; 2083 } 2084 2085 /** 2086 * Returns true if the portlet is a static portlet that is cannot be moved. 2087 * 2088 * @return true if the portlet is a static portlet that is cannot be 2089 * moved 2090 */ 2091 public boolean isStatic() { 2092 return _staticPortlet; 2093 } 2094 2095 /** 2096 * Sets to true if the portlet is a static portlet that is cannot be moved. 2097 * 2098 * @param staticPortlet boolean value for whether the portlet is a 2099 * static portlet that cannot be moved 2100 */ 2101 public void setStatic(boolean staticPortlet) { 2102 _staticPortlet = staticPortlet; 2103 } 2104 2105 /** 2106 * Returns true if the portlet is a static portlet at the start of a list of 2107 * portlets. 2108 * 2109 * @return true if the portlet is a static portlet at the start of a 2110 * list of portlets 2111 */ 2112 public boolean getStaticStart() { 2113 return _staticPortletStart; 2114 } 2115 2116 /** 2117 * Returns true if the portlet is a static portlet at the start of a list of 2118 * portlets. 2119 * 2120 * @return true if the portlet is a static portlet at the start of a 2121 * list of portlets 2122 */ 2123 public boolean isStaticStart() { 2124 return _staticPortletStart; 2125 } 2126 2127 /** 2128 * Sets to true if the portlet is a static portlet at the start of a list of 2129 * portlets. 2130 * 2131 * @param staticPortletStart boolean value for whether the portlet is 2132 * a static portlet at the start of a list of portlets 2133 */ 2134 public void setStaticStart(boolean staticPortletStart) { 2135 _staticPortletStart = staticPortletStart; 2136 } 2137 2138 /** 2139 * Returns true if the portlet is a static portlet at the end of a list of 2140 * portlets. 2141 * 2142 * @return true if the portlet is a static portlet at the end of a 2143 * list of portlets 2144 */ 2145 public boolean getStaticEnd() { 2146 return !_staticPortletStart; 2147 } 2148 2149 /** 2150 * Returns true if the portlet is a static portlet at the end of a list of 2151 * portlets. 2152 * 2153 * @return true if the portlet is a static portlet at the end of a 2154 * list of portlets 2155 */ 2156 public boolean isStaticEnd() { 2157 return !_staticPortletStart; 2158 } 2159 2160 /** 2161 * The servlet url patterns that are part of this application. 2162 * 2163 * @return The servlet url patterns that are part of this application 2164 */ 2165 public List getServletURLPatterns() { 2166 return _servletURLPatterns; 2167 } 2168 2169 /** 2170 * The servlet url patterns that are part of this application. 2171 * 2172 * @param servletURLPatterns servlet url patterns that are part of 2173 * this application 2174 */ 2175 public void setServletURLPatterns(List servletURLPatterns) { 2176 _servletURLPatterns = servletURLPatterns; 2177 } 2178 2179 /** 2180 * Creates and returns a copy of this object. 2181 * 2182 * @return a copy of this object 2183 */ 2184 public Object clone() { 2185 return new PortletImpl( 2186 getPortletId(), getPluginPackage(), getDefaultPluginSetting(), 2187 getCompanyId(), getIcon(), getVirtualPath(), getStrutsPath(), 2188 getDisplayName(), getPortletClass(), getConfigurationActionClass(), 2189 getIndexerClass(), getOpenSearchClass(), getSchedulerClass(), 2190 getPortletURLClass(), getFriendlyURLMapperClass(), 2191 getURLEncoderClass(), getPortletDataHandlerClass(), 2192 getPortletLayoutListenerClass(), getSmtpMessageListenerClass(), 2193 getDefaultPreferences(), getPreferencesValidator(), 2194 isPreferencesCompanyWide(), isPreferencesUniquePerLayout(), 2195 isPreferencesOwnedByGroup(), isUseDefaultTemplate(), 2196 isShowPortletAccessDenied(), isShowPortletInactive(), 2197 isActionURLRedirect(), isRestoreCurrentView(), isMaximizeEdit(), 2198 isMaximizeHelp(), isPopUpPrint(), isLayoutCacheable(), 2199 isInstanceable(), isPrivateRequestAttributes(), 2200 isPrivateSessionAttributes(), getRenderWeight(), isAjaxable(), 2201 getHeaderPortalCss(), getHeaderPortletCss(), 2202 getHeaderPortalJavaScript(), getHeaderPortletJavaScript(), 2203 getFooterPortalCss(), getFooterPortletCss(), 2204 getFooterPortalJavaScript(), getFooterPortletJavaScript(), 2205 isAddDefaultResource(), getRoles(), getUnlinkedRoles(), 2206 getRoleMappers(), isSystem(), isActive(), isInclude(), 2207 getInitParams(), getExpCache(), getPortletModes(), 2208 getSupportedLocales(), getResourceBundle(), getPortletInfo(), 2209 getUserAttributes(), getCustomUserAttributes(), 2210 getServletContextName(), getServletURLPatterns()); 2211 } 2212 2213 /** 2214 * Compares this portlet to the specified object. 2215 * 2216 * @param obj the object to compare this portlet against 2217 * @return the value 0 if the argument portlet is equal to this 2218 * portlet; a value less than -1 if this portlet is less than 2219 * the portlet argument; and 1 if this portlet is greater than 2220 * the portlet argument 2221 */ 2222 public int compareTo(Object obj) { 2223 Portlet portlet = (Portlet)obj; 2224 2225 return getPortletId().compareTo(portlet.getPortletId()); 2226 } 2227 2228 /** 2229 * Checks whether this portlet is equal to the specified object. 2230 * 2231 * @param obj the object to compare this portlet against 2232 * @return true if the portlet is equal to the specified object 2233 */ 2234 public boolean equals(Object obj) { 2235 Portlet portlet = (Portlet)obj; 2236 2237 return getPortletId().equals(portlet.getPortletId()); 2238 } 2239 2240 /** 2241 * Log instance for this class. 2242 */ 2243 private static Log _log = LogFactory.getLog(PortletImpl.class); 2244 2245 /** 2246 * Package to which this plugin belongs to. 2247 */ 2248 private PluginPackage _pluginPackage; 2249 2250 /** 2251 * Plugin settings associated with the portlet. 2252 */ 2253 private PluginSetting _defaultPluginSetting; 2254 2255 /** 2256 * The icon of the portlet. 2257 */ 2258 private String _icon; 2259 2260 /** 2261 * The virtual path of the portlet. 2262 */ 2263 private String _virtualPath; 2264 2265 /** 2266 * The struts path of the portlet. 2267 */ 2268 private String _strutsPath; 2269 2270 /** 2271 * The display name of the portlet. 2272 */ 2273 private String _displayName; 2274 2275 /** 2276 * The name of the portlet class of the portlet. 2277 */ 2278 private String _portletClass; 2279 2280 /** 2281 * The configuration action class of the portlet. 2282 */ 2283 private String _configurationActionClass; 2284 2285 /** 2286 * The name of the indexer class of the portlet. 2287 */ 2288 private String _indexerClass; 2289 2290 /** 2291 * The name of the open search class of the portlet. 2292 */ 2293 private String _openSearchClass; 2294 2295 /** 2296 * The name of the scheduler class of the portlet. 2297 */ 2298 private String _schedulerClass; 2299 2300 /** 2301 * The name of the portlet URL class of the portlet. 2302 */ 2303 private String _portletURLClass; 2304 2305 /** 2306 * The name of the friendly URL mapper class of the portlet. 2307 */ 2308 private String _friendlyURLMapperClass; 2309 2310 /** 2311 * The name of the URL encoder class of the portlet. 2312 */ 2313 private String _urlEncoderClass; 2314 2315 /** 2316 * The name of the portlet data handler class of the portlet. 2317 */ 2318 private String _portletDataHandlerClass; 2319 2320 /** 2321 * The name of the portlet data layout listener class of the portlet. 2322 */ 2323 private String _portletLayoutListenerClass; 2324 2325 /** 2326 * The name of the SMTP message listener class of the portlet. 2327 */ 2328 private String _smtpMessageListenerClass; 2329 2330 /** 2331 * The default preferences of the portlet. 2332 */ 2333 private String _defaultPreferences; 2334 2335 /** 2336 * The name of the preferences validator class of the portlet. 2337 */ 2338 private String _prefsValidator; 2339 2340 /** 2341 * True if preferences are shared across the entire company. 2342 */ 2343 private boolean _prefsCompanyWide; 2344 2345 /** 2346 * True if preferences are unique per layout. 2347 */ 2348 private boolean _prefsUniquePerLayout = true; 2349 2350 /** 2351 * True if preferences are owned by the group when the portlet is shown in a 2352 * group layout. False if preferences are owned by the user at all times. 2353 */ 2354 private boolean _prefsOwnedByGroup = true; 2355 2356 /** 2357 * True if the portlet uses the default template. 2358 */ 2359 private boolean _useDefaultTemplate = true; 2360 2361 /** 2362 * True if users are shown that they do not have access to the portlet. 2363 */ 2364 private boolean _showPortletAccessDenied = GetterUtil.getBoolean( 2365 PropsUtil.get(PropsUtil.LAYOUT_SHOW_PORTLET_ACCESS_DENIED)); 2366 2367 /** 2368 * True if users are shown that the portlet is inactive. 2369 */ 2370 private boolean _showPortletInactive = GetterUtil.getBoolean( 2371 PropsUtil.get(PropsUtil.LAYOUT_SHOW_PORTLET_INACTIVE)); 2372 2373 /** 2374 * True if an action URL for this portlet should cause an auto redirect. 2375 */ 2376 private boolean _actionURLRedirect; 2377 2378 /** 2379 * True if the portlet restores to the current view from the maximized 2380 * state. 2381 */ 2382 private boolean _restoreCurrentView = true; 2383 2384 /** 2385 * True if the portlet goes into the maximized state when the user goes into 2386 * the edit mode. 2387 */ 2388 private boolean _maximizeEdit; 2389 2390 /** 2391 * True if the portlet goes into the maximized state when the user goes into 2392 * the help mode. 2393 */ 2394 private boolean _maximizeHelp; 2395 2396 /** 2397 * True if the portlet goes into the pop up state when the user goes into 2398 * the print mode. 2399 */ 2400 private boolean _popUpPrint = true; 2401 2402 /** 2403 * True if the portlet can be cached within the layout. 2404 */ 2405 private boolean _layoutCacheable; 2406 2407 /** 2408 * True if the portlet can be added multiple times to a layout. 2409 */ 2410 private boolean _instanceable; 2411 2412 /** 2413 * True if the portlet does not share request attributes with the portal or 2414 * portlets from another WAR. 2415 */ 2416 private boolean _privateRequestAttributes = true; 2417 2418 /** 2419 * True if the portlet does not share session attributes with the portal. 2420 */ 2421 private boolean _privateSessionAttributes = true; 2422 2423 /** 2424 * Render weight of the portlet. 2425 */ 2426 private int _renderWeight = 1; 2427 2428 /** 2429 * True if the portlet can be displayed via Ajax. 2430 */ 2431 private boolean _ajaxable = true; 2432 2433 /** 2434 * A list of CSS files that will be referenced from the page's header 2435 * relative to the portal's context path. 2436 */ 2437 private List _headerPortalCss; 2438 2439 /** 2440 * A list of CSS files that will be referenced from the page's header 2441 * relative to the portlet's context path. 2442 */ 2443 private List _headerPortletCss; 2444 2445 /** 2446 * A list of JavaScript files that will be referenced from the page's header 2447 * relative to the portal's context path. 2448 */ 2449 private List _headerPortalJavaScript; 2450 2451 /** 2452 * A list of JavaScript files that will be referenced from the page's header 2453 * relative to the portlet's context path. 2454 */ 2455 private List _headerPortletJavaScript; 2456 2457 /** 2458 * A list of CSS files that will be referenced from the page's footer 2459 * relative to the portal's context path. 2460 */ 2461 private List _footerPortalCss; 2462 2463 /** 2464 * A list of CSS files that will be referenced from the page's footer 2465 * relative to the portlet's context path. 2466 */ 2467 private List _footerPortletCss; 2468 2469 /** 2470 * A list of JavaScript files that will be referenced from the page's footer 2471 * relative to the portal's context path. 2472 */ 2473 private List _footerPortalJavaScript; 2474 2475 /** 2476 * A list of JavaScript files that will be referenced from the page's footer 2477 * relative to the portlet's context path. 2478 */ 2479 private List _footerPortletJavaScript; 2480 2481 /** 2482 * True if default resources for the portlet are added to a page. 2483 */ 2484 private boolean _addDefaultResource; 2485 2486 /** 2487 * An array of required roles of the portlet. 2488 */ 2489 private String[] _rolesArray; 2490 2491 /** 2492 * The unlinked roles of the portlet. 2493 */ 2494 private Set _unlinkedRoles; 2495 2496 /** 2497 * The role mappers of the portlet. 2498 */ 2499 private Map _roleMappers; 2500 2501 /** 2502 * True if the portlet is a system portlet that a user cannot manually add 2503 * to their page. 2504 */ 2505 private boolean _system; 2506 2507 /** 2508 * True to include the portlet and make it available to be made active. 2509 */ 2510 private boolean _include = true; 2511 2512 /** 2513 * The init parameters of the portlet. 2514 */ 2515 private Map _initParams; 2516 2517 /** 2518 * The expiration cache of the portlet. 2519 */ 2520 private Integer _expCache; 2521 2522 /** 2523 * The portlet modes of the portlet. 2524 */ 2525 private Map _portletModes; 2526 2527 /** 2528 * The supported locales of the portlet. 2529 */ 2530 private Set _supportedLocales; 2531 2532 /** 2533 * The resource bundle of the portlet. 2534 */ 2535 private String _resourceBundle; 2536 2537 /** 2538 * The portlet info of the portlet. 2539 */ 2540 private PortletInfo _portletInfo; 2541 2542 /** 2543 * The user attributes of the portlet. 2544 */ 2545 private Set _userAttributes; 2546 2547 /** 2548 * The custom user attributes of the portlet. 2549 */ 2550 private Map _customUserAttributes; 2551 2552 /** 2553 * The servlet context name of the portlet. 2554 */ 2555 private String _servletContextName; 2556 2557 /** 2558 * True if the portlet is found in a WAR file. 2559 */ 2560 private boolean _warFile; 2561 2562 /** 2563 * The cloned instances of the portlet. 2564 */ 2565 private Map _clonedInstances; 2566 2567 /** 2568 * True if the portlet is a static portlet that is cannot be moved. 2569 */ 2570 private boolean _staticPortlet; 2571 2572 /** 2573 * True if the portlet is a static portlet at the start of a list of 2574 * portlets. 2575 */ 2576 private boolean _staticPortletStart; 2577 2578 /** 2579 * The servlet url patterns that are part of this application. 2580 */ 2581 private List _servletURLPatterns; 2582 2583}