KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > webapp > action > core > contentFieldValue > ListContentFieldValuesAction


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
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 package com.blandware.atleap.webapp.action.core.contentFieldValue;
17
18 import com.blandware.atleap.webapp.action.core.BaseAction;
19 import com.blandware.atleap.webapp.util.core.WebappConstants;
20 import org.apache.struts.action.ActionForm;
21 import org.apache.struts.action.ActionForward;
22 import org.apache.struts.action.ActionMapping;
23
24 import javax.servlet.http.HttpServletRequest JavaDoc;
25 import javax.servlet.http.HttpServletResponse JavaDoc;
26
27 /**
28  * <p>Forward to the page with list of content field values
29  * </p>
30  * <p><a HREF="ListContentFieldValuesAction.java.htm"><i>View Source</i></a></p>
31  * <p/>
32  *
33  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
34  * @version $Revision: 1.11 $ $Date: 2006/03/10 17:10:18 $
35  * @struts.action path="/core/contentFieldValue/list"
36  * name="contentFieldValueForm"
37  * validate="false"
38  * roles="core-contentFieldValue-list"
39  * @struts.action-forward name="viewContentField"
40  * path="/core/contentField/view.do"
41  * redirect="true"
42  */

43 public final class ListContentFieldValuesAction extends BaseAction {
44     /**
45      * @param mapping The ActionMapping used to select this instance
46      * @param form The optional ActionForm bean for this request (if any)
47      * @param request The HTTP request we are proceeding
48      * @param response The HTTP response we are creating
49      * @return an ActionForward instance describing where and how
50      * control should be forwarded, or null if response
51      * has already been completed
52      */

53     public ActionForward execute(ActionMapping mapping, ActionForm form,
54                                  HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) throws Exception JavaDoc {
55
56         if ( request.getSession().getAttribute(WebappConstants.CONTENT_FIELD_ID_KEY) == null ) {
57             if ( log.isWarnEnabled() ) {
58                 log.warn("Missing content field ID. Returning to index...");
59             }
60             return mapping.findForward("admin");
61         }
62
63         // save transaction token in request
64
saveToken(request);
65         return mapping.findForward("viewContentField");
66     }
67 }
Popular Tags