001: /**
002: * $Id: MarkupConfig.java,v 1.3 2004/01/07 23:54:15 mjain Exp $
003: * Copyright 2003 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */package com.sun.portal.wsrp.consumer.markup;
014:
015: import com.sun.portal.wsrp.common.stubs.ServiceDescription;
016: import com.sun.portal.wsrp.common.stubs.PortletDescription;
017: import com.sun.portal.wsrp.common.stubs.PortletContext;
018: import com.sun.portal.wsrp.consumer.producermanager.ProducerEntity;
019: import com.sun.portal.wsrp.consumer.producermanager.ProducerEntityManager;
020: import com.sun.portal.wsrp.consumer.common.RemoteServiceStubManager;
021:
022: /**
023: * This class represents collection of commonly used, static configuration
024: * information or handles to such information that is needed to
025: * completly process a markup request. Examples of such information is
026: * ProducerEntityId, portletId, consumerId, channelId that a request is targeted too.
027: * It also has convinence handles to ProducerEntity Instance,
028: * ProducerEntityManager instance.
029: * Given a container request, MarkupConfigManager
030: * returns a populated instance of this class.
031: *
032: * @see MarkupConfigManager
033: */
034: public class MarkupConfig {
035:
036: private String _channelName;
037: private String _producerEntityId;
038: private String _portletId;
039: private String _consumerId;
040: private ProducerEntity _producerEntity;
041: private ProducerEntityManager _producerEntityManager;
042: private RemoteServiceStubManager _remoteServiceStubManager;
043: private ServiceDescription _serviceDescription;
044: private PortletDescription _portletDescription;
045: private PortletContext _portletContext;
046: private String _portletInstanceKey;
047: private String _namespacePrefix;
048:
049: /**
050: * Constuctor
051: *
052: * @param channelName
053: * @param producerEntityId
054: * @param portletId
055: * @param consumerId
056: * @param producerEntity
057: * @param producerEntityManager
058: * @param remoteServiceStubManager
059: * @param serviceDescription
060: * @param portletDescription
061: * @param portletContext
062: * @param portletInstanceKey
063: * @param namespacePrefix
064: */
065: public MarkupConfig(String channelName, String producerEntityId,
066: String portletId, String consumerId,
067: ProducerEntity producerEntity,
068: ProducerEntityManager producerEntityManager,
069: RemoteServiceStubManager remoteServiceStubManager,
070: ServiceDescription serviceDescription,
071: PortletDescription portletDescription,
072: PortletContext portletContext, String portletInstanceKey,
073: String namespacePrefix) {
074:
075: _channelName = channelName;
076: _producerEntityId = producerEntityId;
077: _portletId = portletId;
078: _consumerId = consumerId;
079: _producerEntity = producerEntity;
080: _producerEntityManager = producerEntityManager;
081: _remoteServiceStubManager = remoteServiceStubManager;
082: _serviceDescription = serviceDescription;
083: _portletDescription = portletDescription;
084: _portletContext = portletContext;
085: _portletInstanceKey = portletInstanceKey;
086: _namespacePrefix = namespacePrefix;
087:
088: }
089:
090: public String getChannelName() {
091: return _channelName;
092: }
093:
094: public String getProducerEntityId() {
095: return _producerEntityId;
096: }
097:
098: public String getPortletId() {
099: return _portletId;
100: }
101:
102: public String getConsumerId() {
103: return _consumerId;
104: }
105:
106: public ProducerEntity getProducerEntity() {
107: return _producerEntity;
108: }
109:
110: public ProducerEntityManager getProducerEntityManager() {
111: return _producerEntityManager;
112: }
113:
114: public ServiceDescription getServiceDescription() {
115: return _serviceDescription;
116: }
117:
118: public PortletDescription getPortletDescription() {
119: return _portletDescription;
120: }
121:
122: public PortletContext getPortletContext() {
123: return _portletContext;
124: }
125:
126: public String getPortletInstanceKey() {
127: return _portletInstanceKey;
128: }
129:
130: public String getNamespacePrefix() {
131: return _namespacePrefix;
132: }
133:
134: /**
135: * Returns true if the portlet handle is the default portlet handle
136: * in the service description. Value of this is used to set the portletState
137: * flag during the markup to ( readwrite, readonly or cloneBeforeWrite.)
138: */
139: public boolean isPortletHandleDefault() {
140: if (getPortletDescription().getPortletHandle().equals(
141: getPortletContext().getPortletHandle())) {
142: return true;
143: } else {
144: return false;
145: }
146: }
147:
148: public RemoteServiceStubManager getRemoteServiceStubManager() {
149: return _remoteServiceStubManager;
150: }
151:
152: }
|