View Javadoc

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 at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * 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 and
14   * limitations under the License.
15   */
16  
17  package org.apache.jetspeed.services.forward;
18  
19  import java.util.Collection;
20  import java.util.Map;
21  
22  import org.apache.turbine.services.Service;
23  import org.apache.turbine.util.RunData;
24  import org.apache.turbine.util.DynamicURI;
25  
26  import org.apache.jetspeed.services.forward.configuration.Forward;
27  import org.apache.jetspeed.services.forward.configuration.PortletForward;
28  
29  
30  /***
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 service
34   *    provides an abstraction, by removing the hard-coding of
35   *    portal resources in your actions. Instead, all forward targets
36   *    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   */
42  
43  public interface ForwardService extends Service
44  {
45  
46      /*** The name of this service */
47      public String SERVICE_NAME = "ForwardService";
48  
49  
50      /***
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 page
57       */
58      public DynamicURI forward(RunData rundata, String forwardName);
59  
60  
61      /***
62       *  For the given portlet and given action, forward to the target
63       *  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 page
69       */
70      public DynamicURI forward(RunData rundata, String portlet, String target);
71  
72  
73      /***
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 forwards
81       * @return DynamicURI the full link to the referenced page
82       */
83      public DynamicURI forwardDynamic(RunData rundata, String forwardName, Map parameters);
84  
85  
86      /***
87       *  For the given portlet and given action, forward to the target
88       *  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 page
96       */
97      public DynamicURI forwardDynamic(RunData rundata, 
98                                   String portlet, 
99                                   String target,
100                                  Map parameters);
101 
102     
103     /***
104      * Get a collection of all forwards in the system.
105      *
106      * @return Collection of all forward definitions
107      */
108     public Collection getForwards();
109 
110     /***
111      * Get a collection of all portlet forwards in the system.
112      *
113      * @return Collection of all portlet forward definitions
114      */
115     public Collection getPortletForwards();
116 
117     /***
118      * Lookup a single forward definition by forward name
119      *
120      * @param  forwardName The name of the Forward to find
121      * @return Forward The found forward definition or null if not found
122      */
123     public Forward getForward(String forwardName);
124 
125     /***
126      * Lookup a single portlet forward definition by portlet name + target name
127      *
128      * @param  portlet The name of the portlet in the Portlet Forward to find
129      * @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 found
131      */
132     public PortletForward getPortletForward(String portlet, String target);
133 
134 }