Rename and merge controllers
[proteocache.git] / server / compbio / controllers / DocumentationController.java
1 package compbio.controllers;
2
3 import java.security.Principal;
4 import java.util.Map;
5
6 import org.springframework.stereotype.Controller;
7 import org.springframework.web.bind.annotation.RequestMapping;
8 import org.springframework.web.bind.annotation.RequestMethod;
9
10 //import org.springframework.web.bind.annotation.RequestParam;
11
12 /**
13  * @author Alexander Sherstnev
14  * @author Natasha Sherstneva
15  */
16 @Controller
17 public class DocumentationController {
18
19         @RequestMapping(value = "/help/overview", method = RequestMethod.GET)
20         public String formOverviewPage(Map<String, Object> model, Principal principal) {
21                 model.put("username", getPrincipleName(principal));
22                 return "help/Overview";
23         }
24
25         @RequestMapping(value = "/help/howto", method = RequestMethod.GET)
26         public String formHowtoPage(Map<String, Object> model, Principal principal) {
27                 model.put("username", getPrincipleName(principal));
28                 return "support/Notimplemented";
29         }
30
31         @RequestMapping(value = "/help/doc", method = RequestMethod.GET)
32         public String formDocPage(Map<String, Object> model, Principal principal) {
33                 model.put("username", getPrincipleName(principal));
34                 return "support/Notimplemented";
35         }
36
37         @RequestMapping(value = "/help/javadoc", method = RequestMethod.GET)
38         public String formJavadoc(Map<String, Object> model, Principal principal) {
39                 model.put("username", getPrincipleName(principal));
40                 return "support/Notimplemented";
41         }
42
43         private String getPrincipleName(Principal principal) {
44                 if (null != principal.getName()) {
45                         return principal.getName();
46                 }
47                 return "unknown";
48         }
49 }