Package edu.ucsb.cs.scaffold.controller
Class ConceptsController
java.lang.Object
edu.ucsb.cs.scaffold.controller.ApiController
edu.ucsb.cs.scaffold.controller.ConceptsController
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final record -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteConcept(Long conceptId) designateSubconcept(Long conceptId, Long parentConceptId) getContent(Long courseId) getCourseConcepts(Long courseId) getPositions(Long courseId) getSubconcepts(Long courseId) getTopLevelConcepts(Long courseId) postConceptEdge(Long sourceConceptId, Long targetConceptId) postPracticeProblem(Long conceptId, String url) putConcept(Long conceptId, UpdateConceptDTO dto) putSubconcept(Long conceptId, UpdateSubconceptDTO dto) reorderSubconcepts(Long parentConceptId, List<Long> orderedSubconceptIds) resetCourseScaffold(Long courseId) splitOffSubconcept(Long conceptId, Integer x, Integer y) updateScaffoldSpacing(Long courseId, int xSpacing, int ySpacing) Methods inherited from class edu.ucsb.cs.scaffold.controller.ApiController
genericMessage, getCurrentUser, handleEntityNotFoundException, handleForbiddenException, handleIllegalArgument, handleUnsupportedOperation
-
Field Details
-
MAX_RENDERED_CONCEPT_LABEL_LENGTH
public static final int MAX_RENDERED_CONCEPT_LABEL_LENGTH- See Also:
-
MAX_RENDERED_SUBCONCEPT_LABEL_LENGTH
public static final int MAX_RENDERED_SUBCONCEPT_LABEL_LENGTH- See Also:
-
DEFAULT_TOP_LEVEL_COLOR
- See Also:
-
-
Constructor Details
-
ConceptsController
public ConceptsController()
-
-
Method Details
-
getContent
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/api/concepts/content") public Map<Long,ConceptsController.ConceptContentDTO> getContent(@RequestParam Long courseId) -
getCourseConcepts
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/api/concepts/course") public List<ConceptsController.CourseConceptDTO> getCourseConcepts(@RequestParam Long courseId) -
getGraph
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/api/concepts/graph") public List<ConceptsController.MajorConceptDTO> getGraph(@RequestParam Long courseId) -
getPositions
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/api/concepts/positions") public Map<Long,ConceptsController.PositionDTO> getPositions(@RequestParam Long courseId) -
getTopLevelConcepts
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/api/concepts/top-level") public List<ConceptsController.TopLevelConceptDTO> getTopLevelConcepts(@RequestParam Long courseId) -
getSubconcepts
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/api/concepts/subconcepts") public List<ConceptsController.SubConceptTableRowDTO> getSubconcepts(@RequestParam Long courseId) -
getEdges
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/api/concepts/edges") public List<ConceptsController.EdgeDTO> getEdges(@RequestParam Long courseId) -
postConcept
@PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #dto.courseId)") @PostMapping(value="/api/concept", consumes={"application/yaml","application/x-yaml","application/json"}) public Concept postConcept(@RequestBody CreateConceptDTO dto) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
postSubconcept
@PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #dto.courseId)") @PostMapping(value="/api/concept/subconcept", consumes={"application/yaml","application/x-yaml","application/json"}) public Concept postSubconcept(@RequestBody CreateSubconceptDTO dto) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
putConcept
@PreAuthorize("@CourseSecurity.hasConceptManagementPermissions(#root, #conceptId)") @PutMapping("/api/concept/put") public Concept putConcept(@RequestParam Long conceptId, @RequestBody UpdateConceptDTO dto) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
putSubconcept
@PreAuthorize("@CourseSecurity.hasConceptManagementPermissions(#root, #conceptId)") @PutMapping("/api/concept/subconcept/put") public Concept putSubconcept(@RequestParam Long conceptId, @RequestBody UpdateSubconceptDTO dto) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
postPracticeProblem
@PreAuthorize("@CourseSecurity.hasConceptManagementPermissions(#root, #conceptId)") @PostMapping("/api/concepts/practiceproblems/post") public PracticeProblem postPracticeProblem(@RequestParam Long conceptId, @RequestParam String url) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
designateSubconcept
@PreAuthorize("@CourseSecurity.hasConceptManagementPermissions(#root, #conceptId)") @PutMapping("/api/concepts/designate") public Concept designateSubconcept(@RequestParam Long conceptId, @RequestParam Long parentConceptId) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
splitOffSubconcept
@PreAuthorize("@CourseSecurity.hasConceptManagementPermissions(#root, #conceptId)") @PutMapping("/api/concepts/splitoff") public Concept splitOffSubconcept(@RequestParam Long conceptId, @RequestParam Integer x, @RequestParam Integer y) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
reorderSubconcepts
@PreAuthorize("@CourseSecurity.hasConceptManagementPermissions(#root, #parentConceptId)") @PutMapping("/api/concepts/subconcepts/reorder") public List<ConceptsController.SubconceptDTO> reorderSubconcepts(@RequestParam Long parentConceptId, @RequestBody List<Long> orderedSubconceptIds) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
postConceptEdge
@PreAuthorize("@CourseSecurity.hasConceptManagementPermissions(#root, #sourceConceptId)") @PostMapping("/api/concepts/edges/post") public ConceptEdge postConceptEdge(@RequestParam Long sourceConceptId, @RequestParam Long targetConceptId) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
deleteConceptEdge
@PreAuthorize("@CourseSecurity.hasConceptEdgeManagementPermissions(#root, #id)") @DeleteMapping("/api/concepts/edges/delete") public Object deleteConceptEdge(@RequestParam Long id) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
deleteConcept
@PreAuthorize("@CourseSecurity.hasConceptManagementPermissions(#root, #conceptId)") @DeleteMapping("/api/concept/delete") public Object deleteConcept(@RequestParam Long conceptId) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
resetCourseScaffold
@PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @PostMapping("/api/course/scaffold/reset") public ConceptsController.ScaffoldResetResponseDTO resetCourseScaffold(@RequestParam Long courseId) throws EntityNotFoundException - Throws:
EntityNotFoundException
-
updateScaffoldSpacing
@PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @PutMapping("/api/course/scaffold/spacing") public ConceptsController.ScaffoldSpacingDTO updateScaffoldSpacing(@RequestParam Long courseId, @RequestParam int xSpacing, @RequestParam int ySpacing) throws EntityNotFoundException - Throws:
EntityNotFoundException
-