@Controller public class TableController extends Object implements org.springframework.web.servlet.HandlerExceptionResolver
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.log4j.Logger |
logger |
| Constructor and Description |
|---|
TableController() |
| Modifier and Type | Method and Description |
|---|---|
String |
createTable(String userName,
org.springframework.ui.Model model)
Accepts a GET request to create a new Table object.
|
org.springframework.web.servlet.ModelAndView |
createTable(Table table,
org.springframework.validation.BindingResult result,
org.springframework.ui.Model model)
Accepts a POST request to create a new Table object and persist it.
|
void |
downloadTable(String checksum,
javax.servlet.http.HttpServletResponse response)
Accepts a GET request to download a specific Table.
|
String |
getAuthName()
Returns the authenticated user name.
|
List<String> |
getTableTypes()
Grabs the tableTypeString and returns as a List.
|
org.springframework.web.servlet.ModelAndView |
hideTable(Table table,
org.springframework.validation.BindingResult result,
org.springframework.ui.Model model)
Accepts a POST request to hide a new Table object.
|
void |
initBinder(org.springframework.web.bind.WebDataBinder binder) |
boolean |
isAuthorized(String userName)
Checks the authenticated user's credentials and roles to determine if the user
has permission to perform the required method action.
|
String |
listAllTables(org.springframework.ui.Model model)
Accepts a GET request for a List of all Table objects.
|
org.springframework.web.servlet.ModelAndView |
resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception exception)
This method gracefully handles any uncaught exception that are fatal
in nature and unresolvable by the user.
|
void |
setAuthName(String authName)
Sets the authenticated user name.
|
String |
updateTable(String checksum,
org.springframework.ui.Model model)
Accepts a GET request to update an existing Table object.
|
org.springframework.web.servlet.ModelAndView |
updateTable(Table table,
org.springframework.validation.BindingResult result,
org.springframework.ui.Model model)
Accepts a POST request to update an existing Table object.
|
String |
viewTable(String checksum,
org.springframework.ui.Model model)
Accepts a GET request for a specific Table object.
|
void |
viewTableFile(String checksum,
javax.servlet.http.HttpServletResponse response)
Accepts a GET request to view a specific Table.
|
@InitBinder(value="table") public void initBinder(org.springframework.web.bind.WebDataBinder binder)
@RequestMapping(value="/table",
method=GET)
public String listAllTables(org.springframework.ui.Model model)
model - The Model used by the View.@RequestMapping(value="/table/{checksum}",
method=GET)
public String viewTable(@PathVariable
String checksum,
org.springframework.ui.Model model)
checksum - The 'checksum' as provided by @PathVariable.model - The Model used by the View.@RequestMapping(value="/table/view/{checksum}",
method=GET)
public void viewTableFile(@PathVariable
String checksum,
javax.servlet.http.HttpServletResponse response)
checksum - The 'checksum' as provided by @PathVariable.response - The HttpServletResponse response.@RequestMapping(value="/table/download/{checksum}",
method=GET)
public void downloadTable(@PathVariable
String checksum,
javax.servlet.http.HttpServletResponse response)
checksum - The 'checksum' as provided by @PathVariable.response - The HttpServletResponse response.@PreAuthorize(value="hasRole(\'ROLE_ADMIN\') or #userName == authentication.name")
@RequestMapping(value="/table/create/{userName}",
method=GET)
public String createTable(@PathVariable
String userName,
org.springframework.ui.Model model)
userName - The 'userName' as provided by @PathVariable.model - The Model used by the View.@RequestMapping(value="/table/create",
method=POST)
public org.springframework.web.servlet.ModelAndView createTable(Table table,
org.springframework.validation.BindingResult result,
org.springframework.ui.Model model)
throws IOException,
org.springframework.security.access.AccessDeniedException
table - The Table to persist.result - The BindingResult for error handling.model - The Model used by the View.IOException - If an IO error occurs when writing the table to the file system.org.springframework.security.access.AccessDeniedException@RequestMapping(value="/table/update/{checksum}",
method=GET)
public String updateTable(@PathVariable
String checksum,
org.springframework.ui.Model model)
throws org.springframework.security.access.AccessDeniedException
checksum - The checksum as provided by @PathVariable.model - The Model used by the View.org.springframework.security.access.AccessDeniedException@RequestMapping(value="/table/update",
method=POST)
public org.springframework.web.servlet.ModelAndView updateTable(Table table,
org.springframework.validation.BindingResult result,
org.springframework.ui.Model model)
throws org.springframework.security.access.AccessDeniedException
table - The Table to update.result - The BindingResult for error handling.model - The Model used by the View.org.springframework.security.access.AccessDeniedException@RequestMapping(value="/table/hide",
method=POST)
public org.springframework.web.servlet.ModelAndView hideTable(Table table,
org.springframework.validation.BindingResult result,
org.springframework.ui.Model model)
throws org.springframework.security.access.AccessDeniedException
table - The Table to hide.result - The BindingResult for error handling.model - The Model used by the View.org.springframework.security.access.AccessDeniedExceptionpublic org.springframework.web.servlet.ModelAndView resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception exception)
resolveException in interface org.springframework.web.servlet.HandlerExceptionResolverrequest - The current HttpServletRequest request.response - The current HttpServletRequest response.handler - The executed handler, or null if none chosen at the time of the exception.exception - The exception that got thrown during handler execution.public boolean isAuthorized(String userName)
userName - The user name we will evaluate the logged in user against.public String getAuthName()
public void setAuthName(String authName)
authName - The authenticated user name.Copyright © 1999–2014 UCAR/Unidata. All rights reserved.