Class CATMEController

java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.CATMEController

@RequestMapping("/api/catme") @RestController public class CATMEController extends ApiController
  • Field Details

  • Constructor Details

    • CATMEController

      public CATMEController()
  • Method Details

    • auditCatmeCSV

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @PostMapping(value="/audit", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<Object> auditCatmeCSV(@RequestParam Long courseId, @RequestParam("file") org.springframework.web.multipart.MultipartFile file) throws IOException
      Audit the roster for a course against a CATME TeamMaker CSV export, producing a list of students whose name and/or section should be updated in CATME, and a list of students who should be dropped from CATME because they are no longer enrolled (MANUAL or ROSTER status) in Frontiers, and enrolled students who need to be added to CATME.
      Parameters:
      courseId - the id of the course
      file - the uploaded CATME TeamMaker CSV file
      Returns:
      a CATMEAuditResult, or a 422 error if the file is not in the expected format
      Throws:
      IOException - if the file cannot be read
    • createTeamsFromCatmeCSV

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @PostMapping(value="/createteams", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<Object> createTeamsFromCatmeCSV(@RequestParam Long courseId, @RequestParam("file") org.springframework.web.multipart.MultipartFile file) throws IOException
      Audit a course's roster against an uploaded CATME TeamMaker CSV file, exactly as auditCatmeCSV(Long, MultipartFile); if the audit finds any issue, report it and stop. If the audit is clean, launch a job that creates the teams named in the file (in Frontiers only; nothing is pushed to GitHub) and adds each student to their team.
      Parameters:
      courseId - the id of the course
      file - the uploaded CATME TeamMaker CSV file
      Returns:
      if the audit found issues, the CATMEAuditResult; otherwise a message "Job Launched: N" where N is the id of the job; or a 422 error if the file is not in the expected format
      Throws:
      IOException - if the file cannot be read
    • getCourseEmailsFromCatme

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @PostMapping(value="/emails", consumes="text/plain", produces="text/plain") public String getCourseEmailsFromCatme(@RequestParam Long courseId, @RequestBody(required=false) String payload)