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.interfaces.LibresourceFormService;
35:
36: import org.libresource.web.Controller;
37:
38: import java.net.URI;
39:
40: import javax.servlet.http.HttpServletRequest;
41: import javax.servlet.http.HttpServletResponse;
42:
43: public class CreateFormController implements Controller {
44: public Object process(URI uri, HttpServletRequest request,
45: HttpServletResponse response) throws Exception {
46: LibresourceFormService libresourceFormService = (LibresourceFormService) Libresource
47: .getService(FormConstants.SERVICE);
48: String shortName = uri.getPath();
49: shortName = shortName.substring(shortName.lastIndexOf("/") + 1);
50: shortName = shortName.substring(0, 1).toUpperCase().concat(
51: shortName.substring(1));
52: libresourceFormService.createForm(uri, shortName);
53:
54: return uri;
55: }
56: }
|