use of com.willshex.blogwt.client.api.blog.event.CreatePostEventHandler.CreatePostFailure in project blogwt by billy1380.
the class PostController method createPost.
public void createPost(String title, Boolean listed, Boolean commentsEnabled, String summary, String content, Boolean publish, String tags) {
BlogService blogService = ApiHelper.createBlogClient();
final CreatePostRequest input = SessionController.get().setSession(ApiHelper.setAccessCode(new CreatePostRequest())).post(new Post().title(title).summary(summary).content(new PostContent().body(content)).tags(TagHelper.convertToTagList(tags)).listed(listed).commentsEnabled(commentsEnabled)).publish(publish);
blogService.createPost(input, new AsyncCallback<CreatePostResponse>() {
@Override
public void onSuccess(CreatePostResponse output) {
if (output.status == StatusType.StatusTypeSuccess) {
}
DefaultEventBus.get().fireEventFromSource(new CreatePostSuccess(input, output), PostController.this);
}
@Override
public void onFailure(Throwable caught) {
DefaultEventBus.get().fireEventFromSource(new CreatePostFailure(input, caught), PostController.this);
}
});
}
Aggregations