View Javadoc

1   /*
2    * $Id: PortletActionConstants.java 651946 2008-04-27 13:41:38Z apetrelli $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  package org.apache.struts2.portlet;
23  
24  import org.apache.struts2.portlet.dispatcher.DispatcherServlet;
25  
26  /***
27   * Interface defining some constants used in the Struts portlet implementation
28   *
29   */
30  public interface PortletActionConstants {
31      /***
32       * Default action name to use when no default action has been configured in the portlet
33       * init parameters.
34       */
35      String DEFAULT_ACTION_NAME = "default";
36  
37      /***
38       * Action name parameter name
39       */
40      String ACTION_PARAM = "struts.portlet.action";
41  
42      /***
43       * Key for parameter holding the last executed portlet mode.
44       */
45      String MODE_PARAM = "struts.portlet.mode";
46  
47      /***
48       * Key used for looking up and storing the portlet phase
49       */
50      String PHASE = "struts.portlet.phase";
51  
52      /***
53       * Constant used for the render phase (
54       * {@link javax.portlet.Portlet#render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)})
55       */
56      Integer RENDER_PHASE = new Integer(1);
57  
58      /***
59       * Constant used for the event phase (
60       * {@link javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)})
61       */
62      Integer EVENT_PHASE = new Integer(2);
63  
64      /***
65       * Key used for looking up and storing the
66       * {@link javax.portlet.PortletRequest}
67       */
68      String REQUEST = "struts.portlet.request";
69  
70      /***
71       * Key used for looking up and storing the
72       * {@link javax.portlet.PortletResponse}
73       */
74      String RESPONSE = "struts.portlet.response";
75  
76      /***
77       * Key used for looking up and storing the action that was invoked in the event phase.
78       */
79      String EVENT_ACTION = "struts.portlet.eventAction";
80  
81      /***
82       * Key used for looking up and storing the
83       * {@link javax.portlet.PortletConfig}
84       */
85      String PORTLET_CONFIG = "struts.portlet.config";
86  
87      /***
88       * Name of the action used as error handler
89       */
90      String ERROR_ACTION = "errorHandler";
91  
92      /***
93       * Key for the portlet namespace stored in the
94       * {@link org.apache.struts2.portlet.context.PortletActionContext}.
95       */
96      String PORTLET_NAMESPACE = "struts.portlet.portletNamespace";
97  
98      /***
99       * Key for the mode-to-namespace map stored in the
100      * {@link org.apache.struts2.portlet.context.PortletActionContext}.
101      */
102     String MODE_NAMESPACE_MAP = "struts.portlet.modeNamespaceMap";
103 
104     /***
105      * Key for the default action name for the portlet, stored in the
106      * {@link org.apache.struts2.portlet.context.PortletActionContext}.
107      */
108     String DEFAULT_ACTION_FOR_MODE = "struts.portlet.defaultActionForMode";
109     
110     /***
111      * Key for request attribute indicating if the action has been reset. 
112      */
113     String ACTION_RESET = "struts.portlet.actionReset";
114     
115     /***
116      * Key for session attribute indicating the location of the render direct action.
117      */
118     String RENDER_DIRECT_LOCATION = "struts.portlet.renderDirectLocation";
119     
120     /***
121      * Key for the dispatch instruction for the {@link DispatcherServlet}
122      */
123 	String DISPATCH_TO = "struts.portlet.dispatchTo";
124 	
125 	/***
126 	 * Session key where the value stack from the event phase is stored.
127 	 */
128 	String STACK_FROM_EVENT_PHASE = "struts.portlet.valueStackFromEventPhase";
129 
130 	/***
131 	 * Default name of dispatcher servlet in web.xml
132 	 */
133 	String DEFAULT_DISPATCHER_SERVLET_NAME = "Struts2PortletDispatcherServlet";
134 }