Search in sources :

Example 16 with User

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

the class ChangeUserDetailsResponse 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 17 with User

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

the class FollowUsersRequest 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("others")) {
        JsonElement jsonOthers = jsonObject.get("others");
        if (jsonOthers != null) {
            others = new ArrayList<User>();
            User item = null;
            for (int i = 0; i < jsonOthers.getAsJsonArray().size(); i++) {
                if (jsonOthers.getAsJsonArray().get(i) != null) {
                    (item = new User()).fromJson(jsonOthers.getAsJsonArray().get(i).getAsJsonObject());
                    others.add(item);
                }
            }
        }
    }
    if (jsonObject.has("un")) {
        JsonElement jsonUn = jsonObject.get("un");
        if (jsonUn != null) {
            un = Boolean.valueOf(jsonUn.getAsBoolean());
        }
    }
}
Also used : User(com.willshex.blogwt.shared.api.datatype.User) JsonElement(com.google.gson.JsonElement)

Example 18 with User

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

the class GetRolesAndPermissionsRequest method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("idsOnly")) {
        JsonElement jsonIdsOnly = jsonObject.get("idsOnly");
        if (jsonIdsOnly != null) {
            idsOnly = Boolean.valueOf(jsonIdsOnly.getAsBoolean());
        }
    }
    if (jsonObject.has("user")) {
        JsonElement jsonUser = jsonObject.get("user");
        if (jsonUser != null) {
            user = new User();
            user.fromJson(jsonUser.getAsJsonObject());
        }
    }
    if (jsonObject.has("expandRoles")) {
        JsonElement jsonExpandRoles = jsonObject.get("expandRoles");
        if (jsonExpandRoles != null) {
            expandRoles = Boolean.valueOf(jsonExpandRoles.getAsBoolean());
        }
    }
    if (jsonObject.has("rolesOnly")) {
        JsonElement jsonRolesOnly = jsonObject.get("rolesOnly");
        if (jsonRolesOnly != null) {
            rolesOnly = Boolean.valueOf(jsonRolesOnly.getAsBoolean());
        }
    }
    if (jsonObject.has("permissionOnly")) {
        JsonElement jsonPermissionOnly = jsonObject.get("permissionOnly");
        if (jsonPermissionOnly != null) {
            permissionOnly = Boolean.valueOf(jsonPermissionOnly.getAsBoolean());
        }
    }
}
Also used : User(com.willshex.blogwt.shared.api.datatype.User) JsonElement(com.google.gson.JsonElement)

Example 19 with User

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

the class GetUserDetailsRequest 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 20 with User

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

the class GetUserDetailsResponse 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)

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