Class GroupController


  • @Controller
    @RequestMapping("material1/group")
    public class GroupController
    extends java.lang.Object
    Controller Class for all requests on 'material1/group'.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getRootDirectory​(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, org.keycloak.adapters.springsecurity.token.KeycloakAuthenticationToken token, long groupId)
      Gets the root directory.
      GroupRootDirWrapper getRootDirectoryUrl​(org.keycloak.adapters.springsecurity.token.KeycloakAuthenticationToken token, long groupId)
      Gets the url of the root directory.
      java.lang.String searchFilesInGroup​(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, org.keycloak.adapters.springsecurity.token.KeycloakAuthenticationToken token, long groupId, FileQueryForm queryForm)
      Searches are group for matching files.
      • Methods inherited from class java.lang.Object

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

      • GroupController

        public GroupController​(DirectoryService directoryService)
    • Method Detail

      • getRootDirectory

        @GetMapping("/{groupId}")
        public java.lang.String getRootDirectory​(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes,
                                                 org.keycloak.adapters.springsecurity.token.KeycloakAuthenticationToken token,
                                                 @PathVariable("groupId")
                                                 long groupId)
        Gets the root directory.
        Parameters:
        redirectAttributes - redirect attributes
        token - keycloak auth token
        groupId - the id of the group which files should be fetched
        Returns:
        redirect to root dir
      • getRootDirectoryUrl

        @GetMapping(value="/{groupId}/url",
                    produces="application/json")
        @ResponseBody
        @Secured("ROLE_api_user")
        public GroupRootDirWrapper getRootDirectoryUrl​(org.keycloak.adapters.springsecurity.token.KeycloakAuthenticationToken token,
                                                       @PathVariable("groupId")
                                                       long groupId)
        Gets the url of the root directory.
        Parameters:
        token - keycloak auth token
        groupId - the id of the group of the requested url
        Returns:
        a wrapper for the url string
      • searchFilesInGroup

        @PostMapping("/{groupId}/search")
        public java.lang.String searchFilesInGroup​(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes,
                                                   org.keycloak.adapters.springsecurity.token.KeycloakAuthenticationToken token,
                                                   @PathVariable("groupId")
                                                   long groupId,
                                                   @ModelAttribute("fileQueryForm")
                                                   FileQueryForm queryForm)
        Searches are group for matching files.
        Parameters:
        redirectAttributes - redirect attributes
        token - keycloak auth token
        groupId - the id of the group to be searched
        queryForm - wrapper for a search query
        Returns:
        the route to the template 'directory'