@Controller @RequestMapping(value="/policies") public class PoliciesController extends Object
| Constructor and Description |
|---|
PoliciesController() |
| Modifier and Type | Method and Description |
|---|---|
String |
addPolicy(String id,
String policyName,
String policyContent,
String policyLexicon)
Add Policy Method
|
String |
checkLexiconFile(String requestedWith,
javax.servlet.http.HttpServletResponse response,
Object command,
String lexicon,
org.springframework.web.multipart.MultipartHttpServletRequest request)
Check Lexicon File Method
|
String |
checkPolicyContent(String requestedWith,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request,
Object command) |
String |
handleIOException(IOException ex,
javax.servlet.http.HttpServletRequest request)
Handle exceptions as gracefully as possible
|
org.springframework.web.servlet.ModelAndView |
newPolicyForm(String requestedWith,
javax.servlet.http.HttpSession session,
PolicyForm policyForm,
org.springframework.ui.Model model)
New Policy Form Method
|
org.springframework.web.servlet.ModelAndView |
removePolicies(String requestedWith,
javax.servlet.http.HttpSession session,
PolicyForm policyForm,
org.springframework.ui.Model model)
Remove Policies Method
|
void |
setCertPolicyService(org.nhind.config.rest.CertPolicyService policyService) |
String |
updatePolicy(String id,
String policyContent,
String policyLexicon,
String policyName)
Update Policy Method
|
org.springframework.web.servlet.ModelAndView |
updatePolicyForm(String requestedWith,
String policyName,
javax.servlet.http.HttpSession session,
PolicyForm policyForm,
org.springframework.ui.Model model)
Update Policy Form Method
|
@Autowired public void setCertPolicyService(org.nhind.config.rest.CertPolicyService policyService)
@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
@RequestMapping(value="/addPolicy",
method=POST)
@ResponseBody
public String addPolicy(@RequestParam(value="id")
String id,
@RequestParam(value="policyName")
String policyName,
@RequestParam(value="policyContent")
String policyContent,
@RequestParam(value="policyLexicon")
String policyLexicon)
@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
@RequestMapping(value="/removePolicies",
method=POST)
public org.springframework.web.servlet.ModelAndView removePolicies(@RequestHeader(value="X-Requested-With",required=false)
String requestedWith,
javax.servlet.http.HttpSession session,
@ModelAttribute
PolicyForm policyForm,
org.springframework.ui.Model model)
@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
@RequestMapping(value="/updatePolicyForm",
method=GET)
public org.springframework.web.servlet.ModelAndView updatePolicyForm(@RequestHeader(value="X-Requested-With",required=false)
String requestedWith,
@RequestParam(value="policyName")
String policyName,
javax.servlet.http.HttpSession session,
@ModelAttribute
PolicyForm policyForm,
org.springframework.ui.Model model)
@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
@RequestMapping(value="/updatePolicy",
method=POST)
@ResponseBody
public String updatePolicy(@RequestParam(value="id")
String id,
@RequestParam(value="policyContent")
String policyContent,
@RequestParam(value="policyLexicon")
String policyLexicon,
@RequestParam(value="policyName")
String policyName)
@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
@RequestMapping(value="/checkLexiconFile",
method={GET,POST})
@ResponseBody
public String checkLexiconFile(@RequestHeader(value="X-Requested-With",required=false)
String requestedWith,
javax.servlet.http.HttpServletResponse response,
Object command,
@RequestHeader(value="lexicon",required=false)
String lexicon,
org.springframework.web.multipart.MultipartHttpServletRequest request)
throws FileUploadException,
IOException,
Exception
FileUploadExceptionIOExceptionException@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
@RequestMapping(value="/checkPolicyContent",
method={GET,POST})
@ResponseBody
public String checkPolicyContent(@RequestHeader(value="X-Requested-With",required=false)
String requestedWith,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request,
Object command)
throws Exception
Exception@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
@RequestMapping(value="/newPolicyForm",
method=GET)
public org.springframework.web.servlet.ModelAndView newPolicyForm(@RequestHeader(value="X-Requested-With",required=false)
String requestedWith,
javax.servlet.http.HttpSession session,
@ModelAttribute
PolicyForm policyForm,
org.springframework.ui.Model model)
@ExceptionHandler(value=java.io.IOException.class) public String handleIOException(IOException ex, javax.servlet.http.HttpServletRequest request)
ex - request - Copyright © 2021. All rights reserved.