01: /**
02: * LibreSource Community
03: * Copyright (C) 2004-2007 Artenum SARL / INRIA
04: * http://www.libresource.org - contact@artenum.com
05: *
06: * This software is not a free software; you can modify it under the
07: * LibreSource Enterprise user license but you can't redistribute it.
08: * See licenses details in LSE-user-license.txt
09: *
10: * Initial authors :
11: *
12: * Guillaume Bort / INRIA
13: * Francois Charoy / Universite Nancy 2
14: * Julien Forest / Artenum
15: * Claude Godart / Universite Henry Poincare
16: * Florent Jouille / INRIA
17: * Sebastien Jourdain / INRIA / Artenum
18: * Yves Lerumeur / Artenum
19: * Pascal Molli / Universite Henry Poincare
20: * Gerald Oster / INRIA
21: * Mariarosa Penzi / Artenum
22: * Gerard Sookahet / Artenum
23: * Raphael Tani / INRIA
24: *
25: * Contributors :
26: *
27: * Stephane Bagnier / Artenum
28: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29: */package org.libresource.web.controllers.form;
30:
31: import org.libresource.Libresource;
32:
33: import org.libresource.form.FormConstants;
34: import org.libresource.form.ejb.model.FormResourceValue;
35: import org.libresource.form.interfaces.LibresourceFormService;
36:
37: import org.libresource.web.Controller;
38:
39: import java.net.URI;
40:
41: import javax.servlet.http.HttpServletRequest;
42: import javax.servlet.http.HttpServletResponse;
43:
44: public class FormController implements Controller {
45: public Object process(URI uri, HttpServletRequest request,
46: HttpServletResponse response) throws Exception {
47: LibresourceFormService libresourceFormService = (LibresourceFormService) Libresource
48: .getService(FormConstants.SERVICE);
49: FormResourceValue form = libresourceFormService.getForm(uri);
50:
51: if ((request.getParameter("successSubmit") != null)
52: || (request.getAttribute("successSubmit") != null)) {
53: request.setAttribute("successSubmit", "ok");
54: }
55:
56: request.setAttribute("form", form);
57: request.setAttribute("description", form.getDescription());
58: request.setAttribute("table", "{tableForm:uri="
59: + form.getDestinationURI() + "}");
60:
61: return "/pages/modules/form/viewForm.jsp";
62: }
63: }
|