KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > dspace > app > webui > servlet > ControlledVocabularyServlet


1 /*
2  * ControlledVocabularyServlet.java
3  *
4  * Version: $Revision: 1.1 $
5  *
6  * Date: $Date: 2006/02/08 14:33:45 $
7  *
8  * Copyright (c) 2002, Hewlett-Packard Company and Massachusetts Institute of
9  * Technology. All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are met: -
13  * Redistributions of source code must retain the above copyright notice, this
14  * list of conditions and the following disclaimer. - Redistributions in binary
15  * form must reproduce the above copyright notice, this list of conditions and
16  * the following disclaimer in the documentation and/or other materials provided
17  * with the distribution. - Neither the name of the Hewlett-Packard Company nor
18  * the name of the Massachusetts Institute of Technology nor the names of their
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */

34 package org.dspace.app.webui.servlet;
35
36 import java.io.IOException JavaDoc;
37 import java.sql.SQLException JavaDoc;
38
39 import javax.servlet.ServletException JavaDoc;
40 import javax.servlet.http.HttpServletRequest JavaDoc;
41 import javax.servlet.http.HttpServletResponse JavaDoc;
42
43 import org.dspace.authorize.AuthorizeException;
44 import org.dspace.core.Context;
45
46 /**
47  * Servlet that handles the controlled vocabulary
48  *
49  * @author Miguel Ferreira
50  * @version $Revision: 1.1 $
51  */

52 public class ControlledVocabularyServlet extends DSpaceServlet
53 {
54     // private static Logger log =
55
// Logger.getLogger(ControlledVocabularyServlet.class);
56

57     protected void doDSGet(Context context, HttpServletRequest JavaDoc request,
58             HttpServletResponse JavaDoc response) throws ServletException JavaDoc, IOException JavaDoc,
59             SQLException JavaDoc, AuthorizeException
60     {
61
62         String JavaDoc ID = "";
63         String JavaDoc filter = "";
64         String JavaDoc callerUrl = request.getParameter("callerUrl");
65
66         if (request.getParameter("ID") != null)
67             ID = request.getParameter("ID");
68
69         if (request.getParameter("filter") != null)
70             filter = request.getParameter("filter");
71
72         request.getSession()
73                 .setAttribute("controlledvocabulary.filter", filter);
74         request.getSession().setAttribute("controlledvocabulary.ID", ID);
75         response.sendRedirect(callerUrl);
76     }
77
78     protected void doDSPost(Context context, HttpServletRequest JavaDoc request,
79             HttpServletResponse JavaDoc response) throws ServletException JavaDoc, IOException JavaDoc,
80             SQLException JavaDoc, AuthorizeException
81     {
82
83         doDSGet(context, request, response);
84     }
85
86 }
87
Popular Tags