-
- All Implemented Interfaces:
-
edu.wgu.osmt.HasAllPaginated
@Controller()@Transactional() public final class CollectionController implements HasAllPaginated<CollectionDoc>
-
-
Field Summary
Fields Modifier and Type Field Description private final CollectionEsRepoelasticRepositoryprivate final StringallPaginatedPathprivate final CollectionSortEnum.CompanionsortOrderCompanionprivate final CollectionRepositorycollectionRepositoryprivate final RichSkillRepositoryrichSkillRepositoryprivate final TaskMessageServicetaskMessageServiceprivate final AuditLogRepositoryauditLogRepositoryprivate final CollectionEsRepocollectionEsRepoprivate final AppConfigappConfigprivate final OAuthHelperoAuthHelper
-
Constructor Summary
Constructors Constructor Description CollectionController(CollectionRepository collectionRepository, RichSkillRepository richSkillRepository, TaskMessageService taskMessageService, AuditLogRepository auditLogRepository, CollectionEsRepo collectionEsRepo, AppConfig appConfig, OAuthHelper oAuthHelper)
-
Method Summary
Modifier and Type Method Description CollectionEsRepogetElasticRepository()StringgetAllPaginatedPath()override in @Controllerimplementors with the path that [allPaginated] handlesCollectionSortEnum.CompaniongetSortOrderCompanion()final CollectionRepositorygetCollectionRepository()final RichSkillRepositorygetRichSkillRepository()final TaskMessageServicegetTaskMessageService()final AuditLogRepositorygetAuditLogRepository()final CollectionEsRepogetCollectionEsRepo()final AppConfiggetAppConfig()final OAuthHelpergetOAuthHelper()HttpEntity<List<CollectionDoc>>allPaginated(UriComponentsBuilder uriComponentsBuilder, Integer size, Integer from, Array<String> status, String sort, @AuthenticationPrincipal() Jwt user)final ApiCollectionbyUUID(@PathVariable() String uuid)final ApiCollectionbyUUIDV2(@PathVariable() String uuid)final StringbyUUIDHtmlView(@PathVariable() String uuid)final List<ApiCollection>createCollections(@RequestBody() List<ApiCollectionUpdate> apiCollectionUpdates, @AuthenticationPrincipal() Jwt user)final List<ApiCollection>createCollectionsV2(@RequestBody() List<ApiCollectionUpdate> apiCollectionUpdates, @AuthenticationPrincipal() Jwt user)final ApiCollectionupdateCollection(@PathVariable() String uuid, @RequestBody() ApiCollectionUpdate apiUpdate, @AuthenticationPrincipal() Jwt user)final ApiCollectionupdateCollectionV2(@PathVariable() String uuid, @RequestBody() ApiCollectionUpdate apiUpdate, @AuthenticationPrincipal() Jwt user)final HttpEntity<TaskResult>updateSkills(@PathVariable(name = "apiVersion", required = false) String apiVersion, @PathVariable() String uuid, @RequestBody() ApiSkillListUpdate skillListUpdate, @RequestParam(required = false, defaultValue = "draft,published") List<String> status, @AuthenticationPrincipal() Jwt user)final HttpEntity<TaskResult>publishCollections(@RequestBody() ApiSearch search, @RequestParam(required = false, defaultValue = "Published") String newStatus, @RequestParam(required = false, defaultValue = "draft,published") List<String> filterByStatus, @AuthenticationPrincipal() Jwt user)final HttpEntity<TaskResult>publishCollectionsV2(@RequestBody() ApiSearchV2 search, @RequestParam(required = false, defaultValue = "Published") String newStatus, @RequestParam(required = false, defaultValue = "draft,published") List<String> filterByStatus, @AuthenticationPrincipal() Jwt user)final HttpEntity<TaskResult>getSkillsForCollectionCsv(@PathVariable(name = "apiVersion", required = false) String apiVersion, @PathVariable() String uuid)final HttpEntity<TaskResult>getSkillsForCollectionXlsx(@PathVariable() String uuid)final HttpEntity<TaskResult>removeCollection(@PathVariable() String uuid)final HttpEntity<TaskResult>removeCollectionV2(@PathVariable() String uuid)final HttpEntity<List<AuditLog>>collectionAuditLog(@PathVariable() String uuid)final ApiCollectiongetOrCreateWorkspace(@AuthenticationPrincipal() Jwt user)final ApiCollectiongetOrCreateWorkspaceV2(@AuthenticationPrincipal() Jwt user)-
-
Constructor Detail
-
CollectionController
CollectionController(CollectionRepository collectionRepository, RichSkillRepository richSkillRepository, TaskMessageService taskMessageService, AuditLogRepository auditLogRepository, CollectionEsRepo collectionEsRepo, AppConfig appConfig, OAuthHelper oAuthHelper)
-
-
Method Detail
-
getElasticRepository
CollectionEsRepo getElasticRepository()
-
getAllPaginatedPath
String getAllPaginatedPath()
override in
@Controllerimplementors with the path that [allPaginated] handles
-
getSortOrderCompanion
CollectionSortEnum.Companion getSortOrderCompanion()
-
getCollectionRepository
final CollectionRepository getCollectionRepository()
-
getRichSkillRepository
final RichSkillRepository getRichSkillRepository()
-
getTaskMessageService
final TaskMessageService getTaskMessageService()
-
getAuditLogRepository
final AuditLogRepository getAuditLogRepository()
-
getCollectionEsRepo
final CollectionEsRepo getCollectionEsRepo()
-
getAppConfig
final AppConfig getAppConfig()
-
getOAuthHelper
final OAuthHelper getOAuthHelper()
-
allPaginated
@GetMapping(path = {"/api/v2/collections", "/api/v3/collections", "/api/collections"}, produces = {"application/json"})@ResponseBody() HttpEntity<List<CollectionDoc>> allPaginated(UriComponentsBuilder uriComponentsBuilder, Integer size, Integer from, Array<String> status, String sort, @AuthenticationPrincipal() Jwt user)
-
byUUID
@GetMapping(value = {"/api/v3/collections/{uuid}"}, produces = {"application/json"})@ResponseBody() final ApiCollection byUUID(@PathVariable() String uuid)
-
byUUIDV2
@GetMapping(path = {"/api/v2/collections/{uuid}", "/api/collections/{uuid}"}, produces = {"application/json"})@ResponseBody() final ApiCollection byUUIDV2(@PathVariable() String uuid)
-
byUUIDHtmlView
@RequestMapping(path = {"/api/v2/collections/{uuid}", "/api/v3/collections/{uuid}", "/api/collections/{uuid}"}, produces = {"text/html"}) final String byUUIDHtmlView(@PathVariable() String uuid)
-
createCollections
@PostMapping(value = {"/api/v3/collections"}, produces = {"application/json"})@ResponseBody() final List<ApiCollection> createCollections(@RequestBody() List<ApiCollectionUpdate> apiCollectionUpdates, @AuthenticationPrincipal() Jwt user)
-
createCollectionsV2
@PostMapping(path = {"/api/v2/collections", "/api/collections"}, produces = {"application/json"})@ResponseBody() final List<ApiCollection> createCollectionsV2(@RequestBody() List<ApiCollectionUpdate> apiCollectionUpdates, @AuthenticationPrincipal() Jwt user)
-
updateCollection
@PostMapping(value = {"/api/v3/collections/{uuid}/update"}, produces = {"application/json"})@ResponseBody() final ApiCollection updateCollection(@PathVariable() String uuid, @RequestBody() ApiCollectionUpdate apiUpdate, @AuthenticationPrincipal() Jwt user)
-
updateCollectionV2
@PostMapping(path = {"/api/v2/collections/{uuid}/update", "/api/collections/{uuid}/update"}, produces = {"application/json"})@ResponseBody() final ApiCollection updateCollectionV2(@PathVariable() String uuid, @RequestBody() ApiCollectionUpdate apiUpdate, @AuthenticationPrincipal() Jwt user)
-
updateSkills
@PostMapping(path = {"/api/{apiVersion}/collections/{uuid}/updateSkills"}, produces = {"application/json"})@ResponseBody() final HttpEntity<TaskResult> updateSkills(@PathVariable(name = "apiVersion", required = false) String apiVersion, @PathVariable() String uuid, @RequestBody() ApiSkillListUpdate skillListUpdate, @RequestParam(required = false, defaultValue = "draft,published") List<String> status, @AuthenticationPrincipal() Jwt user)
-
publishCollections
@PostMapping(path = {"/api/v3/collections/publish"}, produces = {"application/json"})@ResponseBody() final HttpEntity<TaskResult> publishCollections(@RequestBody() ApiSearch search, @RequestParam(required = false, defaultValue = "Published") String newStatus, @RequestParam(required = false, defaultValue = "draft,published") List<String> filterByStatus, @AuthenticationPrincipal() Jwt user)
-
publishCollectionsV2
@PostMapping(path = {"/api/v2/collections/publish", "/api/collections/publish"}, produces = {"application/json"})@ResponseBody() final HttpEntity<TaskResult> publishCollectionsV2(@RequestBody() ApiSearchV2 search, @RequestParam(required = false, defaultValue = "Published") String newStatus, @RequestParam(required = false, defaultValue = "draft,published") List<String> filterByStatus, @AuthenticationPrincipal() Jwt user)
-
getSkillsForCollectionCsv
@GetMapping(path = {"/api/{apiVersion}/collections/{uuid}/csv"}, produces = {"application/json"}) final HttpEntity<TaskResult> getSkillsForCollectionCsv(@PathVariable(name = "apiVersion", required = false) String apiVersion, @PathVariable() String uuid)
-
getSkillsForCollectionXlsx
@GetMapping(value = {"/api/v3/collections/{uuid}/xlsx"}, produces = {"application/octet-stream"}) final HttpEntity<TaskResult> getSkillsForCollectionXlsx(@PathVariable() String uuid)
-
removeCollection
@DeleteMapping(path = {"/api/v3/collections/{uuid}/remove"}, produces = {"application/json"}) final HttpEntity<TaskResult> removeCollection(@PathVariable() String uuid)
-
removeCollectionV2
@DeleteMapping(path = {"/api/v2/collections/{uuid}/remove", "/api/collections/{uuid}/remove"}, produces = {"application/json"}) final HttpEntity<TaskResult> removeCollectionV2(@PathVariable() String uuid)
-
collectionAuditLog
@GetMapping(path = {"/api/v2/collections/{uuid}/log", "/api/v3/collections/{uuid}/log", "/api/collections/{uuid}/log"}, produces = {"application/json"}) final HttpEntity<List<AuditLog>> collectionAuditLog(@PathVariable() String uuid)
-
getOrCreateWorkspace
@GetMapping(path = {"/api/v3/workspace"}, produces = {"application/json"})@ResponseBody() final ApiCollection getOrCreateWorkspace(@AuthenticationPrincipal() Jwt user)
-
getOrCreateWorkspaceV2
@GetMapping(path = {"/api/v2/workspace", "/api/workspace"}, produces = {"application/json"})@ResponseBody() final ApiCollection getOrCreateWorkspaceV2(@AuthenticationPrincipal() Jwt user)
-
-
-
-