Class CSVDownloadsController
java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.CSVDownloadsController
@RequestMapping("/api/csv")
@RestController
public class CSVDownloadsController
extends ApiController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> courseStaffCsv(Long courseId) org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> csvForQuarter(Long courseId) This method handles the EntityNotFoundException.org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> name2TeamCsv(Long courseId, int columns) org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> teamTableCsv(Long courseId, int columns)
-
Constructor Details
-
CSVDownloadsController
public CSVDownloadsController()
-
-
Method Details
-
csvForQuarter
@GetMapping(value="/rosterstudents", produces="text/csv") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> csvForQuarter(@RequestParam Long courseId) throws EntityNotFoundException, Exception, IOException -
catmeCsv
@GetMapping(value="/catme", produces="text/csv") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> catmeCsv(@RequestParam Long courseId) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
courseStaffCsv
@GetMapping(value="/coursestaff", produces="text/csv") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> courseStaffCsv(@RequestParam Long courseId) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
name2TeamCsv
@GetMapping(value="/name2team", produces="text/csv") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> name2TeamCsv(@RequestParam Long courseId, @RequestParam(defaultValue="4") int columns) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
teamTableCsv
@GetMapping(value="/teamtable", produces="text/csv") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> teamTableCsv(@RequestParam Long courseId, @RequestParam(defaultValue="4") int columns) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
handleEntityNotFoundException
Description copied from class:ApiControllerThis method handles the EntityNotFoundException. This maps to a 404/Not Found.- Overrides:
handleEntityNotFoundExceptionin classApiController- Parameters:
e- the exception- Returns:
- a map with the type and message of the exception
-