Class SubmissionController


  • @Controller
    public class SubmissionController
    extends java.lang.Object
    The controller that deals with the workspace submission pages
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String deleteFileGet​(ISubmission submission, long fileid, org.springframework.ui.Model model)
      Handles GET requests to the delete file page
      java.lang.String deleteFilePost​(WorkspaceWrapper workspaceWrapper, ISubmission submission, long fileid)
      Handles POST requests to the delete file page
      java.lang.String deleteGet()
      Handles GET requests to the delete submission page
      java.lang.String deletePost​(WorkspaceWrapper workspaceWrapper, ISubmission submission)
      Handles POST requests to the delete submission page
      java.lang.String fileGet​(ISubmission submission, long fileid, boolean isPrinting)
      Handles GET requests to the view file page
      java.lang.String viewGet()
      Handles GET requests to the view submission page
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SubmissionController

        public SubmissionController()
    • Method Detail

      • viewGet

        @GetMapping("/dashboard/workspaces/manage/{pathid}/submission/{submissionid}")
        public java.lang.String viewGet()
        Handles GET requests to the view submission page
        Returns:
        the path to the view template
      • fileGet

        @GetMapping(value="/dashboard/workspaces/manage/{pathid}/submission/{submissionid}/file/{fileid}/{filename}",
                    produces="text/plain")
        @ResponseBody
        public java.lang.String fileGet​(@ModelAttribute("submission")
                                        ISubmission submission,
                                        @PathVariable("fileid")
                                        long fileid,
                                        @ModelAttribute("isPrinting")
                                        boolean isPrinting)
                                 throws SourceFileNotFound
        Handles GET requests to the view file page
        Parameters:
        submission - the submission being managed
        fileid - the id of the file
        Returns:
        the plaintext contents of the file
        Throws:
        SourceFileNotFound - if the file was not found
      • deleteGet

        @GetMapping("/dashboard/workspaces/manage/{pathid}/submission/{submissionid}/delete")
        public java.lang.String deleteGet()
        Handles GET requests to the delete submission page
        Returns:
        the path to the delete template
      • deletePost

        @PostMapping("/dashboard/workspaces/manage/{pathid}/submission/{submissionid}/delete")
        public java.lang.String deletePost​(@ModelAttribute("workspace")
                                           WorkspaceWrapper workspaceWrapper,
                                           @ModelAttribute("submission")
                                           ISubmission submission)
        Handles POST requests to the delete submission page
        Parameters:
        workspaceWrapper - the workspace being managed
        submission - the submission being managed
        Returns:
        a direct to the workspace page
      • deleteFileGet

        @GetMapping("/dashboard/workspaces/manage/{pathid}/submission/{submissionid}/file/{fileid}/{filename}/delete")
        public java.lang.String deleteFileGet​(@ModelAttribute("submission")
                                              ISubmission submission,
                                              @PathVariable("fileid")
                                              long fileid,
                                              org.springframework.ui.Model model)
                                       throws SourceFileNotFound
        Handles GET requests to the delete file page
        Parameters:
        submission - the submission being managed
        fileid - the id of the file to delete
        model - holder for model attributes
        Returns:
        the path to the delete file template
        Throws:
        SourceFileNotFound - if the file doesn't exist
      • deleteFilePost

        @PostMapping("/dashboard/workspaces/manage/{pathid}/submission/{submissionid}/file/{fileid}/{filename}/delete")
        public java.lang.String deleteFilePost​(@ModelAttribute("workspace")
                                               WorkspaceWrapper workspaceWrapper,
                                               @ModelAttribute("submission")
                                               ISubmission submission,
                                               @PathVariable("fileid")
                                               long fileid)
                                        throws SourceFileNotFound
        Handles POST requests to the delete file page
        Parameters:
        workspaceWrapper - the workspace being managed
        submission - the submission being managed
        fileid - the id of the file to delete
        Returns:
        a direct to the workspace page
        Throws:
        SourceFileNotFound - if the file doesn't exist