001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: *
017: * $Header:$
018: */
019: package org.apache.beehive.netui.pageflow.scoping;
020:
021: import javax.servlet.http.HttpServletRequest;
022: import java.util.Map;
023:
024: /**
025: * A wrapper around HttpServletRequest, associated with a given scope-key. All calls to setAttribute,
026: * getAttribute, removeAttribute, etc. are scoped to this object, while most other functionality
027: * delegates to the wrapped HttpServletRequest.
028: * Instances of this class also keep track of their own request-URIs, which are independent of the
029: * wrapped request-URIs.
030: */
031: public interface ScopedRequest extends HttpServletRequest {
032: public String AUTOSCOPE_PREFIX = "_autoscope_";
033:
034: public void setRequestURI(String uri);
035:
036: /**
037: * Adds a scope to "listen" to. This scope will see all request parameters from a ScopedRequest
038: * of the given scope.
039: */
040: public void addListenScope(Object scopeKey);
041:
042: public void doForward();
043:
044: public String getForwardedURI();
045:
046: /**
047: * @deprecated Use {@link ScopedResponse#didRedirect} instead.
048: */
049: public boolean didRedirect();
050:
051: /**
052: * Stores the current map of request attributes in the Session.
053: * @deprecated Moved the persisting of attributes out of the beehive NetUI
054: * layer. Use {@link #getAttributeMap} to get the attributes.
055: */
056: public void persistAttributes();
057:
058: /**
059: * Restores the map of request attributes from a map saved in the Session.
060: * @deprecated Moved the persisting of attributes out of the beehive NetUI
061: * layer. Use {@link #setAttributeMap} to set/merge the attributes.
062: */
063: public void restoreAttributes();
064:
065: /**
066: * Get the current map of request attributes.
067: */
068: public Map getAttributeMap();
069:
070: /**
071: * Set/merge the map of request attributes from a map (saved in the Session).
072: */
073: public void setAttributeMap(Map map);
074:
075: public HttpServletRequest getOuterRequest();
076:
077: public Object getScopeKey();
078:
079: public void renameScope(Object newScopeKey);
080:
081: /**
082: * Makes this request listen to specially-prefixed request parameters.
083: */
084: public void setActiveRequest();
085:
086: public String getScopedName(String baseName);
087:
088: public void registerOuterAttribute(String attrName);
089:
090: public String getLocalParameter(String attrName);
091:
092: public String getListenScopeParameter(String attrName);
093:
094: public boolean hasListenScopes();
095:
096: /**
097: * Same as <code>getAttribute</code>, but allows outer request attributes to be hidden explicitly, even if the implementation
098: * of getAttribute shows them by default.
099: */
100: public Object getAttribute(String attrName,
101: boolean allowOuterRequestAttributes);
102:
103: /**
104: * @exclude
105: */
106: public Map filterParameterMap(Map parameterMap);
107:
108: /**
109: * Simply stores the URI that was being forwarded to.
110: */
111: public void setForwardedURI(String uri);
112: }
|