Package mops.presentation
Class GroupController
- java.lang.Object
-
- mops.presentation.GroupController
-
@Controller @RequestMapping("material1/group") public class GroupController extends java.lang.Object
Controller Class for all requests on 'material1/group'.
-
-
Constructor Summary
Constructors Constructor Description GroupController(DirectoryService directoryService)
-
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.
-
-
-
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 attributestoken
- keycloak auth tokengroupId
- 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 tokengroupId
- 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 attributestoken
- keycloak auth tokengroupId
- the id of the group to be searchedqueryForm
- wrapper for a search query- Returns:
- the route to the template 'directory'
-
-