Search in sources :

Example 21 with User

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

the class GetUsersResponse method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("users")) {
        JsonElement jsonUsers = jsonObject.get("users");
        if (jsonUsers != null) {
            users = new ArrayList<User>();
            User item = null;
            for (int i = 0; i < jsonUsers.getAsJsonArray().size(); i++) {
                if (jsonUsers.getAsJsonArray().get(i) != null) {
                    (item = new User()).fromJson(jsonUsers.getAsJsonArray().get(i).getAsJsonObject());
                    users.add(item);
                }
            }
        }
    }
    if (jsonObject.has("pager")) {
        JsonElement jsonPager = jsonObject.get("pager");
        if (jsonPager != null) {
            pager = new Pager();
            pager.fromJson(jsonPager.getAsJsonObject());
        }
    }
}
Also used : User(com.willshex.blogwt.shared.api.datatype.User) JsonElement(com.google.gson.JsonElement) Pager(com.willshex.blogwt.shared.api.Pager)

Example 22 with User

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

the class RegisterUserRequest method fromJson.

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

Example 23 with User

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

the class GetNotificationSettingsRequest method fromJson.

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

Example 24 with User

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

the class GetNotificationsRequest method fromJson.

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

Example 25 with User

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

the class SearchAllResponse method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("posts")) {
        JsonElement jsonPosts = jsonObject.get("posts");
        if (jsonPosts != null) {
            posts = new ArrayList<Post>();
            Post item = null;
            for (int i = 0; i < jsonPosts.getAsJsonArray().size(); i++) {
                if (jsonPosts.getAsJsonArray().get(i) != null) {
                    (item = new Post()).fromJson(jsonPosts.getAsJsonArray().get(i).getAsJsonObject());
                    posts.add(item);
                }
            }
        }
    }
    if (jsonObject.has("pages")) {
        JsonElement jsonPages = jsonObject.get("pages");
        if (jsonPages != null) {
            pages = new ArrayList<Page>();
            Page item = null;
            for (int i = 0; i < jsonPages.getAsJsonArray().size(); i++) {
                if (jsonPages.getAsJsonArray().get(i) != null) {
                    (item = new Page()).fromJson(jsonPages.getAsJsonArray().get(i).getAsJsonObject());
                    pages.add(item);
                }
            }
        }
    }
    if (jsonObject.has("users")) {
        JsonElement jsonUsers = jsonObject.get("users");
        if (jsonUsers != null) {
            users = new ArrayList<User>();
            User item = null;
            for (int i = 0; i < jsonUsers.getAsJsonArray().size(); i++) {
                if (jsonUsers.getAsJsonArray().get(i) != null) {
                    (item = new User()).fromJson(jsonUsers.getAsJsonArray().get(i).getAsJsonObject());
                    users.add(item);
                }
            }
        }
    }
}
Also used : User(com.willshex.blogwt.shared.api.datatype.User) JsonElement(com.google.gson.JsonElement) Post(com.willshex.blogwt.shared.api.datatype.Post) Page(com.willshex.blogwt.shared.api.datatype.Page)

Aggregations

User (com.willshex.blogwt.shared.api.datatype.User)46 JsonElement (com.google.gson.JsonElement)19 InputValidationException (com.willshex.gson.web.service.server.InputValidationException)10 Pager (com.willshex.blogwt.shared.api.Pager)6 Permission (com.willshex.blogwt.shared.api.datatype.Permission)5 Page (com.willshex.blogwt.shared.api.datatype.Page)4 Post (com.willshex.blogwt.shared.api.datatype.Post)4 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 Key (com.googlecode.objectify.Key)3 Role (com.willshex.blogwt.shared.api.datatype.Role)3 Date (java.util.Date)3 HeadingElement (com.google.gwt.dom.client.HeadingElement)2 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)2 UiHandler (com.google.gwt.uibinder.client.UiHandler)2 MetaNotification (com.willshex.blogwt.shared.api.datatype.MetaNotification)2 Relationship (com.willshex.blogwt.shared.api.datatype.Relationship)2 BlobKey (com.google.appengine.api.blobstore.BlobKey)1 ScoredDocument (com.google.appengine.api.search.ScoredDocument)1 JsonObject (com.google.gson.JsonObject)1