br.com.caelum.vraptor.Delete Java Examples

The following examples show how to use br.com.caelum.vraptor.Delete. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommentController.java    From mamute with Apache License 2.0 6 votes vote down vote up
@Delete
public void delete(Long commentId, String onWhat, Long postId) {
	Comment comment = comments.getById(commentId);
	if (!environment.supports("deletable.comments") || comment == null) {
		result.notFound();
		return;
	}
	if (!currentUser.isModerator() && !comment.hasAuthor(currentUser.getCurrent())) {
		result.use(http()).sendError(403);
		return;
	}
	Class<?> type = urlMapping.getClassFor(onWhat);
	org.mamute.model.Post post = comments.loadCommentable(type, postId);
	post.deleteComment(comment);
	comments.delete(comment);
	result.use(Results.referer()).redirect();
}
 
Example #2
Source File: ContatoController.java    From aprendendo-vraptor with Apache License 2.0 4 votes vote down vote up
@Delete
@Path(value = "/{id}")
public void remover(Long id) {
	contatos.desativarComId(id);
	result.use(status()).ok();
}
 
Example #3
Source File: ContatoController.java    From aprendendo-vraptor with Apache License 2.0 4 votes vote down vote up
@Delete
@Path(value = "/{id}")
public void remover(Long id) {
	contatos.desativarComId(id);
	result.use(status()).ok();
}
 
Example #4
Source File: PathAnnotationRoutesParser.java    From vraptor4 with Apache License 2.0 4 votes vote down vote up
private Predicate<Annotation> instanceOfMethodAnnotation() {
	return or(instanceOf(Get.class), instanceOf(Post.class), instanceOf(Put.class), instanceOf(Delete.class), instanceOf(Options.class), instanceOf(Patch.class));
}
 
Example #5
Source File: PathAnnotationRoutesParserTest.java    From vraptor4 with Apache License 2.0 4 votes vote down vote up
@Path("/clients/remove")
@Delete
public void remove() {
}