KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > webapp > action > core > contentLocale > CallCreateContentLocaleAction


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.contentLocale;
17
18 import com.blandware.atleap.webapp.action.core.BaseAction;
19 import com.blandware.atleap.webapp.util.core.LocaleUtil;
20 import com.blandware.atleap.webapp.util.core.WebappConstants;
21 import org.apache.struts.action.ActionForm;
22 import org.apache.struts.action.ActionForward;
23 import org.apache.struts.action.ActionMapping;
24
25 import javax.servlet.http.HttpServletRequest JavaDoc;
26 import javax.servlet.http.HttpServletResponse JavaDoc;
27 import java.util.List JavaDoc;
28
29 /**
30  * <p>Returns page with form to create new content locale
31  * </p>
32  * <p><a HREF="CallCreateContentLocaleAction.java.htm"><i>View Source</i></a></p>
33  * <p/>
34  *
35  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
36  * @version $Revision: 1.10 $ $Date: 2006/03/10 17:10:19 $
37  * @struts.action path="/core/contentLocale/callCreate"
38  * name="contentLocaleForm"
39  * validate="false"
40  * roles="core-contentLocale-create"
41  * @struts.action-forward name="createContentLocale"
42  * path=".core.contentLocale.create"
43  */

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

54     public ActionForward execute(ActionMapping mapping, ActionForm form,
55                                  HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
56
57         // get list of all existent locales
58
List JavaDoc contentLocales = LocaleUtil.getInstance(servlet.getServletContext()).getAvailableLocales();
59
60         request.getSession().setAttribute(WebappConstants.CONTENT_LOCALES_COLLECTION_KEY, contentLocales);
61
62         // save transaction token in request
63
saveToken(request);
64         return mapping.findForward("createContentLocale");
65     }
66 }
Popular Tags