001: //** Copyright Statement ***************************************************
002: //The Salmon Open Framework for Internet Applications (SOFIA)
003: // Copyright (C) 1999 - 2002, Salmon LLC
004: //
005: // This program is free software; you can redistribute it and/or
006: // modify it under the terms of the GNU General Public License version 2
007: // as published by the Free Software Foundation;
008: //
009: // This program is distributed in the hope that it will be useful,
010: // but WITHOUT ANY WARRANTY; without even the implied warranty of
011: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: // GNU General Public License for more details.
013: //
014: // You should have received a copy of the GNU General Public License
015: // along with this program; if not, write to the Free Software
016: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: //
018: // For more information please visit http://www.salmonllc.com
019: //** End Copyright Statement ***************************************************
020: package com.salmonllc.portlet;
021:
022: import java.util.Map;
023:
024: import javax.portlet.ActionRequest;
025: import javax.portlet.ActionResponse;
026: import javax.portlet.RenderRequest;
027: import javax.portlet.RenderResponse;
028:
029: /**
030: * This class contains information on the portlet that launched a particluar JSP page
031: */
032: public class PortletInfo {
033: private String _portletName;
034: private String _portletRenderURL;
035: private String _portletActionURL;
036: private Map _parmameterMap;
037: private String _portletJsp;
038: private boolean _fromPost;
039: private String _nameSpace;
040: private ActionRequest _actionRequest;
041: private ActionResponse _actionResponse;
042: private RenderRequest _renderRequest;
043: private RenderResponse _renderResponse;
044: private String _portletTitle;
045:
046: /**
047: * @return the URL to invoke a portlet action
048: */
049: public String getPortletActionURL() {
050: return _portletActionURL;
051: }
052:
053: /**
054: * @return the name of the portlet
055: */
056: public String getPortletName() {
057: return _portletName;
058: }
059:
060: /**
061: * @return the URL to invoke a portlet rendering
062: */
063: public String getPortletRenderURL() {
064: return _portletRenderURL;
065: }
066:
067: /**
068: * @param string the URL to invoke a portlet action
069: */
070: void setPortletActionURL(String string) {
071: _portletActionURL = string;
072: }
073:
074: /**
075: * @param string the name of the portlet
076: */
077: void setPortletName(String string) {
078: _portletName = string;
079: }
080:
081: /**
082: * @param string the URL to invoke a portlet rendering
083: */
084: void setPortletRenderURL(String string) {
085: _portletRenderURL = string;
086: }
087:
088: /**
089: * @return the map of parameters sent to the servlet
090: */
091: public Map getParmameterMap() {
092: return _parmameterMap;
093: }
094:
095: /**
096: * @param set the map of parameters sent to the servlet
097: */
098: void setParmameterMap(Map map) {
099: _parmameterMap = map;
100: }
101:
102: /**
103: * @return the JSP page used by this portlet
104: */
105: public String getPortletJsp() {
106: return _portletJsp;
107: }
108:
109: /**
110: * @param sets the JSP page used by this portlet
111: */
112: void setPortletJsp(String string) {
113: _portletJsp = string;
114: }
115:
116: /**
117: * @return true if the page render request is due to a post request
118: */
119: public boolean isFromPost() {
120: return _fromPost;
121: }
122:
123: /**
124: * @param set to true if the render request is due to a port request
125: */
126: public void setFromPost(boolean b) {
127: _fromPost = b;
128: }
129:
130: /**
131: * @return a unique name used to uniquely identify components in a portlet
132: */
133: public String getNameSpace() {
134: return _nameSpace;
135: }
136:
137: /**
138: * @param set a unique name used to uniquely identify components in a portlet
139: */
140: void setNameSpace(String string) {
141: _nameSpace = string;
142: }
143:
144: /**
145: * @return the ActionRequest object for the portlet (submit events only)
146: */
147: public ActionRequest getActionRequest() {
148: return _actionRequest;
149: }
150:
151: /**
152: * @return the ActionResponse object for the portlet (submit events only)
153: */
154: public ActionResponse getActionResponse() {
155: return _actionResponse;
156: }
157:
158: /**
159: * @return the RenderRequest object for the portlet (requested events only)
160: */
161: public RenderRequest getRenderRequest() {
162: return _renderRequest;
163: }
164:
165: /**
166: * @return the RenderReesponse object for the portlet (requested events only)
167: */
168: public RenderResponse getRenderResponse() {
169: return _renderResponse;
170: }
171:
172: void setActionRequest(ActionRequest request) {
173: _actionRequest = request;
174: }
175:
176: void setActionResponse(ActionResponse response) {
177: _actionResponse = response;
178: }
179:
180: void setRenderRequest(RenderRequest request) {
181: _renderRequest = request;
182: }
183:
184: void setRenderResponse(RenderResponse response) {
185: _renderResponse = response;
186: }
187:
188: /**
189: * @return the title for the portlet
190: */
191: public String getPortletTitle() {
192: return _portletTitle;
193: }
194:
195: /**
196: * @param set the title for the portlet
197: */
198: void setPortletTitle(String string) {
199: _portletTitle = string;
200: }
201:
202: }
|