Search in sources :

Example 51 with Post

use of com.willshex.blogwt.shared.api.datatype.Post in project blogwt by billy1380.

the class GetRelatedPostsRequest method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("post")) {
        JsonElement jsonPost = jsonObject.get("post");
        if (jsonPost != null) {
            post = new Post();
            post.fromJson(jsonPost.getAsJsonObject());
        }
    }
    if (jsonObject.has("pager")) {
        JsonElement jsonPager = jsonObject.get("pager");
        if (jsonPager != null) {
            pager = new Pager();
            pager.fromJson(jsonPager.getAsJsonObject());
        }
    }
}
Also used : JsonElement(com.google.gson.JsonElement) Post(com.willshex.blogwt.shared.api.datatype.Post) Pager(com.willshex.blogwt.shared.api.Pager)

Example 52 with Post

use of com.willshex.blogwt.shared.api.datatype.Post in project blogwt by billy1380.

the class UpdatePostResponse method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("post")) {
        JsonElement jsonPost = jsonObject.get("post");
        if (jsonPost != null) {
            post = new Post();
            post.fromJson(jsonPost.getAsJsonObject());
        }
    }
}
Also used : JsonElement(com.google.gson.JsonElement) Post(com.willshex.blogwt.shared.api.datatype.Post)

Aggregations

Post (com.willshex.blogwt.shared.api.datatype.Post)52 JsonElement (com.google.gson.JsonElement)11 ArrayList (java.util.ArrayList)11 Pager (com.willshex.blogwt.shared.api.Pager)10 Key (com.googlecode.objectify.Key)8 Page (com.willshex.blogwt.shared.api.datatype.Page)7 Date (java.util.Date)6 InputValidationException (com.willshex.gson.web.service.server.InputValidationException)5 HashMap (java.util.HashMap)5 Tag (com.willshex.blogwt.shared.api.datatype.Tag)4 User (com.willshex.blogwt.shared.api.datatype.User)4 ArchiveEntry (com.willshex.blogwt.shared.api.datatype.ArchiveEntry)3 PostContent (com.willshex.blogwt.shared.api.datatype.PostContent)3 ScoredDocument (com.google.appengine.api.search.ScoredDocument)2 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)2 EditPageWizardPage (com.willshex.blogwt.client.wizard.page.EditPageWizardPage)2 SelectPostWizardPage (com.willshex.blogwt.client.wizard.page.SelectPostWizardPage)2 GetPostRequest (com.willshex.blogwt.shared.api.blog.call.GetPostRequest)2 MarkdownProcessor (org.markdown4j.server.MarkdownProcessor)2 Document (com.google.appengine.api.search.Document)1