1/*2 * Copyright 2000-2001,2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.services.forward;
1819import java.util.Collection;
20import java.util.Map;
2122import org.apache.turbine.services.Service;
23import org.apache.turbine.util.RunData;
24import org.apache.turbine.util.DynamicURI;
2526import org.apache.jetspeed.services.forward.configuration.Forward;
27import org.apache.jetspeed.services.forward.configuration.PortletForward;
282930/***31 * <P>This is the interface to the Jetspeed Forward services.32 * The interface defines methods for forwarding navigation to 33 * other pages or panes in the portal. The Forward service34 * provides an abstraction, by removing the hard-coding of35 * portal resources in your actions. Instead, all forward targets36 * are defined in a centralized configuration file. By using the 37 * forward service, you use logical forward names in your java code.</P>38 *39 * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>40 * @version $Id: ForwardService.java,v 1.5 2004/02/23 03:51:09 jford Exp $41 */4243publicinterfaceForwardServiceextends Service
44 {
4546/*** The name of this service */47public String SERVICE_NAME = "ForwardService";
484950/***51 * Forward to a specific forward by name.52 * All parameters are resolved statically (via the forward definition)53 *54 * @param rundata The turbine rundata context for this request. 55 * @param forwardName Forward to this abstract forward name.56 * @return DynamicURI the full link to the referenced page57 */58public DynamicURI forward(RunData rundata, String forwardName);
596061/***62 * For the given portlet and given action, forward to the target63 * defined in the forward configuration for the portlet + action.64 * All parameters are resolved statically (via the forward definition) 65 *66 * @param portlet The name of the portlet for which we are forwarding.67 * @param target A logical target name. Portlets can have 1 or more targets.68 * @return DynamicURI the full link to the referenced page69 */70public DynamicURI forward(RunData rundata, String portlet, String target);
717273/***74 * Forward to a specific forward by name.75 * Parameters are resolved both statically and dynamically, with the 76 * dynamic parameter overriding the static parameter definitions.77 *78 * @param rundata The turbine rundata context for this request. 79 * @param forwardName Forward to this abstract forward name.80 * @param parameters The dynamic Validation Parameters used in creating validation forwards81 * @return DynamicURI the full link to the referenced page82 */83public DynamicURI forwardDynamic(RunData rundata, String forwardName, Map parameters);
848586/***87 * For the given portlet and given action, forward to the target88 * defined in the forward configuration for the portlet + action.89 * Parameters are resolved both statically and dynamically, with the 90 * dynamic parameter overriding the static parameter definitions. 91 *92 * @param portlet The name of the portlet for which we are forwarding.93 * @param target A logical target name. Portlets can have 1 or more targets.94 * @param parameters The dynamic Validation Parameters used in creating validation forwards 95 * @return DynamicURI the full link to the referenced page96 */97public DynamicURI forwardDynamic(RunData rundata,
98 String portlet,
99 String target,
100 Map parameters);
101102103/***104 * Get a collection of all forwards in the system.105 *106 * @return Collection of all forward definitions107 */108public Collection getForwards();
109110/***111 * Get a collection of all portlet forwards in the system.112 *113 * @return Collection of all portlet forward definitions114 */115public Collection getPortletForwards();
116117/***118 * Lookup a single forward definition by forward name119 *120 * @param forwardName The name of the Forward to find121 * @return Forward The found forward definition or null if not found122 */123publicForward getForward(String forwardName);
124125/***126 * Lookup a single portlet forward definition by portlet name + target name127 *128 * @param portlet The name of the portlet in the Portlet Forward to find129 * @param target The name of the target in the Portlet Forward to find 130 * @return Forward The found portlet forward definition or null if not found131 */132publicPortletForward getPortletForward(String portlet, String target);
133134 }