~sword-devel/jsword/trunk

« back to all changes in this revision

Viewing changes to jsword/java/historic/org/crosswire/bible/view/servlet/Config2.java

  • Committer: joe
  • Date: 2002-10-08 21:36:18 UTC
  • Revision ID: svn-v4:a88caf3b-7e0a-0410-8d0d-cecb45342206:trunk:80
big config and comment update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
package com.eireneh.bible.view.servlet;
3
 
 
4
 
import java.util.*;
5
 
 
6
 
import javax.servlet.http.*;
7
 
 
8
 
import org.w3c.dom.*;
9
 
 
10
 
import com.eireneh.config.*;
11
 
import com.eireneh.config.servlet.*;
12
 
 
13
 
import com.eireneh.bible.util.*;
14
 
import com.eireneh.bible.control.*;
15
 
 
16
 
/**
17
 
* The simplest possible servlet.
18
 
*
19
 
* <table border='1' cellPadding='3' cellSpacing='0' width="100%">
20
 
* <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
21
 
* Distribution Licence:<br />
22
 
* Project B is free software; you can redistribute it
23
 
* and/or modify it under the terms of the GNU General Public License,
24
 
* version 2 as published by the Free Software Foundation.<br />
25
 
* This program is distributed in the hope that it will be useful,
26
 
* but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28
 
* General Public License for more details.<br />
29
 
* The License is available on the internet
30
 
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
31
 
* <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
32
 
* MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
33
 
* The copyright to this program is held by it's authors.
34
 
* </font></td></tr></table>
35
 
* @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
36
 
* @see docs.Licence
37
 
* @author Joe Walker
38
 
*/
39
 
public class Config2 extends BaseServlet
40
 
{
41
 
    /**
42
 
    * Enter elements into an XML Document that can be transformed into
43
 
    * an HTML document using XSL
44
 
    * @param state data about the current request
45
 
    * @param node The place to start adding data
46
 
    * @param request A description of the request
47
 
    */
48
 
    public void generateData(State state, Node node, HttpServletRequest request) throws Exception
49
 
    {
50
 
        Config config = state.getConfig();
51
 
 
52
 
        // Where do we want to return to
53
 
        String last_path = null;
54
 
        Enumeration en = config.getNames();
55
 
        while (en.hasMoreElements())
56
 
        {
57
 
            String key = (String) en.nextElement();
58
 
            String value = request.getParameter(key);
59
 
            if (value == null) value = "";
60
 
            config.setLocal(key, value);
61
 
            config.localToApplication(false);
62
 
        }
63
 
        state.saveConfig();
64
 
 
65
 
        String caller = request.getParameter("source");
66
 
        if (caller == null) caller = "sweb";
67
 
 
68
 
        ConfigDocument confdoc = new ConfigDocument(config);
69
 
        confdoc.generateReportData(node, caller);
70
 
    }
71
 
}