KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > cofax > module > CofaxToolsExtActivity


1 /*
2  * CofaxToolsExtActivity is part of the Cofax content management system library.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Please see http://www.cofax.org for contact information and other related informaion.
19  *
20  * $Header: /cvsroot/cofax/cofax/src/org/cofax/module/CofaxToolsExtActivity.java,v 1.3.2.1 2006/12/11 16:31:50 fxrobin Exp $
21  */

22
23 package org.cofax.module;
24
25 import org.cofax.*;
26 import org.cofax.cms.*;
27 import javax.servlet.http.*;
28 import java.util.*;
29
30 /**
31  * CofaxToolsActivity This module shows some informations about the activity on
32  * a publication
33  *
34  * @author - Badr Chentouf
35  *
36  */

37
38 public class CofaxToolsExtActivity extends CofaxToolsExtModule {
39
40     /**
41      * navigate throught the different modes for polls
42      *
43      */

44     public String JavaDoc navigate(DataStore db, CofaxPage page, HttpServletRequest req, HttpServletResponse res, HttpSession session) {
45         String JavaDoc mode = (String JavaDoc) req.getParameter("mode");
46         HashMap ht = new HashMap();
47         CofaxToolsUser user = (CofaxToolsUser) (session.getAttribute("user"));
48         String JavaDoc workingPubName = (String JavaDoc) user.workingPubName;
49         page.putGlossaryValue("system:message", getI18NMessage("message_welcome"));
50
51         page.putGlossaryValue("system:highLightTab", "admin");
52         page.putGlossaryValue("request:pubName", workingPubName);
53         CofaxToolsNavigation.includeResource(page, "" + CofaxToolsServlet.templatePath + "module/editActivity.jsp", req, res, session); // FX :
54
// added
55
// templatePath
56

57         return "";
58     }
59
60     public String JavaDoc formatString(String JavaDoc input) {
61         String JavaDoc retVal = CofaxToolsUtil.replace(input, "'", "''");
62         retVal = CofaxToolsUtil.replace(retVal, "\\", "\\\\");
63         return retVal;
64     }
65
66     public String JavaDoc getI18NMessage(String JavaDoc message) {
67         ResourceBundle messages;
68         String JavaDoc returnMessage = "";
69         Locale lcl = CofaxToolsServlet.lcl;
70         try {
71             messages = ResourceBundle.getBundle("org.cofax.module.activity", lcl);
72             returnMessage = messages.getString(message);
73         } catch (Exception JavaDoc e) {
74             CofaxToolsUtil.log("CofaxToolsExtActivity : getI18NMessage : error while reading " + message);
75         }
76         return (returnMessage);
77     }
78
79 }
80
Popular Tags