0001: /**
0002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
0003: *
0004: * Permission is hereby granted, free of charge, to any person obtaining a copy
0005: * of this software and associated documentation files (the "Software"), to deal
0006: * in the Software without restriction, including without limitation the rights
0007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
0008: * copies of the Software, and to permit persons to whom the Software is
0009: * furnished to do so, subject to the following conditions:
0010: *
0011: * The above copyright notice and this permission notice shall be included in
0012: * all copies or substantial portions of the Software.
0013: *
0014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
0017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
0019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0020: * SOFTWARE.
0021: */package com.liferay.portal.model.impl;
0022:
0023: import com.liferay.portal.kernel.lar.PortletDataHandler;
0024: import com.liferay.portal.kernel.plugin.PluginPackage;
0025: import com.liferay.portal.kernel.pop.MessageListener;
0026: import com.liferay.portal.kernel.portlet.ConfigurationAction;
0027: import com.liferay.portal.kernel.portlet.FriendlyURLMapper;
0028: import com.liferay.portal.kernel.portlet.PortletLayoutListener;
0029: import com.liferay.portal.kernel.servlet.URLEncoder;
0030: import com.liferay.portal.kernel.util.ContentTypes;
0031: import com.liferay.portal.kernel.util.InstancePool;
0032: import com.liferay.portal.kernel.util.StringMaker;
0033: import com.liferay.portal.kernel.util.StringPool;
0034: import com.liferay.portal.kernel.util.StringUtil;
0035: import com.liferay.portal.kernel.util.Validator;
0036: import com.liferay.portal.model.ActivityTrackerInterpreter;
0037: import com.liferay.portal.model.PluginSetting;
0038: import com.liferay.portal.model.Portlet;
0039: import com.liferay.portal.model.PortletInfo;
0040: import com.liferay.portal.model.User;
0041: import com.liferay.portal.service.RoleLocalServiceUtil;
0042: import com.liferay.portal.service.UserLocalServiceUtil;
0043: import com.liferay.portal.servlet.PortletContextPool;
0044: import com.liferay.portal.servlet.PortletContextWrapper;
0045: import com.liferay.portal.util.PortalUtil;
0046: import com.liferay.portal.util.PropsValues;
0047:
0048: import java.util.ArrayList;
0049: import java.util.Collections;
0050: import java.util.HashMap;
0051: import java.util.HashSet;
0052: import java.util.Hashtable;
0053: import java.util.Iterator;
0054: import java.util.LinkedHashMap;
0055: import java.util.LinkedHashSet;
0056: import java.util.List;
0057: import java.util.Map;
0058: import java.util.Set;
0059: import java.util.TreeSet;
0060:
0061: import javax.portlet.PortletMode;
0062:
0063: import org.apache.commons.logging.Log;
0064: import org.apache.commons.logging.LogFactory;
0065:
0066: /**
0067: * <a href="PortletImpl.java.html"><b><i>View Source</i></b></a>
0068: *
0069: * @author Brian Wing Shun Chan
0070: *
0071: */
0072: public class PortletImpl extends PortletModelImpl implements Portlet {
0073:
0074: /**
0075: * Plugin type
0076: */
0077: public static final String PLUGIN_TYPE = "portlet";
0078:
0079: /**
0080: * War file separator.
0081: */
0082: public static final String WAR_SEPARATOR = "_WAR_";
0083:
0084: /**
0085: * Instance separator.
0086: */
0087: public static final String INSTANCE_SEPARATOR = "_INSTANCE_";
0088:
0089: /**
0090: * Layout separator.
0091: */
0092: public static final String LAYOUT_SEPARATOR = "_LAYOUT_";
0093:
0094: /**
0095: * Default preferences.
0096: */
0097: public static final String DEFAULT_PREFERENCES = "<portlet-preferences />";
0098:
0099: /**
0100: * User principal strategy for screen name.
0101: */
0102: public static final String USER_PRINCIPAL_STRATEGY_SCREEN_NAME = "screenName";
0103:
0104: /**
0105: * User principal strategy for screen name.
0106: */
0107: public static final String USER_PRINCIPAL_STRATEGY_USER_ID = "userId";
0108:
0109: /**
0110: * Gets the root portlet id of the portlet.
0111: *
0112: * @param portletId the portlet id of the portlet
0113: * @return the root portlet id of the portlet
0114: */
0115: public static String getRootPortletId(String portletId) {
0116: int pos = portletId.indexOf(INSTANCE_SEPARATOR);
0117:
0118: if (pos == -1) {
0119: return portletId;
0120: } else {
0121: return portletId.substring(0, pos);
0122: }
0123: }
0124:
0125: /**
0126: * Gets the instance id of the portlet.
0127: *
0128: * @param portletId the portlet id of the portlet
0129: * @return the instance id of the portlet
0130: */
0131: public static String getInstanceId(String portletId) {
0132: int pos = portletId.indexOf(INSTANCE_SEPARATOR);
0133:
0134: if (pos == -1) {
0135: return null;
0136: } else {
0137: return portletId.substring(pos
0138: + INSTANCE_SEPARATOR.length(), portletId.length());
0139: }
0140: }
0141:
0142: /**
0143: * Constructs a portlet with no parameters.
0144: */
0145: public PortletImpl() {
0146: }
0147:
0148: /**
0149: * Constructs a portlet with the specified parameters.
0150: */
0151: public PortletImpl(long companyId, String portletId) {
0152: setCompanyId(companyId);
0153: setPortletId(portletId);
0154: setStrutsPath(portletId);
0155: setActive(true);
0156: _headerPortalCss = new ArrayList();
0157: _headerPortletCss = new ArrayList();
0158: _headerPortalJavaScript = new ArrayList();
0159: _headerPortletJavaScript = new ArrayList();
0160: _footerPortalCss = new ArrayList();
0161: _footerPortletCss = new ArrayList();
0162: _footerPortalJavaScript = new ArrayList();
0163: _footerPortletJavaScript = new ArrayList();
0164: _unlinkedRoles = new HashSet();
0165: _roleMappers = new LinkedHashMap();
0166: _initParams = new HashMap();
0167: _portletModes = new HashMap();
0168: _supportedLocales = new HashSet();
0169: _userAttributes = new LinkedHashSet();
0170: _customUserAttributes = new LinkedHashMap();
0171: }
0172:
0173: /**
0174: * Constructs a portlet with the specified parameters.
0175: */
0176: public PortletImpl(String portletId, PluginPackage pluginPackage,
0177: PluginSetting pluginSetting, long companyId, String icon,
0178: String virtualPath, String strutsPath, String displayName,
0179: String portletClass, String configurationActionClass,
0180: String indexerClass, String openSearchClass,
0181: String schedulerClass, String portletURLClass,
0182: String friendlyURLMapperClass, String urlEncoderClass,
0183: String portletDataHandlerClass,
0184: String portletLayoutListenerClass,
0185: String activityTrackerInterpreterClass,
0186: String popMessageListenerClass, String defaultPreferences,
0187: String prefsValidator, boolean prefsCompanyWide,
0188: boolean prefsUniquePerLayout, boolean prefsOwnedByGroup,
0189: boolean useDefaultTemplate,
0190: boolean showPortletAccessDenied,
0191: boolean showPortletInactive, boolean actionURLRedirect,
0192: boolean restoreCurrentView, boolean maximizeEdit,
0193: boolean maximizeHelp, boolean popUpPrint,
0194: boolean layoutCacheable, boolean instanceable,
0195: String userPrincipalStrategy,
0196: boolean privateRequestAttributes,
0197: boolean privateSessionAttributes, int renderWeight,
0198: boolean ajaxable, List headerPortalCss,
0199: List headerPortletCss, List headerPortalJavaScript,
0200: List headerPortletJavaScript, List footerPortalCss,
0201: List footerPortletCss, List footerPortalJavaScript,
0202: List footerPortletJavaScript, String cssClassWrapper,
0203: boolean addDefaultResource, String roles,
0204: Set unlinkedRoles, Map roleMappers, boolean system,
0205: boolean active, boolean include, Map initParams,
0206: Integer expCache, Map portletModes, Set supportedLocales,
0207: String resourceBundle, PortletInfo portletInfo,
0208: Set userAttributes, Map customUserAttributes,
0209: String servletContextName, List servletURLPatterns) {
0210:
0211: setPortletId(portletId);
0212: _pluginPackage = pluginPackage;
0213: _defaultPluginSetting = pluginSetting;
0214: setCompanyId(companyId);
0215: _icon = icon;
0216: _virtualPath = virtualPath;
0217: _strutsPath = strutsPath;
0218: _displayName = displayName;
0219: _portletClass = portletClass;
0220: _configurationActionClass = configurationActionClass;
0221: _indexerClass = indexerClass;
0222: _openSearchClass = openSearchClass;
0223: _schedulerClass = schedulerClass;
0224: _portletURLClass = portletURLClass;
0225: _friendlyURLMapperClass = friendlyURLMapperClass;
0226: _urlEncoderClass = urlEncoderClass;
0227: _portletDataHandlerClass = portletDataHandlerClass;
0228: _portletLayoutListenerClass = portletLayoutListenerClass;
0229: _activityTrackerInterpreterClass = activityTrackerInterpreterClass;
0230: _popMessageListenerClass = popMessageListenerClass;
0231: _defaultPreferences = defaultPreferences;
0232: _prefsValidator = prefsValidator;
0233: _prefsCompanyWide = prefsCompanyWide;
0234: _prefsUniquePerLayout = prefsUniquePerLayout;
0235: _prefsOwnedByGroup = prefsOwnedByGroup;
0236: _useDefaultTemplate = useDefaultTemplate;
0237: _showPortletAccessDenied = showPortletAccessDenied;
0238: _showPortletInactive = showPortletInactive;
0239: _actionURLRedirect = actionURLRedirect;
0240: _restoreCurrentView = restoreCurrentView;
0241: _maximizeEdit = maximizeEdit;
0242: _maximizeHelp = maximizeHelp;
0243: _popUpPrint = popUpPrint;
0244: _layoutCacheable = layoutCacheable;
0245: _instanceable = instanceable;
0246: _userPrincipalStrategy = userPrincipalStrategy;
0247: _privateRequestAttributes = privateRequestAttributes;
0248: _privateSessionAttributes = privateSessionAttributes;
0249: _renderWeight = renderWeight;
0250: _ajaxable = ajaxable;
0251: _headerPortalCss = headerPortalCss;
0252: _headerPortletCss = headerPortletCss;
0253: _headerPortalJavaScript = headerPortalJavaScript;
0254: _headerPortletJavaScript = headerPortletJavaScript;
0255: _footerPortalCss = footerPortalCss;
0256: _footerPortletCss = footerPortletCss;
0257: _footerPortalJavaScript = footerPortalJavaScript;
0258: _footerPortletJavaScript = footerPortletJavaScript;
0259: _cssClassWrapper = cssClassWrapper;
0260: _addDefaultResource = addDefaultResource;
0261: setRoles(roles);
0262: _unlinkedRoles = unlinkedRoles;
0263: _roleMappers = roleMappers;
0264: _system = system;
0265: setActive(active);
0266: _include = include;
0267: _initParams = initParams;
0268: _expCache = expCache;
0269: _portletModes = portletModes;
0270: _supportedLocales = supportedLocales;
0271: _resourceBundle = resourceBundle;
0272: _portletInfo = portletInfo;
0273: _userAttributes = userAttributes;
0274: _customUserAttributes = customUserAttributes;
0275: setServletContextName(servletContextName);
0276: _servletURLPatterns = servletURLPatterns;
0277:
0278: if (_instanceable) {
0279: _clonedInstances = new Hashtable();
0280: }
0281: }
0282:
0283: /**
0284: * Gets the root portlet id of the portlet.
0285: *
0286: * @return the root portlet id of the portlet
0287: */
0288: public String getRootPortletId() {
0289: return getRootPortletId(getPortletId());
0290: }
0291:
0292: /**
0293: * Gets the instance id of the portlet.
0294: *
0295: * @return the instance id of the portlet
0296: */
0297: public String getInstanceId() {
0298: return getInstanceId(getPortletId());
0299: }
0300:
0301: /**
0302: * Gets the plugin id of the portlet.
0303: *
0304: * @return the plugin id of the portlet
0305: */
0306: public String getPluginId() {
0307: return getRootPortletId();
0308: }
0309:
0310: /**
0311: * Gets the plugin type of the portlet.
0312: *
0313: * @return the plugin type of the portlet
0314: */
0315: public String getPluginType() {
0316: return PLUGIN_TYPE;
0317: }
0318:
0319: /**
0320: * Get the package to which the portlet belongs to.
0321: *
0322: * @return the plugin package of the portlet
0323: */
0324: public PluginPackage getPluginPackage() {
0325: return _pluginPackage;
0326: }
0327:
0328: /**
0329: * Sets the plugin package to which this portlet belongs to.
0330: *
0331: * @param pluginPackage the plugin package
0332: */
0333: public void setPluginPackage(PluginPackage pluginPackage) {
0334: _pluginPackage = pluginPackage;
0335: }
0336:
0337: /**
0338: * Get the default plugin settings of the portlet.
0339: *
0340: * @return the plugin settings
0341: */
0342: public PluginSetting getDefaultPluginSetting() {
0343: return _defaultPluginSetting;
0344: }
0345:
0346: /**
0347: * Sets the default plugin settings of the portlet.
0348: *
0349: * @param pluginSetting the plugin setting
0350: */
0351: public void setDefaultPluginSetting(PluginSetting pluginSetting) {
0352: _defaultPluginSetting = pluginSetting;
0353: }
0354:
0355: /**
0356: * Gets the icon of the portlet.
0357: *
0358: * @return the icon of the portlet
0359: */
0360: public String getIcon() {
0361: return _icon;
0362: }
0363:
0364: /**
0365: * Sets the icon of the portlet.
0366: *
0367: * @param icon the icon of the portlet
0368: */
0369: public void setIcon(String icon) {
0370: _icon = icon;
0371: }
0372:
0373: /**
0374: * Gets the virtual path of the portlet.
0375: *
0376: * @return the virtual path of the portlet
0377: */
0378: public String getVirtualPath() {
0379: return _virtualPath;
0380: }
0381:
0382: /**
0383: * Sets the virtual path of the portlet.
0384: *
0385: * @param virtualPath the virtual path of the portlet
0386: */
0387: public void setVirtualPath(String virtualPath) {
0388: if (_warFile && Validator.isNull(virtualPath)) {
0389: virtualPath = PropsValues.PORTLET_VIRTUAL_PATH;
0390: }
0391:
0392: _virtualPath = virtualPath;
0393: }
0394:
0395: /**
0396: * Gets the struts path of the portlet.
0397: *
0398: * @return the struts path of the portlet
0399: */
0400: public String getStrutsPath() {
0401: return _strutsPath;
0402: }
0403:
0404: /**
0405: * Sets the struts path of the portlet.
0406: *
0407: * @param strutsPath the struts path of the portlet
0408: */
0409: public void setStrutsPath(String strutsPath) {
0410: _strutsPath = strutsPath;
0411: }
0412:
0413: /**
0414: * Gets the display name of the portlet.
0415: *
0416: * @return the display name of the portlet
0417: */
0418: public String getDisplayName() {
0419: return _displayName;
0420: }
0421:
0422: /**
0423: * Sets the display name of the portlet.
0424: *
0425: * @param displayName the display name of the portlet
0426: */
0427: public void setDisplayName(String displayName) {
0428: _displayName = displayName;
0429: }
0430:
0431: /**
0432: * Gets the name of the portlet class of the portlet.
0433: *
0434: * @return the name of the portlet class of the portlet
0435: */
0436: public String getPortletClass() {
0437: return _portletClass;
0438: }
0439:
0440: /**
0441: * Sets the name of the portlet class of the portlet.
0442: *
0443: * @param portletClass the name of the portlet class of the portlet
0444: */
0445: public void setPortletClass(String portletClass) {
0446: _portletClass = portletClass;
0447: }
0448:
0449: /**
0450: * Gets the configuration action class of the portlet.
0451: *
0452: * @return the configuration action class of the portlet
0453: */
0454: public String getConfigurationActionClass() {
0455: return _configurationActionClass;
0456: }
0457:
0458: /**
0459: * Sets the configuration action class of the portlet.
0460: *
0461: * @param configurationActionClass the configuration action class of
0462: * the portlet
0463: */
0464: public void setConfigurationActionClass(
0465: String configurationActionClass) {
0466: _configurationActionClass = configurationActionClass;
0467: }
0468:
0469: /**
0470: * Gets the configuration action instance of the portlet.
0471: *
0472: * @return the configuration action instance of the portlet
0473: */
0474: public ConfigurationAction getConfigurationActionInstance() {
0475: if (Validator.isNotNull(getConfigurationActionClass())) {
0476: if (isWARFile()) {
0477: PortletContextWrapper pcw = PortletContextPool
0478: .get(getRootPortletId());
0479:
0480: return pcw.getConfigurationActionInstance();
0481: } else {
0482: return (ConfigurationAction) InstancePool
0483: .get(getConfigurationActionClass());
0484: }
0485: }
0486:
0487: return null;
0488: }
0489:
0490: /**
0491: * Gets the name of the indexer class of the portlet.
0492: *
0493: * @return the name of the indexer class of the portlet
0494: */
0495: public String getIndexerClass() {
0496: return _indexerClass;
0497: }
0498:
0499: /**
0500: * Sets the name of the indexer class of the portlet.
0501: *
0502: * @param indexerClass the name of the indexer class of the portlet
0503: */
0504: public void setIndexerClass(String indexerClass) {
0505: _indexerClass = indexerClass;
0506: }
0507:
0508: /**
0509: * Gets the name of the open search class of the portlet.
0510: *
0511: * @return the name of the open search class of the portlet
0512: */
0513: public String getOpenSearchClass() {
0514: return _openSearchClass;
0515: }
0516:
0517: /**
0518: * Sets the name of the open search class of the portlet.
0519: *
0520: * @param openSearchClass the name of the open search class of the
0521: * portlet
0522: */
0523: public void setOpenSearchClass(String openSearchClass) {
0524: _openSearchClass = openSearchClass;
0525: }
0526:
0527: /**
0528: * Gets the name of the scheduler class of the portlet.
0529: *
0530: * @return the name of the scheduler class of the portlet
0531: */
0532: public String getSchedulerClass() {
0533: return _schedulerClass;
0534: }
0535:
0536: /**
0537: * Sets the name of the scheduler class of the portlet.
0538: *
0539: * @param schedulerClass the name of the scheduler class of the
0540: * portlet
0541: */
0542: public void setSchedulerClass(String schedulerClass) {
0543: _schedulerClass = schedulerClass;
0544: }
0545:
0546: /**
0547: * Gets the name of the portlet URL class of the portlet.
0548: *
0549: * @return the name of the portlet URL class of the portlet
0550: */
0551: public String getPortletURLClass() {
0552: return _portletURLClass;
0553: }
0554:
0555: /**
0556: * Sets the name of the portlet URL class of the portlet.
0557: *
0558: * @param portletURLClass the name of the portlet URL class of the
0559: * portlet
0560: */
0561: public void setPortletURLClass(String portletURLClass) {
0562: _portletURLClass = portletURLClass;
0563: }
0564:
0565: /**
0566: * Gets the name of the friendly URL mapper class of the portlet.
0567: *
0568: * @return the name of the friendly URL mapper class of the portlet
0569: */
0570: public String getFriendlyURLMapperClass() {
0571: return _friendlyURLMapperClass;
0572: }
0573:
0574: /**
0575: * Sets the name of the friendly URL mapper class of the portlet.
0576: *
0577: * @param friendlyURLMapperClass the name of the friendly URL plugin
0578: * class of the portlet
0579: */
0580: public void setFriendlyURLMapperClass(String friendlyURLMapperClass) {
0581: _friendlyURLMapperClass = friendlyURLMapperClass;
0582: }
0583:
0584: /**
0585: * Gets the friendly URL mapper instance of the portlet.
0586: *
0587: * @return the friendly URL mapper instance of the portlet
0588: */
0589: public FriendlyURLMapper getFriendlyURLMapperInstance() {
0590: if (Validator.isNotNull(getFriendlyURLMapperClass())) {
0591: if (isWARFile()) {
0592: PortletContextWrapper pcw = PortletContextPool
0593: .get(getRootPortletId());
0594:
0595: return pcw.getFriendlyURLMapperInstance();
0596: } else {
0597: return (FriendlyURLMapper) InstancePool
0598: .get(getFriendlyURLMapperClass());
0599: }
0600: }
0601:
0602: return null;
0603: }
0604:
0605: /**
0606: * Gets the name of the URL encoder class of the portlet.
0607: *
0608: * @return the name of the URL encoder class of the portlet
0609: */
0610: public String getURLEncoderClass() {
0611: return _urlEncoderClass;
0612: }
0613:
0614: /**
0615: * Sets the name of the URL encoder class of the portlet.
0616: *
0617: * @param urlEncoderClass the name of the URL encoder class of the
0618: * portlet
0619: */
0620: public void setURLEncoderClass(String urlEncoderClass) {
0621: _urlEncoderClass = urlEncoderClass;
0622: }
0623:
0624: /**
0625: * Gets the URL encoder instance of the portlet.
0626: *
0627: * @return the URL encoder instance of the portlet
0628: */
0629: public URLEncoder getURLEncoderInstance() {
0630: if (Validator.isNotNull(getURLEncoderClass())) {
0631: if (isWARFile()) {
0632: PortletContextWrapper pcw = PortletContextPool
0633: .get(getRootPortletId());
0634:
0635: return pcw.getURLEncoderInstance();
0636: } else {
0637: return (URLEncoder) InstancePool
0638: .get(getURLEncoderClass());
0639: }
0640: }
0641:
0642: return null;
0643: }
0644:
0645: /**
0646: * Gets the name of the portlet data handler class of the portlet.
0647: *
0648: * @return the name of the portlet data handler class of the portlet
0649: */
0650: public String getPortletDataHandlerClass() {
0651: return _portletDataHandlerClass;
0652: }
0653:
0654: /**
0655: * Sets the name of the portlet data handler class of the portlet.
0656: *
0657: * @param portletDataHandlerClass the name of portlet data handler
0658: * class of the portlet
0659: */
0660: public void setPortletDataHandlerClass(
0661: String portletDataHandlerClass) {
0662: _portletDataHandlerClass = portletDataHandlerClass;
0663: }
0664:
0665: /**
0666: * Gets the portlet data handler instance of the portlet.
0667: *
0668: * @return the portlet data handler instance of the portlet
0669: */
0670: public PortletDataHandler getPortletDataHandlerInstance() {
0671: if (Validator.isNotNull(getPortletDataHandlerClass())) {
0672: if (isWARFile()) {
0673: PortletContextWrapper pcw = PortletContextPool
0674: .get(getRootPortletId());
0675:
0676: return pcw.getPortletDataHandlerInstance();
0677: } else {
0678: return (PortletDataHandler) InstancePool
0679: .get(getPortletDataHandlerClass());
0680: }
0681: }
0682:
0683: return null;
0684: }
0685:
0686: /**
0687: * Gets the portlet layout listener of the portlet.
0688: *
0689: * @return the name of the portlet layout listener class of the portlet
0690: */
0691: public PortletLayoutListener getPortletLayoutListener() {
0692: if (Validator.isNull(getPortletLayoutListenerClass())) {
0693: return null;
0694: }
0695:
0696: return (PortletLayoutListener) InstancePool
0697: .get(getPortletLayoutListenerClass());
0698: }
0699:
0700: /**
0701: * Gets the name of the portlet layout listener class of the portlet.
0702: *
0703: * @return the name of the portlet layout listener class of the portlet
0704: */
0705: public String getPortletLayoutListenerClass() {
0706: return _portletLayoutListenerClass;
0707: }
0708:
0709: /**
0710: * Sets the name of the portlet layout listener class of the portlet.
0711: *
0712: * @param portletLayoutListenerClass the name of the portlet layout
0713: * listener class of the portlet
0714: */
0715: public void setPortletLayoutListenerClass(
0716: String portletLayoutListenerClass) {
0717:
0718: _portletLayoutListenerClass = portletLayoutListenerClass;
0719: }
0720:
0721: /**
0722: * Gets the name of the activity tracker interpreter class of the portlet.
0723: *
0724: * @return the name of the activity tracker interpreter class of the
0725: * portlet
0726: */
0727: public String getActivityTrackerInterpreterClass() {
0728: return _activityTrackerInterpreterClass;
0729: }
0730:
0731: /**
0732: * Sets the name of the activity tracker interpreter class of the portlet.
0733: *
0734: * @param activityTrackerInterpreterClass the name of the activity
0735: * tracker interpreter class of the portlet
0736: */
0737: public void setActivityTrackerInterpreterClass(
0738: String activityTrackerInterpreterClass) {
0739:
0740: _activityTrackerInterpreterClass = activityTrackerInterpreterClass;
0741: }
0742:
0743: /**
0744: * Gets the name of the activity tracker interpreter instance of the
0745: * portlet.
0746: *
0747: * @return the name of the activity tracker interpreter instance of the
0748: * portlet
0749: */
0750: public ActivityTrackerInterpreter getActivityTrackerInterpreterInstance() {
0751: if (Validator.isNotNull(getActivityTrackerInterpreterClass())) {
0752: if (isWARFile()) {
0753: PortletContextWrapper pcw = PortletContextPool
0754: .get(getRootPortletId());
0755:
0756: return pcw.getActivityTrackerInterpreterInstance();
0757: } else {
0758: return (ActivityTrackerInterpreter) InstancePool
0759: .get(getActivityTrackerInterpreterClass());
0760: }
0761: }
0762:
0763: return null;
0764: }
0765:
0766: /**
0767: * Gets the name of the POP message listener class of the portlet.
0768: *
0769: * @return the name of the POP message listener class of the portlet
0770: */
0771: public String getPopMessageListenerClass() {
0772: return _popMessageListenerClass;
0773: }
0774:
0775: /**
0776: * Sets the name of the POP message listener class of the portlet.
0777: *
0778: * @param popMessageListenerClass the name of the POP message listener
0779: * class of the portlet
0780: */
0781: public void setPopMessageListenerClass(
0782: String popMessageListenerClass) {
0783: _popMessageListenerClass = popMessageListenerClass;
0784: }
0785:
0786: /**
0787: * Gets the POP message listener instance of the portlet.
0788: *
0789: * @return the POP message listener instance of the portlet
0790: */
0791: public MessageListener getPopMessageListenerInstance() {
0792: if (Validator.isNotNull(getPopMessageListenerClass())) {
0793: if (isWARFile()) {
0794: PortletContextWrapper pcw = PortletContextPool
0795: .get(getRootPortletId());
0796:
0797: return pcw.getPopMessageListenerInstance();
0798: } else {
0799: return (MessageListener) InstancePool
0800: .get(getPopMessageListenerClass());
0801: }
0802: }
0803:
0804: return null;
0805: }
0806:
0807: /**
0808: * Gets the default preferences of the portlet.
0809: *
0810: * @return the default preferences of the portlet
0811: */
0812: public String getDefaultPreferences() {
0813: if (Validator.isNull(_defaultPreferences)) {
0814: return DEFAULT_PREFERENCES;
0815: } else {
0816: return _defaultPreferences;
0817: }
0818: }
0819:
0820: /**
0821: * Sets the default preferences of the portlet.
0822: *
0823: * @param defaultPreferences the default preferences of the portlet
0824: */
0825: public void setDefaultPreferences(String defaultPreferences) {
0826: _defaultPreferences = defaultPreferences;
0827: }
0828:
0829: /**
0830: * Gets the name of the preferences validator class of the portlet.
0831: *
0832: * @return the name of the preferences validator class of the portlet
0833: */
0834: public String getPreferencesValidator() {
0835: return _prefsValidator;
0836: }
0837:
0838: /**
0839: * Sets the name of the preferences validator class of the portlet.
0840: *
0841: * @param prefsValidator the name of the preferences validator class
0842: * of the portlet
0843: */
0844: public void setPreferencesValidator(String prefsValidator) {
0845: if (prefsValidator != null) {
0846:
0847: // Trim this because XDoclet generates preferences validators with
0848: // extra white spaces
0849:
0850: _prefsValidator = prefsValidator.trim();
0851: } else {
0852: _prefsValidator = null;
0853: }
0854: }
0855:
0856: /**
0857: * Returns true if preferences are shared across the entire company.
0858: *
0859: * @return true if preferences are shared across the entire company
0860: */
0861: public boolean getPreferencesCompanyWide() {
0862: return _prefsCompanyWide;
0863: }
0864:
0865: /**
0866: * Returns true if preferences are shared across the entire company.
0867: *
0868: * @return true if preferences are shared across the entire company
0869: */
0870: public boolean isPreferencesCompanyWide() {
0871: return _prefsCompanyWide;
0872: }
0873:
0874: /**
0875: * Sets to true if preferences are shared across the entire company.
0876: *
0877: * @param prefsCompanyWide boolean value for whether preferences
0878: * are shared across the entire company
0879: */
0880: public void setPreferencesCompanyWide(boolean prefsCompanyWide) {
0881: _prefsCompanyWide = prefsCompanyWide;
0882: }
0883:
0884: /**
0885: * Returns true if preferences are unique per layout.
0886: *
0887: * @return true if preferences are unique per layout
0888: */
0889: public boolean getPreferencesUniquePerLayout() {
0890: return _prefsUniquePerLayout;
0891: }
0892:
0893: /**
0894: * Returns true if preferences are unique per layout.
0895: *
0896: * @return true if preferences are unique per layout
0897: */
0898: public boolean isPreferencesUniquePerLayout() {
0899: return _prefsUniquePerLayout;
0900: }
0901:
0902: /**
0903: * Sets to true if preferences are unique per layout.
0904: *
0905: * @param prefsUniquePerLayout boolean value for whether preferences
0906: * are unique per layout
0907: */
0908: public void setPreferencesUniquePerLayout(
0909: boolean prefsUniquePerLayout) {
0910: _prefsUniquePerLayout = prefsUniquePerLayout;
0911: }
0912:
0913: /**
0914: * Returns true if preferences are owned by the group when the portlet is
0915: * shown in a group layout. Returns false if preferences are owned by the
0916: * user at all times.
0917: *
0918: * @return true if preferences are owned by the group when the portlet
0919: * is shown in a group layout; false if preferences are owned
0920: * by the user at all times.
0921: */
0922: public boolean getPreferencesOwnedByGroup() {
0923: return _prefsOwnedByGroup;
0924: }
0925:
0926: /**
0927: * Returns true if preferences are owned by the group when the portlet is
0928: * shown in a group layout. Returns false if preferences are owned by the
0929: * user at all times.
0930: *
0931: * @return true if preferences are owned by the group when the portlet
0932: * is shown in a group layout; false if preferences are owned
0933: * by the user at all times.
0934: */
0935: public boolean isPreferencesOwnedByGroup() {
0936: return _prefsOwnedByGroup;
0937: }
0938:
0939: /**
0940: * Sets to true if preferences are owned by the group when the portlet is
0941: * shown in a group layout. Sets to false if preferences are owned by the
0942: * user at all times.
0943: *
0944: * @param prefsOwnedByGroup boolean value for whether preferences are
0945: * owned by the group when the portlet is shown in a group
0946: * layout or preferences are owned by the user at all times
0947: */
0948: public void setPreferencesOwnedByGroup(boolean prefsOwnedByGroup) {
0949: _prefsOwnedByGroup = prefsOwnedByGroup;
0950: }
0951:
0952: /**
0953: * Returns true if the portlet uses the default template.
0954: *
0955: * @return true if the portlet uses the default template
0956: */
0957: public boolean getUseDefaultTemplate() {
0958: return _useDefaultTemplate;
0959: }
0960:
0961: /**
0962: * Returns true if the portlet uses the default template.
0963: *
0964: * @return true if the portlet uses the default template
0965: */
0966: public boolean isUseDefaultTemplate() {
0967: return _useDefaultTemplate;
0968: }
0969:
0970: /**
0971: * Sets to true if the portlet uses the default template.
0972: *
0973: * @param useDefaultTemplate boolean value for whether the portlet
0974: * uses the default template
0975: */
0976: public void setUseDefaultTemplate(boolean useDefaultTemplate) {
0977: _useDefaultTemplate = useDefaultTemplate;
0978: }
0979:
0980: /**
0981: * Returns true if users are shown that they do not have access to the
0982: * portlet.
0983: *
0984: * @return true if users are shown that they do not have access to the
0985: * portlet
0986: */
0987: public boolean getShowPortletAccessDenied() {
0988: return _showPortletAccessDenied;
0989: }
0990:
0991: /**
0992: * Returns true if users are shown that they do not have access to the
0993: * portlet.
0994: *
0995: * @return true if users are shown that they do not have access to the
0996: * portlet
0997: */
0998: public boolean isShowPortletAccessDenied() {
0999: return _showPortletAccessDenied;
1000: }
1001:
1002: /**
1003: * Sets to true if users are shown that they do not have access to the
1004: * portlet.
1005: *
1006: * @param showPortletAccessDenied boolean value for whether users are
1007: * shown that they do not have access to the portlet
1008: */
1009: public void setShowPortletAccessDenied(
1010: boolean showPortletAccessDenied) {
1011: _showPortletAccessDenied = showPortletAccessDenied;
1012: }
1013:
1014: /**
1015: * Returns true if users are shown that the portlet is inactive.
1016: *
1017: * @return true if users are shown that the portlet is inactive
1018: */
1019: public boolean getShowPortletInactive() {
1020: return _showPortletInactive;
1021: }
1022:
1023: /**
1024: * Returns true if users are shown that the portlet is inactive.
1025: *
1026: * @return true if users are shown that the portlet is inactive
1027: */
1028: public boolean isShowPortletInactive() {
1029: return _showPortletInactive;
1030: }
1031:
1032: /**
1033: * Sets to true if users are shown that the portlet is inactive.
1034: *
1035: * @param showPortletInactive boolean value for whether users are
1036: * shown that the portlet is inactive
1037: */
1038: public void setShowPortletInactive(boolean showPortletInactive) {
1039: _showPortletInactive = showPortletInactive;
1040: }
1041:
1042: /**
1043: * Returns true if an action URL for this portlet should cause an auto
1044: * redirect.
1045: *
1046: * @return true if an action URL for this portlet should cause an auto
1047: * redirect
1048: */
1049: public boolean getActionURLRedirect() {
1050: return _actionURLRedirect;
1051: }
1052:
1053: /**
1054: * Returns true if an action URL for this portlet should cause an auto
1055: * redirect.
1056: *
1057: * @return true if an action URL for this portlet should cause an auto
1058: * redirect
1059: */
1060: public boolean isActionURLRedirect() {
1061: return _actionURLRedirect;
1062: }
1063:
1064: /**
1065: * Sets to true if an action URL for this portlet should cause an auto
1066: * redirect.
1067: *
1068: * @param actionURLRedirect boolean value for whether an action URL
1069: * for this portlet should cause an auto redirect
1070: */
1071: public void setActionURLRedirect(boolean actionURLRedirect) {
1072: _actionURLRedirect = actionURLRedirect;
1073: }
1074:
1075: /**
1076: * Returns true if the portlet restores to the current view from the
1077: * maximized state.
1078: *
1079: * @return true if the portlet restores to the current view from the
1080: * maximized state
1081: */
1082: public boolean getRestoreCurrentView() {
1083: return _restoreCurrentView;
1084: }
1085:
1086: /**
1087: * Returns true if the portlet restores to the current view from the
1088: * maximized state.
1089: *
1090: * @return true if the portlet restores to the current view from the
1091: * maximized state
1092: */
1093: public boolean isRestoreCurrentView() {
1094: return _restoreCurrentView;
1095: }
1096:
1097: /**
1098: * Sets to true if the portlet restores to the current view from the
1099: * maximized state.
1100: *
1101: * @param restoreCurrentView boolean value for whether the portlet
1102: * restores to the current view from the maximized state
1103: */
1104: public void setRestoreCurrentView(boolean restoreCurrentView) {
1105: _restoreCurrentView = restoreCurrentView;
1106: }
1107:
1108: /**
1109: * Returns true if the portlet goes into the maximized state when the user
1110: * goes into the edit mode.
1111: *
1112: * @return true if the portlet goes into the maximized state when the
1113: * user goes into the edit mode
1114: */
1115: public boolean getMaximizeEdit() {
1116: return _maximizeEdit;
1117: }
1118:
1119: /**
1120: * Returns true if the portlet goes into the maximized state when the user
1121: * goes into the edit mode.
1122: *
1123: * @return true if the portlet goes into the maximized state when the
1124: * user goes into the edit mode
1125: */
1126: public boolean isMaximizeEdit() {
1127: return _maximizeEdit;
1128: }
1129:
1130: /**
1131: * Sets to true if the portlet goes into the maximized state when the user
1132: * goes into the edit mode.
1133: *
1134: * @param maximizeEdit boolean value for whether the portlet goes into
1135: * the maximized state when the user goes into the edit mode
1136: */
1137: public void setMaximizeEdit(boolean maximizeEdit) {
1138: _maximizeEdit = maximizeEdit;
1139: }
1140:
1141: /**
1142: * Returns true if the portlet goes into the maximized state when the user
1143: * goes into the help mode.
1144: *
1145: * @return true if the portlet goes into the maximized state when the
1146: * user goes into the help mode
1147: */
1148: public boolean getMaximizeHelp() {
1149: return _maximizeHelp;
1150: }
1151:
1152: /**
1153: * Returns true if the portlet goes into the maximized state when the user
1154: * goes into the help mode.
1155: *
1156: * @return true if the portlet goes into the maximized state when the
1157: * user goes into the help mode
1158: */
1159: public boolean isMaximizeHelp() {
1160: return _maximizeHelp;
1161: }
1162:
1163: /**
1164: * Sets to true if the portlet goes into the maximized state when the user
1165: * goes into the help mode.
1166: *
1167: * @param maximizeHelp boolean value for whether the portlet goes into
1168: * the maximized state when the user goes into the help mode
1169: */
1170: public void setMaximizeHelp(boolean maximizeHelp) {
1171: _maximizeHelp = maximizeHelp;
1172: }
1173:
1174: /**
1175: * Returns true if the portlet goes into the pop up state when the user goes
1176: * into the print mode.
1177: *
1178: * @return true if the portlet goes into the pop up state when the user
1179: * goes into the print mode
1180: */
1181: public boolean getPopUpPrint() {
1182: return _popUpPrint;
1183: }
1184:
1185: /**
1186: * Returns true if the portlet goes into the pop up state when the user goes
1187: * into the print mode.
1188: *
1189: * @return true if the portlet goes into the pop up state when the user
1190: * goes into the print mode
1191: */
1192: public boolean isPopUpPrint() {
1193: return _popUpPrint;
1194: }
1195:
1196: /**
1197: * Sets to true if the portlet goes into the pop up state when the user goes
1198: * into the print mode.
1199: *
1200: * @param popUpPrint boolean value for whether the portlet goes into
1201: * the pop up state when the user goes into the print mode
1202: */
1203: public void setPopUpPrint(boolean popUpPrint) {
1204: _popUpPrint = popUpPrint;
1205: }
1206:
1207: /**
1208: * Returns true to allow the portlet to be cached within the layout.
1209: *
1210: * @return true if the portlet can be cached within the layout
1211: */
1212: public boolean getLayoutCacheable() {
1213: return _layoutCacheable;
1214: }
1215:
1216: /**
1217: * Returns true to allow the portlet to be cached within the layout.
1218: *
1219: * @return true if the portlet can be cached within the layout
1220: */
1221: public boolean isLayoutCacheable() {
1222: return _layoutCacheable;
1223: }
1224:
1225: /**
1226: * Sets to true to allow the portlet to be cached within the layout.
1227: *
1228: * @param layoutCacheable boolean value for whether the portlet can be
1229: * cached within the layout
1230: */
1231: public void setLayoutCacheable(boolean layoutCacheable) {
1232: _layoutCacheable = layoutCacheable;
1233: }
1234:
1235: /**
1236: * Returns true if the portlet can be added multiple times to a layout.
1237: *
1238: * @return true if the portlet can be added multiple times to a layout
1239: */
1240: public boolean getInstanceable() {
1241: return _instanceable;
1242: }
1243:
1244: /**
1245: * Returns true if the portlet can be added multiple times to a layout.
1246: *
1247: * @return true if the portlet can be added multiple times to a layout
1248: */
1249: public boolean isInstanceable() {
1250: return _instanceable;
1251: }
1252:
1253: /**
1254: * Sets to true if the portlet can be added multiple times to a layout.
1255: *
1256: * @param instanceable boolean value for whether the portlet can be
1257: * added multiple times to a layout
1258: */
1259: public void setInstanceable(boolean instanceable) {
1260: _instanceable = instanceable;
1261: }
1262:
1263: /**
1264: * Gets the user principal strategy of the portlet.
1265: *
1266: * @return the user principal strategy of the portlet
1267: */
1268: public String getUserPrincipalStrategy() {
1269: return _userPrincipalStrategy;
1270: }
1271:
1272: /**
1273: * Sets the user principal strategy of the portlet.
1274: *
1275: * @param userPrincipalStrategy the user principal strategy of the
1276: * portlet
1277: */
1278: public void setUserPrincipalStrategy(String userPrincipalStrategy) {
1279: if (Validator.isNotNull(userPrincipalStrategy)) {
1280: _userPrincipalStrategy = userPrincipalStrategy;
1281: }
1282: }
1283:
1284: /**
1285: * Returns true if the portlet does not share request attributes with the
1286: * portal or portlets from another WAR.
1287: *
1288: * @return true if the portlet does not share request attributes with
1289: * the portal or portlets from another WAR
1290: */
1291: public boolean getPrivateRequestAttributes() {
1292: return _privateRequestAttributes;
1293: }
1294:
1295: /**
1296: * Returns true if the portlet does not share request attributes with the
1297: * portal or portlets from another WAR.
1298: *
1299: * @return true if the portlet does not share request attributes with
1300: * the portal or portlets from another WAR
1301: */
1302: public boolean isPrivateRequestAttributes() {
1303: return _privateRequestAttributes;
1304: }
1305:
1306: /**
1307: * Sets to true if the portlet does not share request attributes with the
1308: * portal or portlets from another WAR.
1309: *
1310: * @param privateRequestAttributes boolean value for whether the
1311: * portlet shares request attributes with the portal or
1312: * portlets from another WAR
1313: */
1314: public void setPrivateRequestAttributes(
1315: boolean privateRequestAttributes) {
1316: _privateRequestAttributes = privateRequestAttributes;
1317: }
1318:
1319: /**
1320: * Returns true if the portlet does not share session attributes with the
1321: * portal.
1322: *
1323: * @return true if the portlet does not share session attributes with
1324: * the portal
1325: */
1326: public boolean getPrivateSessionAttributes() {
1327: return _privateSessionAttributes;
1328: }
1329:
1330: /**
1331: * Returns true if the portlet does not share session attributes with the
1332: * portal.
1333: *
1334: * @return true if the portlet does not share session attributes with
1335: * the portal
1336: */
1337: public boolean isPrivateSessionAttributes() {
1338: return _privateSessionAttributes;
1339: }
1340:
1341: /**
1342: * Sets to true if the portlet does not share session attributes with the
1343: * portal.
1344: *
1345: * @param privateSessionAttributes boolean value for whether the
1346: * portlet shares session attributes with the portal
1347: */
1348: public void setPrivateSessionAttributes(
1349: boolean privateSessionAttributes) {
1350: _privateSessionAttributes = privateSessionAttributes;
1351: }
1352:
1353: /**
1354: * Returns the render weight of the portlet.
1355: *
1356: * @return the render weight of the portlet
1357: */
1358: public int getRenderWeight() {
1359: return _renderWeight;
1360: }
1361:
1362: /**
1363: * Sets the render weight of the portlet.
1364: *
1365: * @param renderWeight int value for the render weight of the portlet
1366: */
1367: public void setRenderWeight(int renderWeight) {
1368: _renderWeight = renderWeight;
1369: }
1370:
1371: /**
1372: * Returns true if the portlet can be displayed via Ajax.
1373: *
1374: * @return true if the portlet can be displayed via Ajax
1375: */
1376: public boolean getAjaxable() {
1377: return _ajaxable;
1378: }
1379:
1380: /**
1381: * Returns true if the portlet can be displayed via Ajax.
1382: *
1383: * @return true if the portlet can be displayed via Ajax
1384: */
1385: public boolean isAjaxable() {
1386: return _ajaxable;
1387: }
1388:
1389: /**
1390: * Sets to true if the portlet can be displayed via Ajax.
1391: *
1392: * @param ajaxable boolean value for whether the portlet can be
1393: * displayed via Ajax
1394: */
1395: public void setAjaxable(boolean ajaxable) {
1396: _ajaxable = ajaxable;
1397: }
1398:
1399: /**
1400: * Gets a list of CSS files that will be referenced from the page's header
1401: * relative to the portal's context path.
1402: *
1403: * @return a list of CSS files that will be referenced from the page's
1404: * header relative to the portal's context path
1405: */
1406: public List getHeaderPortalCss() {
1407: return _headerPortalCss;
1408: }
1409:
1410: /**
1411: * Sets a list of CSS files that will be referenced from the page's header
1412: * relative to the portal's context path.
1413: *
1414: * @param headerPortalCss a list of CSS files that will be referenced
1415: * from the page's header relative to the portal's context path
1416: */
1417: public void setHeaderPortalCss(List headerPortalCss) {
1418: _headerPortalCss = headerPortalCss;
1419: }
1420:
1421: /**
1422: * Gets a list of CSS files that will be referenced from the page's header
1423: * relative to the portlet's context path.
1424: *
1425: * @return a list of CSS files that will be referenced from the page's
1426: * header relative to the portlet's context path
1427: */
1428: public List getHeaderPortletCss() {
1429: return _headerPortletCss;
1430: }
1431:
1432: /**
1433: * Sets a list of CSS files that will be referenced from the page's header
1434: * relative to the portlet's context path.
1435: *
1436: * @param headerPortletCss a list of CSS files that will be referenced
1437: * from the page's header relative to the portlet's context
1438: * path
1439: */
1440: public void setHeaderPortletCss(List headerPortletCss) {
1441: _headerPortletCss = headerPortletCss;
1442: }
1443:
1444: /**
1445: * Gets a list of JavaScript files that will be referenced from the page's
1446: * header relative to the portal's context path.
1447: *
1448: * @return a list of JavaScript files that will be referenced from the
1449: * page's header relative to the portal's context path
1450: */
1451: public List getHeaderPortalJavaScript() {
1452: return _headerPortalJavaScript;
1453: }
1454:
1455: /**
1456: * Sets a list of JavaScript files that will be referenced from the page's
1457: * header relative to the portal's context path.
1458: *
1459: * @param headerPortalJavaScript a list of JavaScript files that will
1460: * be referenced from the page's header relative to the
1461: * portal's context path
1462: */
1463: public void setHeaderPortalJavaScript(List headerPortalJavaScript) {
1464: _headerPortalJavaScript = headerPortalJavaScript;
1465: }
1466:
1467: /**
1468: * Gets a list of JavaScript files that will be referenced from the page's
1469: * header relative to the portlet's context path.
1470: *
1471: * @return a list of JavaScript files that will be referenced from the
1472: * page's header relative to the portlet's context path
1473: */
1474: public List getHeaderPortletJavaScript() {
1475: return _headerPortletJavaScript;
1476: }
1477:
1478: /**
1479: * Sets a list of JavaScript files that will be referenced from the page's
1480: * header relative to the portlet's context path.
1481: *
1482: * @param headerPortletJavaScript a list of JavaScript files that will
1483: * be referenced from the page's header relative to the
1484: * portlet's context path
1485: */
1486: public void setHeaderPortletJavaScript(List headerPortletJavaScript) {
1487: _headerPortletJavaScript = headerPortletJavaScript;
1488: }
1489:
1490: /**
1491: * Gets a list of CSS files that will be referenced from the page's footer
1492: * relative to the portal's context path.
1493: *
1494: * @return a list of CSS files that will be referenced from the page's
1495: * footer relative to the portal's context path
1496: */
1497: public List getFooterPortalCss() {
1498: return _footerPortalCss;
1499: }
1500:
1501: /**
1502: * Sets a list of CSS files that will be referenced from the page's footer
1503: * relative to the portal's context path.
1504: *
1505: * @param footerPortalCss a list of CSS files that will be referenced
1506: * from the page's footer relative to the portal's context path
1507: */
1508: public void setFooterPortalCss(List footerPortalCss) {
1509: _footerPortalCss = footerPortalCss;
1510: }
1511:
1512: /**
1513: * Gets a list of CSS files that will be referenced from the page's footer
1514: * relative to the portlet's context path.
1515: *
1516: * @return a list of CSS files that will be referenced from the page's
1517: * footer relative to the portlet's context path
1518: */
1519: public List getFooterPortletCss() {
1520: return _footerPortletCss;
1521: }
1522:
1523: /**
1524: * Sets a list of CSS files that will be referenced from the page's footer
1525: * relative to the portlet's context path.
1526: *
1527: * @param footerPortletCss a list of CSS files that will be referenced
1528: * from the page's footer relative to the portlet's context
1529: * path
1530: */
1531: public void setFooterPortletCss(List footerPortletCss) {
1532: _footerPortletCss = footerPortletCss;
1533: }
1534:
1535: /**
1536: * Gets a list of JavaScript files that will be referenced from the page's
1537: * footer relative to the portal's context path.
1538: *
1539: * @return a list of JavaScript files that will be referenced from the
1540: * page's footer relative to the portal's context path
1541: */
1542: public List getFooterPortalJavaScript() {
1543: return _footerPortalJavaScript;
1544: }
1545:
1546: /**
1547: * Sets a list of JavaScript files that will be referenced from the page's
1548: * footer relative to the portal's context path.
1549: *
1550: * @param footerPortalJavaScript a list of JavaScript files that will
1551: * be referenced from the page's footer relative to the
1552: * portal's context path
1553: */
1554: public void setFooterPortalJavaScript(List footerPortalJavaScript) {
1555: _footerPortalJavaScript = footerPortalJavaScript;
1556: }
1557:
1558: /**
1559: * Gets a list of JavaScript files that will be referenced from the page's
1560: * footer relative to the portlet's context path.
1561: *
1562: * @return a list of JavaScript files that will be referenced from the
1563: * page's footer relative to the portlet's context path
1564: */
1565: public List getFooterPortletJavaScript() {
1566: return _footerPortletJavaScript;
1567: }
1568:
1569: /**
1570: * Sets a list of JavaScript files that will be referenced from the page's
1571: * footer relative to the portlet's context path.
1572: *
1573: * @param footerPortletJavaScript a list of JavaScript files that will
1574: * be referenced from the page's footer relative to the
1575: * portlet's context path
1576: */
1577: public void setFooterPortletJavaScript(List footerPortletJavaScript) {
1578: _footerPortletJavaScript = footerPortletJavaScript;
1579: }
1580:
1581: /**
1582: * Gets the name of the CSS class that will be injected in the DIV that
1583: * wraps this portlet.
1584: *
1585: * @return the name of the CSS class that will be injected in the DIV
1586: * that wraps this portlet
1587: */
1588: public String getCssClassWrapper() {
1589: return _cssClassWrapper;
1590: }
1591:
1592: /**
1593: * Sets the name of the CSS class that will be injected in the DIV that
1594: * wraps this portlet.
1595: *
1596: * @param cssClassWrapper the name of the CSS class that will be
1597: * injected in the DIV that wraps this portlet
1598: */
1599: public void setCssClassWrapper(String cssClassWrapper) {
1600: _cssClassWrapper = cssClassWrapper;
1601: }
1602:
1603: /**
1604: * Returns true if default resources for the portlet are added to a page.
1605: *
1606: * @return true if default resources for the portlet are added to a
1607: * page
1608: */
1609: public boolean getAddDefaultResource() {
1610: return _addDefaultResource;
1611: }
1612:
1613: /**
1614: * Returns true if default resources for the portlet are added to a page.
1615: *
1616: * @return true if default resources for the portlet are added to a
1617: * page
1618: */
1619: public boolean isAddDefaultResource() {
1620: return _addDefaultResource;
1621: }
1622:
1623: /**
1624: * Sets to true if default resources for the portlet are added to a page.
1625: *
1626: * @param addDefaultResource boolean value for whether or not default
1627: * resources for the portlet are added to a page
1628: */
1629: public void setAddDefaultResource(boolean addDefaultResource) {
1630: _addDefaultResource = addDefaultResource;
1631: }
1632:
1633: /**
1634: * Sets a string of ordered comma delimited portlet ids.
1635: *
1636: * @param roles a string of ordered comma delimited portlet ids
1637: */
1638: public void setRoles(String roles) {
1639: _rolesArray = StringUtil.split(roles);
1640:
1641: super .setRoles(roles);
1642: }
1643:
1644: /**
1645: * Gets an array of required roles of the portlet.
1646: *
1647: * @return an array of required roles of the portlet
1648: */
1649: public String[] getRolesArray() {
1650: return _rolesArray;
1651: }
1652:
1653: /**
1654: * Sets an array of required roles of the portlet.
1655: *
1656: * @param rolesArray an array of required roles of the portlet
1657: */
1658: public void setRolesArray(String[] rolesArray) {
1659: _rolesArray = rolesArray;
1660:
1661: super .setRoles(StringUtil.merge(rolesArray));
1662: }
1663:
1664: /**
1665: * Gets the unlinked roles of the portlet.
1666: *
1667: * @return unlinked roles of the portlet
1668: */
1669: public Set getUnlinkedRoles() {
1670: return _unlinkedRoles;
1671: }
1672:
1673: /**
1674: * Sets the unlinked roles of the portlet.
1675: *
1676: * @param unlinkedRoles the unlinked roles of the portlet
1677: */
1678: public void setUnlinkedRoles(Set unlinkedRoles) {
1679: _unlinkedRoles = unlinkedRoles;
1680: }
1681:
1682: /**
1683: * Gets the role mappers of the portlet.
1684: *
1685: * @return role mappers of the portlet
1686: */
1687: public Map getRoleMappers() {
1688: return _roleMappers;
1689: }
1690:
1691: /**
1692: * Sets the role mappers of the portlet.
1693: *
1694: * @param roleMappers the role mappers of the portlet
1695: */
1696: public void setRoleMappers(Map roleMappers) {
1697: _roleMappers = roleMappers;
1698: }
1699:
1700: /**
1701: * Link the role names set in portlet.xml with the Liferay roles set in
1702: * liferay-portlet.xml.
1703: */
1704: public void linkRoles() {
1705: List linkedRoles = new ArrayList();
1706:
1707: Iterator itr = _unlinkedRoles.iterator();
1708:
1709: while (itr.hasNext()) {
1710: String unlinkedRole = (String) itr.next();
1711:
1712: String roleLink = (String) _roleMappers.get(unlinkedRole);
1713:
1714: if (Validator.isNotNull(roleLink)) {
1715: if (_log.isDebugEnabled()) {
1716: _log.debug("Linking role for portlet ["
1717: + getPortletId() + "] with role-name ["
1718: + unlinkedRole + "] to role-link ["
1719: + roleLink + "]");
1720: }
1721:
1722: linkedRoles.add(roleLink);
1723: } else {
1724: _log.error("Unable to link role for portlet ["
1725: + getPortletId() + "] with role-name ["
1726: + unlinkedRole + "] because role-link is null");
1727: }
1728: }
1729:
1730: Collections.sort(linkedRoles);
1731:
1732: setRolesArray((String[]) linkedRoles.toArray(new String[0]));
1733: }
1734:
1735: /**
1736: * Returns true if the portlet has a role with the specified name.
1737: *
1738: * @return true if the portlet has a role with the specified name
1739: */
1740: public boolean hasRoleWithName(String roleName) {
1741: for (int i = 0; i < _rolesArray.length; i++) {
1742: if (_rolesArray[i].equalsIgnoreCase(roleName)) {
1743: return true;
1744: }
1745: }
1746:
1747: return false;
1748: }
1749:
1750: /**
1751: * Returns true if the user has the permission to add the portlet to a
1752: * layout.
1753: *
1754: * @return true if the user has the permission to add the portlet to a
1755: * layout
1756: */
1757: public boolean hasAddPortletPermission(long userId) {
1758: try {
1759: if (_rolesArray.length == 0) {
1760: return true;
1761: } else if (RoleLocalServiceUtil.hasUserRoles(userId,
1762: getCompanyId(), _rolesArray, true)) {
1763:
1764: return true;
1765: } else if (RoleLocalServiceUtil.hasUserRole(userId,
1766: getCompanyId(), RoleImpl.ADMINISTRATOR, true)) {
1767:
1768: return true;
1769: } else {
1770: User user = UserLocalServiceUtil.getUserById(userId);
1771:
1772: if (user.isDefaultUser()
1773: && hasRoleWithName(RoleImpl.GUEST)) {
1774: return true;
1775: }
1776: }
1777: } catch (Exception e) {
1778: _log.error(e);
1779: }
1780:
1781: return false;
1782: }
1783:
1784: /**
1785: * Returns true if the portlet is a system portlet that a user cannot
1786: * manually add to their page.
1787: *
1788: * @return true if the portlet is a system portlet that a user cannot
1789: * manually add to their page
1790: */
1791: public boolean getSystem() {
1792: return _system;
1793: }
1794:
1795: /**
1796: * Returns true if the portlet is a system portlet that a user cannot
1797: * manually add to their page.
1798: *
1799: * @return true if the portlet is a system portlet that a user cannot
1800: * manually add to their page
1801: */
1802: public boolean isSystem() {
1803: return _system;
1804: }
1805:
1806: /**
1807: * Sets to true if the portlet is a system portlet that a user cannot
1808: * manually add to their page.
1809: *
1810: * @param system boolean value for whether the portlet is a system
1811: * portlet that a user cannot manually add to their page
1812: */
1813: public void setSystem(boolean system) {
1814: _system = system;
1815: }
1816:
1817: /**
1818: * Returns true to include the portlet and make it available to be made
1819: * active.
1820: *
1821: * @return true to include the portlet and make it available to be made
1822: * active
1823: */
1824: public boolean getInclude() {
1825: return _include;
1826: }
1827:
1828: /**
1829: * Returns true to include the portlet and make it available to be made
1830: * active.
1831: *
1832: * @return true to include the portlet and make it available to be made
1833: * active
1834: */
1835: public boolean isInclude() {
1836: return _include;
1837: }
1838:
1839: /**
1840: * Sets to true to include the portlet and make it available to be made
1841: * active.
1842: *
1843: * @param include boolean value for whether to include the portlet and
1844: * make it available to be made active
1845: */
1846: public void setInclude(boolean include) {
1847: _include = include;
1848: }
1849:
1850: /**
1851: * Gets the init parameters of the portlet.
1852: *
1853: * @return init parameters of the portlet
1854: */
1855: public Map getInitParams() {
1856: return _initParams;
1857: }
1858:
1859: /**
1860: * Sets the init parameters of the portlet.
1861: *
1862: * @param initParams the init parameters of the portlet
1863: */
1864: public void setInitParams(Map initParams) {
1865: _initParams = initParams;
1866: }
1867:
1868: /**
1869: * Gets expiration cache of the portlet.
1870: *
1871: * @return expiration cache of the portlet
1872: */
1873: public Integer getExpCache() {
1874: return _expCache;
1875: }
1876:
1877: /**
1878: * Sets expiration cache of the portlet.
1879: *
1880: * @param expCache expiration cache of the portlet
1881: */
1882: public void setExpCache(Integer expCache) {
1883: _expCache = expCache;
1884: }
1885:
1886: /**
1887: * Gets the portlet modes of the portlet.
1888: *
1889: * @return portlet modes of the portlet
1890: */
1891: public Map getPortletModes() {
1892: return _portletModes;
1893: }
1894:
1895: /**
1896: * Sets the portlet modes of the portlet.
1897: *
1898: * @param portletModes the portlet modes of the portlet
1899: */
1900: public void setPortletModes(Map portletModes) {
1901: _portletModes = portletModes;
1902: }
1903:
1904: /**
1905: * Returns true if the portlet supports the specified mime type and
1906: * portlet mode.
1907: *
1908: * @return true if the portlet supports the specified mime type and
1909: * portlet mode
1910: */
1911: public boolean hasPortletMode(String mimeType,
1912: PortletMode portletMode) {
1913: if (mimeType == null) {
1914: mimeType = ContentTypes.TEXT_HTML;
1915: }
1916:
1917: Set mimeTypeModes = (Set) _portletModes.get(mimeType);
1918:
1919: if (mimeTypeModes == null) {
1920: return false;
1921: }
1922:
1923: if (mimeTypeModes.contains(portletMode.toString())) {
1924: return true;
1925: } else {
1926: return false;
1927: }
1928: }
1929:
1930: /**
1931: * Gets a list of all portlet modes supported by the portlet.
1932: *
1933: * @return a list of all portlet modes supported by the portlet
1934: */
1935: public Set getAllPortletModes() {
1936: Set allPortletModes = new TreeSet();
1937:
1938: Iterator itr1 = _portletModes.entrySet().iterator();
1939:
1940: while (itr1.hasNext()) {
1941: Map.Entry entry = (Map.Entry) itr1.next();
1942:
1943: Set mimeTypeModes = (Set) entry.getValue();
1944:
1945: Iterator itr2 = mimeTypeModes.iterator();
1946:
1947: while (itr2.hasNext()) {
1948: String portletMode = (String) itr2.next();
1949:
1950: allPortletModes.add(portletMode);
1951: }
1952: }
1953:
1954: return allPortletModes;
1955: }
1956:
1957: /**
1958: * Returns true if the portlet supports more than one mime type.
1959: *
1960: * @return true if the portlet supports more than one mime type
1961: */
1962: public boolean hasMultipleMimeTypes() {
1963: if (_portletModes.size() > 1) {
1964: return true;
1965: } else {
1966: return false;
1967: }
1968: }
1969:
1970: /**
1971: * Gets the supported locales of the portlet.
1972: *
1973: * @return supported locales of the portlet
1974: */
1975: public Set getSupportedLocales() {
1976: return _supportedLocales;
1977: }
1978:
1979: /**
1980: * Sets the supported locales of the portlet.
1981: *
1982: * @param supportedLocales the supported locales of the portlet
1983: */
1984: public void setSupportedLocales(Set supportedLocales) {
1985: _supportedLocales = supportedLocales;
1986: }
1987:
1988: /**
1989: * Gets the resource bundle of the portlet.
1990: *
1991: * @return resource bundle of the portlet
1992: */
1993: public String getResourceBundle() {
1994: return _resourceBundle;
1995: }
1996:
1997: /**
1998: * Sets the resource bundle of the portlet.
1999: *
2000: * @param resourceBundle the resource bundle of the portlet
2001: */
2002: public void setResourceBundle(String resourceBundle) {
2003: _resourceBundle = resourceBundle;
2004: }
2005:
2006: /**
2007: * Gets the portlet info of the portlet.
2008: *
2009: * @return portlet info of the portlet
2010: */
2011: public PortletInfo getPortletInfo() {
2012: return _portletInfo;
2013: }
2014:
2015: /**
2016: * Sets the portlet info of the portlet.
2017: *
2018: * @param portletInfo the portlet info of the portlet
2019: */
2020: public void setPortletInfo(PortletInfo portletInfo) {
2021: _portletInfo = portletInfo;
2022: }
2023:
2024: /**
2025: * Gets the user attributes of the portlet.
2026: *
2027: * @return user attributes of the portlet
2028: */
2029: public Set getUserAttributes() {
2030: return _userAttributes;
2031: }
2032:
2033: /**
2034: * Sets the user attributes of the portlet.
2035: *
2036: * @param userAttributes the user attributes of the portlet
2037: */
2038: public void setUserAttributes(Set userAttributes) {
2039: _userAttributes = userAttributes;
2040: }
2041:
2042: /**
2043: * Gets the custom user attributes of the portlet.
2044: *
2045: * @return custom user attributes of the portlet
2046: */
2047: public Map getCustomUserAttributes() {
2048: return _customUserAttributes;
2049: }
2050:
2051: /**
2052: * Sets the custom user attributes of the portlet.
2053: *
2054: * @param customUserAttributes the custom user attributes of the
2055: * portlet
2056: */
2057: public void setCustomUserAttributes(Map customUserAttributes) {
2058: _customUserAttributes = customUserAttributes;
2059: }
2060:
2061: /**
2062: * Gets the servlet context name of the portlet.
2063: *
2064: * @return the servlet context name of the portlet
2065: */
2066: public String getServletContextName() {
2067: return _servletContextName;
2068: }
2069:
2070: /**
2071: * Sets the servlet context name of the portlet.
2072: *
2073: * @param servletContextName the servlet context name of the portlet
2074: */
2075: public void setServletContextName(String servletContextName) {
2076: _servletContextName = servletContextName;
2077:
2078: if (Validator.isNotNull(_servletContextName)) {
2079: _warFile = true;
2080: } else {
2081: _warFile = false;
2082: }
2083: }
2084:
2085: /**
2086: * Returns true if the portlet is found in a WAR file.
2087: *
2088: * @return true if the portlet is found in a WAR file
2089: */
2090: public boolean getWARFile() {
2091: return _warFile;
2092: }
2093:
2094: /**
2095: * Returns true if the portlet is found in a WAR file.
2096: *
2097: * @return true if the portlet is found in a WAR file
2098: */
2099: public boolean isWARFile() {
2100: return _warFile;
2101: }
2102:
2103: /**
2104: * Sets to true if the portlet is found in a WAR file.
2105: *
2106: * @param warFile boolean value for whether the portlet is found in a
2107: * WAR file
2108: */
2109: public void setWARFile(boolean warFile) {
2110: _warFile = warFile;
2111: }
2112:
2113: /**
2114: * Gets the servlet context path of the portlet.
2115: *
2116: * @return the servlet context path of the portlet
2117: */
2118: public String getContextPath() {
2119: String virtualPath = getVirtualPath();
2120:
2121: if (Validator.isNotNull(virtualPath)) {
2122: return virtualPath;
2123: }
2124:
2125: if (isWARFile()) {
2126: StringMaker sm = new StringMaker();
2127:
2128: sm.append(StringPool.SLASH);
2129: sm.append(getServletContextName());
2130:
2131: return sm.toString();
2132: } else {
2133: return PortalUtil.getPathContext();
2134: }
2135: }
2136:
2137: /**
2138: * Returns true if the portlet is found in a WAR file.
2139: *
2140: * @param portletId the cloned instance portlet id
2141: * @return a cloned instance of the portlet
2142: */
2143: public Portlet getClonedInstance(String portletId) {
2144: if (_clonedInstances == null) {
2145:
2146: // LEP-528
2147:
2148: return null;
2149: }
2150:
2151: Portlet clonedInstance = (Portlet) _clonedInstances
2152: .get(portletId);
2153:
2154: if (clonedInstance == null) {
2155: clonedInstance = (Portlet) clone();
2156:
2157: clonedInstance.setPortletId(portletId);
2158:
2159: // Disable caching of cloned instances until we can figure out how
2160: // to elegantly refresh the cache when the portlet is dynamically
2161: // updated by the user. For example, the user might change the
2162: // portlet from one column to the next. Cloned instances that are
2163: // cached would not see the new change. We can then also cache
2164: // static portlet instances.
2165:
2166: //_clonedInstances.put(portletId, clonedInstance);
2167: }
2168:
2169: return clonedInstance;
2170: }
2171:
2172: /**
2173: * Returns true if the portlet is a static portlet that is cannot be moved.
2174: *
2175: * @return true if the portlet is a static portlet that is cannot be
2176: * moved
2177: */
2178: public boolean getStatic() {
2179: return _staticPortlet;
2180: }
2181:
2182: /**
2183: * Returns true if the portlet is a static portlet that is cannot be moved.
2184: *
2185: * @return true if the portlet is a static portlet that is cannot be
2186: * moved
2187: */
2188: public boolean isStatic() {
2189: return _staticPortlet;
2190: }
2191:
2192: /**
2193: * Sets to true if the portlet is a static portlet that is cannot be moved.
2194: *
2195: * @param staticPortlet boolean value for whether the portlet is a
2196: * static portlet that cannot be moved
2197: */
2198: public void setStatic(boolean staticPortlet) {
2199: _staticPortlet = staticPortlet;
2200: }
2201:
2202: /**
2203: * Returns true if the portlet is a static portlet at the start of a list of
2204: * portlets.
2205: *
2206: * @return true if the portlet is a static portlet at the start of a
2207: * list of portlets
2208: */
2209: public boolean getStaticStart() {
2210: return _staticPortletStart;
2211: }
2212:
2213: /**
2214: * Returns true if the portlet is a static portlet at the start of a list of
2215: * portlets.
2216: *
2217: * @return true if the portlet is a static portlet at the start of a
2218: * list of portlets
2219: */
2220: public boolean isStaticStart() {
2221: return _staticPortletStart;
2222: }
2223:
2224: /**
2225: * Sets to true if the portlet is a static portlet at the start of a list of
2226: * portlets.
2227: *
2228: * @param staticPortletStart boolean value for whether the portlet is
2229: * a static portlet at the start of a list of portlets
2230: */
2231: public void setStaticStart(boolean staticPortletStart) {
2232: _staticPortletStart = staticPortletStart;
2233: }
2234:
2235: /**
2236: * Returns true if the portlet is a static portlet at the end of a list of
2237: * portlets.
2238: *
2239: * @return true if the portlet is a static portlet at the end of a
2240: * list of portlets
2241: */
2242: public boolean getStaticEnd() {
2243: return !_staticPortletStart;
2244: }
2245:
2246: /**
2247: * Returns true if the portlet is a static portlet at the end of a list of
2248: * portlets.
2249: *
2250: * @return true if the portlet is a static portlet at the end of a
2251: * list of portlets
2252: */
2253: public boolean isStaticEnd() {
2254: return !_staticPortletStart;
2255: }
2256:
2257: /**
2258: * The servlet url patterns that are part of this application.
2259: *
2260: * @return The servlet url patterns that are part of this application
2261: */
2262: public List getServletURLPatterns() {
2263: return _servletURLPatterns;
2264: }
2265:
2266: /**
2267: * The servlet url patterns that are part of this application.
2268: *
2269: * @param servletURLPatterns servlet url patterns that are part of
2270: * this application
2271: */
2272: public void setServletURLPatterns(List servletURLPatterns) {
2273: _servletURLPatterns = servletURLPatterns;
2274: }
2275:
2276: /**
2277: * Creates and returns a copy of this object.
2278: *
2279: * @return a copy of this object
2280: */
2281: public Object clone() {
2282: return new PortletImpl(getPortletId(), getPluginPackage(),
2283: getDefaultPluginSetting(), getCompanyId(), getIcon(),
2284: getVirtualPath(), getStrutsPath(), getDisplayName(),
2285: getPortletClass(), getConfigurationActionClass(),
2286: getIndexerClass(), getOpenSearchClass(),
2287: getSchedulerClass(), getPortletURLClass(),
2288: getFriendlyURLMapperClass(), getURLEncoderClass(),
2289: getPortletDataHandlerClass(),
2290: getPortletLayoutListenerClass(),
2291: getActivityTrackerInterpreterClass(),
2292: getPopMessageListenerClass(), getDefaultPreferences(),
2293: getPreferencesValidator(), isPreferencesCompanyWide(),
2294: isPreferencesUniquePerLayout(),
2295: isPreferencesOwnedByGroup(), isUseDefaultTemplate(),
2296: isShowPortletAccessDenied(), isShowPortletInactive(),
2297: isActionURLRedirect(), isRestoreCurrentView(),
2298: isMaximizeEdit(), isMaximizeHelp(), isPopUpPrint(),
2299: isLayoutCacheable(), isInstanceable(),
2300: getUserPrincipalStrategy(),
2301: isPrivateRequestAttributes(),
2302: isPrivateSessionAttributes(), getRenderWeight(),
2303: isAjaxable(), getHeaderPortalCss(),
2304: getHeaderPortletCss(), getHeaderPortalJavaScript(),
2305: getHeaderPortletJavaScript(), getFooterPortalCss(),
2306: getFooterPortletCss(), getFooterPortalJavaScript(),
2307: getFooterPortletJavaScript(), getCssClassWrapper(),
2308: isAddDefaultResource(), getRoles(), getUnlinkedRoles(),
2309: getRoleMappers(), isSystem(), isActive(), isInclude(),
2310: getInitParams(), getExpCache(), getPortletModes(),
2311: getSupportedLocales(), getResourceBundle(),
2312: getPortletInfo(), getUserAttributes(),
2313: getCustomUserAttributes(), getServletContextName(),
2314: getServletURLPatterns());
2315: }
2316:
2317: /**
2318: * Compares this portlet to the specified object.
2319: *
2320: * @param obj the object to compare this portlet against
2321: * @return the value 0 if the argument portlet is equal to this
2322: * portlet; a value less than -1 if this portlet is less than
2323: * the portlet argument; and 1 if this portlet is greater than
2324: * the portlet argument
2325: */
2326: public int compareTo(Object obj) {
2327: Portlet portlet = (Portlet) obj;
2328:
2329: return getPortletId().compareTo(portlet.getPortletId());
2330: }
2331:
2332: /**
2333: * Checks whether this portlet is equal to the specified object.
2334: *
2335: * @param obj the object to compare this portlet against
2336: * @return true if the portlet is equal to the specified object
2337: */
2338: public boolean equals(Object obj) {
2339: Portlet portlet = (Portlet) obj;
2340:
2341: return getPortletId().equals(portlet.getPortletId());
2342: }
2343:
2344: /**
2345: * Log instance for this class.
2346: */
2347: private static Log _log = LogFactory.getLog(PortletImpl.class);
2348:
2349: /**
2350: * Package to which this plugin belongs to.
2351: */
2352: private PluginPackage _pluginPackage;
2353:
2354: /**
2355: * Plugin settings associated with the portlet.
2356: */
2357: private PluginSetting _defaultPluginSetting;
2358:
2359: /**
2360: * The icon of the portlet.
2361: */
2362: private String _icon;
2363:
2364: /**
2365: * The virtual path of the portlet.
2366: */
2367: private String _virtualPath;
2368:
2369: /**
2370: * The struts path of the portlet.
2371: */
2372: private String _strutsPath;
2373:
2374: /**
2375: * The display name of the portlet.
2376: */
2377: private String _displayName;
2378:
2379: /**
2380: * The name of the portlet class of the portlet.
2381: */
2382: private String _portletClass;
2383:
2384: /**
2385: * The configuration action class of the portlet.
2386: */
2387: private String _configurationActionClass;
2388:
2389: /**
2390: * The name of the indexer class of the portlet.
2391: */
2392: private String _indexerClass;
2393:
2394: /**
2395: * The name of the open search class of the portlet.
2396: */
2397: private String _openSearchClass;
2398:
2399: /**
2400: * The name of the scheduler class of the portlet.
2401: */
2402: private String _schedulerClass;
2403:
2404: /**
2405: * The name of the portlet URL class of the portlet.
2406: */
2407: private String _portletURLClass;
2408:
2409: /**
2410: * The name of the friendly URL mapper class of the portlet.
2411: */
2412: private String _friendlyURLMapperClass;
2413:
2414: /**
2415: * The name of the URL encoder class of the portlet.
2416: */
2417: private String _urlEncoderClass;
2418:
2419: /**
2420: * The name of the portlet data handler class of the portlet.
2421: */
2422: private String _portletDataHandlerClass;
2423:
2424: /**
2425: * The name of the portlet data layout listener class of the portlet.
2426: */
2427: private String _portletLayoutListenerClass;
2428:
2429: /**
2430: * The name of the activity tracker interpreter class of the portlet.
2431: */
2432: private String _activityTrackerInterpreterClass;
2433:
2434: /**
2435: * The name of the POP message listener class of the portlet.
2436: */
2437: private String _popMessageListenerClass;
2438:
2439: /**
2440: * The default preferences of the portlet.
2441: */
2442: private String _defaultPreferences;
2443:
2444: /**
2445: * The name of the preferences validator class of the portlet.
2446: */
2447: private String _prefsValidator;
2448:
2449: /**
2450: * True if preferences are shared across the entire company.
2451: */
2452: private boolean _prefsCompanyWide;
2453:
2454: /**
2455: * True if preferences are unique per layout.
2456: */
2457: private boolean _prefsUniquePerLayout = true;
2458:
2459: /**
2460: * True if preferences are owned by the group when the portlet is shown in a
2461: * group layout. False if preferences are owned by the user at all times.
2462: */
2463: private boolean _prefsOwnedByGroup = true;
2464:
2465: /**
2466: * True if the portlet uses the default template.
2467: */
2468: private boolean _useDefaultTemplate = true;
2469:
2470: /**
2471: * True if users are shown that they do not have access to the portlet.
2472: */
2473: private boolean _showPortletAccessDenied = PropsValues.LAYOUT_SHOW_PORTLET_ACCESS_DENIED;
2474:
2475: /**
2476: * True if users are shown that the portlet is inactive.
2477: */
2478: private boolean _showPortletInactive = PropsValues.LAYOUT_SHOW_PORTLET_INACTIVE;
2479:
2480: /**
2481: * True if an action URL for this portlet should cause an auto redirect.
2482: */
2483: private boolean _actionURLRedirect;
2484:
2485: /**
2486: * True if the portlet restores to the current view from the maximized
2487: * state.
2488: */
2489: private boolean _restoreCurrentView = true;
2490:
2491: /**
2492: * True if the portlet goes into the maximized state when the user goes into
2493: * the edit mode.
2494: */
2495: private boolean _maximizeEdit;
2496:
2497: /**
2498: * True if the portlet goes into the maximized state when the user goes into
2499: * the help mode.
2500: */
2501: private boolean _maximizeHelp;
2502:
2503: /**
2504: * True if the portlet goes into the pop up state when the user goes into
2505: * the print mode.
2506: */
2507: private boolean _popUpPrint = true;
2508:
2509: /**
2510: * True if the portlet can be cached within the layout.
2511: */
2512: private boolean _layoutCacheable;
2513:
2514: /**
2515: * True if the portlet can be added multiple times to a layout.
2516: */
2517: private boolean _instanceable;
2518:
2519: /**
2520: * The user principal strategy of the portlet.
2521: */
2522: private String _userPrincipalStrategy = PortletImpl.USER_PRINCIPAL_STRATEGY_USER_ID;
2523:
2524: /**
2525: * True if the portlet does not share request attributes with the portal or
2526: * portlets from another WAR.
2527: */
2528: private boolean _privateRequestAttributes = true;
2529:
2530: /**
2531: * True if the portlet does not share session attributes with the portal.
2532: */
2533: private boolean _privateSessionAttributes = true;
2534:
2535: /**
2536: * Render weight of the portlet.
2537: */
2538: private int _renderWeight = 1;
2539:
2540: /**
2541: * True if the portlet can be displayed via Ajax.
2542: */
2543: private boolean _ajaxable = true;
2544:
2545: /**
2546: * A list of CSS files that will be referenced from the page's header
2547: * relative to the portal's context path.
2548: */
2549: private List _headerPortalCss;
2550:
2551: /**
2552: * A list of CSS files that will be referenced from the page's header
2553: * relative to the portlet's context path.
2554: */
2555: private List _headerPortletCss;
2556:
2557: /**
2558: * A list of JavaScript files that will be referenced from the page's header
2559: * relative to the portal's context path.
2560: */
2561: private List _headerPortalJavaScript;
2562:
2563: /**
2564: * A list of JavaScript files that will be referenced from the page's header
2565: * relative to the portlet's context path.
2566: */
2567: private List _headerPortletJavaScript;
2568:
2569: /**
2570: * A list of CSS files that will be referenced from the page's footer
2571: * relative to the portal's context path.
2572: */
2573: private List _footerPortalCss;
2574:
2575: /**
2576: * A list of CSS files that will be referenced from the page's footer
2577: * relative to the portlet's context path.
2578: */
2579: private List _footerPortletCss;
2580:
2581: /**
2582: * A list of JavaScript files that will be referenced from the page's footer
2583: * relative to the portal's context path.
2584: */
2585: private List _footerPortalJavaScript;
2586:
2587: /**
2588: * A list of JavaScript files that will be referenced from the page's footer
2589: * relative to the portlet's context path.
2590: */
2591: private List _footerPortletJavaScript;
2592:
2593: /**
2594: * The name of the CSS class that will be injected in the DIV that wraps
2595: * this portlet.
2596: */
2597: private String _cssClassWrapper;
2598:
2599: /**
2600: * True if default resources for the portlet are added to a page.
2601: */
2602: private boolean _addDefaultResource;
2603:
2604: /**
2605: * An array of required roles of the portlet.
2606: */
2607: private String[] _rolesArray;
2608:
2609: /**
2610: * The unlinked roles of the portlet.
2611: */
2612: private Set _unlinkedRoles;
2613:
2614: /**
2615: * The role mappers of the portlet.
2616: */
2617: private Map _roleMappers;
2618:
2619: /**
2620: * True if the portlet is a system portlet that a user cannot manually add
2621: * to their page.
2622: */
2623: private boolean _system;
2624:
2625: /**
2626: * True to include the portlet and make it available to be made active.
2627: */
2628: private boolean _include = true;
2629:
2630: /**
2631: * The init parameters of the portlet.
2632: */
2633: private Map _initParams;
2634:
2635: /**
2636: * The expiration cache of the portlet.
2637: */
2638: private Integer _expCache;
2639:
2640: /**
2641: * The portlet modes of the portlet.
2642: */
2643: private Map _portletModes;
2644:
2645: /**
2646: * The supported locales of the portlet.
2647: */
2648: private Set _supportedLocales;
2649:
2650: /**
2651: * The resource bundle of the portlet.
2652: */
2653: private String _resourceBundle;
2654:
2655: /**
2656: * The portlet info of the portlet.
2657: */
2658: private PortletInfo _portletInfo;
2659:
2660: /**
2661: * The user attributes of the portlet.
2662: */
2663: private Set _userAttributes;
2664:
2665: /**
2666: * The custom user attributes of the portlet.
2667: */
2668: private Map _customUserAttributes;
2669:
2670: /**
2671: * The servlet context name of the portlet.
2672: */
2673: private String _servletContextName;
2674:
2675: /**
2676: * True if the portlet is found in a WAR file.
2677: */
2678: private boolean _warFile;
2679:
2680: /**
2681: * The cloned instances of the portlet.
2682: */
2683: private Map _clonedInstances;
2684:
2685: /**
2686: * True if the portlet is a static portlet that is cannot be moved.
2687: */
2688: private boolean _staticPortlet;
2689:
2690: /**
2691: * True if the portlet is a static portlet at the start of a list of
2692: * portlets.
2693: */
2694: private boolean _staticPortletStart;
2695:
2696: /**
2697: * The servlet url patterns that are part of this application.
2698: */
2699: private List _servletURLPatterns;
2700:
2701: }
|