@RestController @RequestMapping(value="/rest/fragments") public class FragmentResource extends Object
| Constructor and Description |
|---|
FragmentResource(FragmentRepository fragmentRepository,
FragmentService fragmentService,
JacksonObjectMapper objectMapper,
org.springframework.messaging.simp.SimpMessagingTemplate messagingTemplate,
AssetVisitor assetVisitor,
PageRepository pageRepository,
FragmentChangeVisitor fragmentChangeVisitor,
PageHasValidationErrorVisitor pageHasValidationErrorVisitor) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<Fragment> |
create(Fragment newFragment) |
void |
delete(String fragmentId) |
void |
favorite(String pageId,
Boolean favorite) |
org.springframework.http.ResponseEntity<Object> |
get(String fragmentId) |
org.springframework.http.ResponseEntity<String> |
getAll(String view,
String fragmentId) |
org.springframework.http.ResponseEntity<Void> |
rename(javax.servlet.http.HttpServletRequest request,
String fragmentId,
String name) |
org.springframework.http.ResponseEntity<Void> |
save(javax.servlet.http.HttpServletRequest request,
String fragmentId,
Fragment newFragment) |
void |
setUsedByRepositories(List<Repository> usedByRepositories)
List cannot be injected in constructor with @Inject so we use setter and @Resource to inject them
|
@Inject public FragmentResource(FragmentRepository fragmentRepository, FragmentService fragmentService, JacksonObjectMapper objectMapper, org.springframework.messaging.simp.SimpMessagingTemplate messagingTemplate, AssetVisitor assetVisitor, PageRepository pageRepository, FragmentChangeVisitor fragmentChangeVisitor, PageHasValidationErrorVisitor pageHasValidationErrorVisitor)
public void setUsedByRepositories(List<Repository> usedByRepositories)
@RequestMapping(method=POST) public org.springframework.http.ResponseEntity<Fragment> create(@RequestBody Fragment newFragment) throws RepositoryException
RepositoryException@RequestMapping(value="/{fragmentId}",
method=PUT)
public org.springframework.http.ResponseEntity<Void> save(javax.servlet.http.HttpServletRequest request,
@PathVariable(value="fragmentId")
String fragmentId,
@RequestBody
Fragment newFragment)
throws RepositoryException
RepositoryException@RequestMapping(value="/{fragmentId}/name",
method=PUT)
public org.springframework.http.ResponseEntity<Void> rename(javax.servlet.http.HttpServletRequest request,
@PathVariable(value="fragmentId")
String fragmentId,
@RequestBody
String name)
throws RepositoryException
RepositoryException@RequestMapping(method=GET) public org.springframework.http.ResponseEntity<String> getAll(@RequestParam(value="view",defaultValue="full") String view, @RequestParam(value="notUsedBy",required=false) String fragmentId) throws RepositoryException, IOException
RepositoryExceptionIOException@RequestMapping(value="/{fragmentId}",
method=GET)
public org.springframework.http.ResponseEntity<Object> get(@PathVariable(value="fragmentId")
String fragmentId)
throws NotFoundException,
RepositoryException
NotFoundExceptionRepositoryException@RequestMapping(value="/{fragmentId}",
method=DELETE)
public void delete(@PathVariable(value="fragmentId")
String fragmentId)
throws RepositoryException
RepositoryException@RequestMapping(value="/{fragmentId}/favorite",
method=PUT)
public void favorite(@PathVariable(value="fragmentId")
String pageId,
@RequestBody
Boolean favorite)
throws RepositoryException
RepositoryExceptionCopyright © 2020. All rights reserved.