| |
|
| org.jasig.portal.channels.jsp.IController
All known Subclasses: org.jasig.portal.channels.jspSample.Controller,
IController | public interface IController extends ICacheable(Code) | | Implementors of this interface can be used in the Jsp Channel Type to
a create a channel whose content is served up from JSPs in a model II
controller architecture. The controller can act on each incoming request
via the processRuntimeData method and alter its internal model accordingly.
There is one controller intance per channel per user so it can safely use
instance variables. Any business objects that need to be passed to one of
its JSPs via the request object should be placed in the Map returned from
that method.
author: Mark Boyd |
Method Summary | |
public Map | getJspMap() Returns a Map of jsp pages that are exposed by the controller. | public String | getJspToRender() Returns the id of the jsp that should be delegated to for this request. | public Map | processRuntimeData(ChannelRuntimeData drd, HttpSession s) Allows the plugged-in controller for the jsp channel to have access to
request-time parameters passed back to the channel instance and to take
action internally. | public void | receiveEvent(PortalEvent ev) Allows the plugged-in controller for the jsp channel to know about
channel events. | public void | setStaticData(ChannelStaticData csd) Allows the plugged-in controller for the jsp channel to have access to
publish-time parameters and other information about the user. |
getJspMap | public Map getJspMap()(Code) | | Returns a Map of jsp pages that are exposed by the controller. This
map is a name/value pair, where the name is the actual jsp channel name
and the value is the request path.
Process flow of the channel framework dictates that the map should be
available to the controlling channel during the setStaticData method
call.
An example of the values that would be typically be placed in the map by
the controller is:
jspmap.put("show.UserInfo.jsp","jsps/user.jsp");
|
getJspToRender | public String getJspToRender()(Code) | | Returns the id of the jsp that should be delegated to for this request.
The
set of ids that can be returned and the jsps that each id maps to is defined
in the getJspMap method. Their value
indicates the location of the specific jsp page to be used. The location
returned follows the pattern used by
java.lang.Class.getResource(). If the value begins with a "/" it is left
unchanged; otherwise, the package name of the
controller class is prepended to the value after converting "." to "/". In
either case the location is expected to be relative to the
"WEB-INF/classes" directory for the webapp and the JSP is then delegated
to using a request dispatcher. If the controller, its JSPs, and any
other resource are is deployed as a CAR the Channel class extracts
and class files and JSPs into WEB-INF/classes in package relative
locations so that the web server can compile the JSPs and so that the
JSPs can access the classes. All other resources remain within the CAR
and are accesses appropriately by the Channel. *
An example of the values that would be typically be placed in the map by
the controller is:
map.put("show.UserInfo.jsp","jsps/user.jsp");
For the above example if the controller were in the com.sct.myChannel
package and this method returned "show.UserInfo.jsp" then the fully
qualified path specified to acquire the dispatcher would be:
"/WEB-INF/classes/com/sct/myChannel/jsp/user.jsp"
This method should never return a value of null. If the last content
generated by the channel should be used the ICacheable implementations
should indicate such behavior and prevent this method from being
called. This method will only be called when new rendering is required
as dictated by reponses to the ICacheable implementation methods.
|
processRuntimeData | public Map processRuntimeData(ChannelRuntimeData drd, HttpSession s)(Code) | | Allows the plugged-in controller for the jsp channel to have access to
request-time parameters passed back to the channel instance and to take
action internally. Any objects that should be passed to the jsp to be
delegated to should be placed in the returned Map object and they will
be added to the request.setAttribute() method using the same keys and
values. If no objects are to be passed to the jsp via the request object
then this method can return null. If a Map is returned two parameters
will be passed added in to be passed to the
jsp by the containing Jsp Channel type and will override values having
the same key already located within the Map passed back from the
controller. These are "baseActionUrl" and "baseMediaUrl".
|
setStaticData | public void setStaticData(ChannelStaticData csd)(Code) | | Allows the plugged-in controller for the jsp channel to have access to
publish-time parameters and other information about the user. Included
in the set are parameters whose keys end in ".jsp". Additionally, there
will be one parameter whose key is "controllerClass". The are used by
the jsp channel itself. For more information see the indicated method.
Beyond these two restrictions on keys any other parameters can be
specified during publishing that are needed by the controller to perform
its work. In addition to the static data the HttpSession is also passed
in and can be used to set both session and application scope values to
be used in its JSPs.
See Also: org.jasig.portal.channels.jsp.IController.getJspToRender |
|
|
|