org/sonews/web/SonewsGroupServlet.java
author chris <chris@marvin>
Fri Jun 26 16:48:50 2009 +0200 (2009-06-26)
changeset 1 6fceb66e1ad7
permissions -rw-r--r--
Hooray... sonews/0.5.0 final

HG: Enter commit message. Lines beginning with 'HG:' are removed.
HG: Remove all lines to abort the collapse operation.
     1 /*
     2  *   SONEWS News Server
     3  *   see AUTHORS for the list of contributors
     4  *
     5  *   This program is free software: you can redistribute it and/or modify
     6  *   it under the terms of the GNU General Public License as published by
     7  *   the Free Software Foundation, either version 3 of the License, or
     8  *   (at your option) any later version.
     9  *
    10  *   This program is distributed in the hope that it will be useful,
    11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13  *   GNU General Public License for more details.
    14  *
    15  *   You should have received a copy of the GNU General Public License
    16  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
    17  */
    18 
    19 package org.sonews.web;
    20 
    21 import java.io.IOException;
    22 import javax.servlet.http.HttpServletRequest;
    23 import javax.servlet.http.HttpServletResponse;
    24 import org.sonews.util.StringTemplate;
    25 
    26 /**
    27  * Views the group settings and allows editing.
    28  * @author Christian Lins
    29  * @since sonews/0.5.0
    30  */
    31 public class SonewsGroupServlet extends AbstractSonewsServlet
    32 {
    33 
    34   @Override
    35   public void doGet(HttpServletRequest req, HttpServletResponse resp)
    36     throws IOException
    37   {
    38     synchronized(this)
    39     {
    40       connectToNewsserver();
    41       String name   = req.getParameter("name");
    42       String action = req.getParameter("action");
    43 
    44       if("set_flags".equals(action))
    45       {
    46 
    47       }
    48       else if("set_mladdress".equals(action))
    49       {
    50         
    51       }
    52 
    53       StringTemplate tmpl = getTemplate("SonewsGroupServlet.tmpl");
    54       tmpl.set("SERVERNAME", hello.split(" ")[2]);
    55       tmpl.set("TITLE", "Group " + name);
    56       tmpl.set("GROUPNAME", name);
    57 
    58       resp.getWriter().println(tmpl.toString());
    59       resp.getWriter().flush();
    60       resp.setStatus(HttpServletResponse.SC_OK);
    61 
    62       disconnectFromNewsserver();
    63     }
    64   }
    65   
    66 }