001: /*
002: * The Apache Software License, Version 1.1
003: *
004: * Copyright (c) 2001-2004 Caucho Technology, Inc. All rights reserved.
005: *
006: * Redistribution and use in source and binary forms, with or without
007: * modification, are permitted provided that the following conditions
008: * are met:
009: *
010: * 1. Redistributions of source code must retain the above copyright
011: * notice, this list of conditions and the following disclaimer.
012: *
013: * 2. Redistributions in binary form must reproduce the above copyright
014: * notice, this list of conditions and the following disclaimer in
015: * the documentation and/or other materials provided with the
016: * distribution.
017: *
018: * 3. The end-user documentation included with the redistribution, if
019: * any, must include the following acknowlegement:
020: * "This product includes software developed by the
021: * Caucho Technology (http://www.caucho.com/)."
022: * Alternately, this acknowlegement may appear in the software itself,
023: * if and wherever such third-party acknowlegements normally appear.
024: *
025: * 4. The names "Hessian", "Resin", and "Caucho" must not be used to
026: * endorse or promote products derived from this software without prior
027: * written permission. For written permission, please contact
028: * info@caucho.com.
029: *
030: * 5. Products derived from this software may not be called "Resin"
031: * nor may "Resin" appear in their names without prior written
032: * permission of Caucho Technology.
033: *
034: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
035: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
036: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
037: * DISCLAIMED. IN NO EVENT SHALL CAUCHO TECHNOLOGY OR ITS CONTRIBUTORS
038: * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
039: * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
040: * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
041: * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
042: * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
043: * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
044: * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
045: *
046: * @author Sam
047: */
048:
049: package com.caucho.portal.generic;
050:
051: import javax.portlet.PortletMode;
052: import javax.portlet.PortletModeException;
053: import javax.portlet.WindowState;
054: import javax.portlet.WindowStateException;
055: import java.util.Map;
056:
057: /**
058: */
059: public interface PortalResponse {
060: /**
061: * Set the portlet modes for a namespace.
062: * If the portlet matching the namespace has already had processAction()
063: * or render() called on it, an exception is thrown because it
064: * is too late to set the portlet mode.
065: *
066: * @throw IllegalStateException if it is too late in the processing of the
067: * request to set the portlet mode for the namespace
068: *
069: * @throw IllegalArgumentException if the namespace is not known
070: */
071: public void setPortletMode(String namespace, PortletMode portletMode)
072: throws PortletModeException;
073:
074: /**
075: * Set the window state for a namespace.
076: * If the portlet matching the namespace has already had processAction()
077: * or render() called on it, an exception is thrown because it
078: * is too late to set the window state.
079: *
080: * @throw IllegalStateException if it is too late in the processing of the
081: * request to set the window state for the namespace
082: *
083: * @throw IllegalArgumentException if the namespace is not known
084: */
085: public void setWindowState(String namespace, WindowState windowState)
086: throws WindowStateException;
087:
088: /**
089: * Set parameters for a namespace to the map.
090: * If the portlet matching the namespace has already had processAction()
091: * or render() called on it, an exception is thrown because it
092: * is too late to set parameters.
093: *
094: * @throw IllegalStateException if it is too late in the processing of the
095: * request to set parameters for the namespace
096: *
097: * @throw IllegalArgumentException if the namespace is not known
098: */
099: public void setParameters(String namespace,
100: Map<String, String[]> srcMap);
101:
102: /**
103: * Set a Rparameter for a namespace.
104: * If the portlet matching the namespace has already had processAction()
105: * or render() called on it, an exception is thrown because it
106: * is too late to set parameters.
107: *
108: * @throw IllegalStateException if it is too late in the processing of the
109: * request to set parameters for the namespace
110: *
111: * @throw IllegalArgumentException if the namespace is not known
112: */
113: public void setParameter(String namespace, String name, String value);
114:
115: /**
116: * Set a parameter for a namespace.
117: * If the portlet matching the namespace has already had processAction()
118: * or render() called on it, an exception is thrown because it
119: * is too late to set parameters.
120: *
121: * @throw IllegalStateException if it is too late in the processing of the
122: * request to set parameters for the namespace
123: *
124: * @throw IllegalArgumentException if the namespace is not known
125: */
126: public void setParameter(String namespace, String name,
127: String[] values);
128:
129: /**
130: * Create a render url to another namespace.
131: *
132: * @param keepParameters if true, then the render parameters that exist for
133: * the namespace for this request are maintained for the next request.
134: * If false, the url when first formed will have no parameters.
135: */
136: public PortalURL createRenderURL(String namespace,
137: boolean keepParameters);
138:
139: /**
140: * Create an action url that targets another namespace.
141: *
142: * @param isSticky if true, then the render parameters that exist for the
143: * namespace for this request are maintained for the next request.
144: * If false, the url when first formed will have no parameters.
145: */
146: public PortalURL createActionURL(String namespace,
147: boolean keepParameters);
148:
149: }
|