Search in sources :

Example 1 with StreamDeserializer

use of com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer in project Klyph by jonathangerbaud.

the class EventTimelineNewestRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
    JSONArray data = result[0];
    JSONArray data_ids = result[1];
    JSONArray urls = result[2];
    assocData2(data, data_ids, "actor_id", "id", "actor_name", "name", "actor_type", "type");
    assocData(data, urls, "actor_id", "id", "actor_pic", "url");
    assocData2(data, data_ids, "target_id", "id", "target_name", "name", "target_type", "type");
    StreamDeserializer deserializer = new StreamDeserializer();
    ArrayList<GraphObject> streams = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
    setHasMoreData(streams.size() >= 0);
    return streams;
}
Also used : StreamDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer) JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 2 with StreamDeserializer

use of com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer in project Klyph by jonathangerbaud.

the class AlternativeNewsFeedRequest method handleResult.

@Override
public List<GraphObject> handleResult(JSONArray[] result) {
    JSONArray data = result[0];
    JSONArray data2 = result[1];
    JSONArray links = result[2];
    JSONArray photos = result[3];
    JSONArray videos = result[4];
    JSONArray status = result[5];
    JSONArray events = result[6];
    JSONArray profiles = result[7];
    JSONArray pages = result[8];
    JSONArray pics = result[9];
    JSONArray places = result[10];
    JSONArray apps = result[11];
    assocData2(links, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData2(links, profiles, "via_id", "id", "via_name", "name", "via_type", "type");
    assocData(links, pics, "owner", "id", "owner_pic", "url");
    assocData2(photos, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData2(photos, profiles, "target", "id", "target_name", "name", "target_type", "type");
    assocData(photos, pics, "owner", "id", "owner_pic", "url");
    assocData(photos, places, "place", "page_id", "place_name", "name");
    assocData2(videos, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData(videos, pics, "owner", "id", "owner_pic", "url");
    assocData2(status, profiles, "uid", "id", "uid_name", "name", "uid_type", "type");
    assocData(status, pics, "uid", "id", "uid_pic", "url");
    assocData(status, places, "place_id", "page_id", "place_name", "name");
    assocData(pages, pics, "page_id", "id", "pic", "url");
    assocData2(data, profiles, "actor_id", "id", "actor_name", "name", "actor_type", "type");
    assocData2(data, profiles, "target_id", "id", "target_name", "name", "target_type", "type");
    assocData(data, pics, "actor_id", "id", "actor_pic", "url");
    assocData2(data2, profiles, "actor_id", "id", "actor_name", "name", "actor_type", "type");
    assocData2(data2, profiles, "target_id", "id", "target_name", "name", "target_type", "type");
    assocData(data2, pics, "actor_id", "id", "actor_pic", "url");
    assocData(data, places, "place", "page_id", "place_name", "name");
    assocData3(data, profiles, "tagged_ids", "id", "tagged_tags");
    assocData3(data2, profiles, "tagged_ids", "id", "tagged_tags");
    assocStreamToEvent(data, events);
    assocStreamToLikedPages(data, pages);
    assocStreamToObjectBySubPostId(data, links, "link_id", "link");
    assocStreamToObjectBySubPostId(data, photos, "object_id", "photo");
    assocStreamToObjectBySubPostId(data, videos, "vid", "video");
    assocStreamToStatus(data, status);
    assocStreamToObjectById(data, apps, "app_id", "app_id", "application");
    assocStreamToObjectById(data, data2, "parent_post_id", "post_id", "parent_stream");
    StreamDeserializer deserializer = new StreamDeserializer();
    ArrayList<GraphObject> streams = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
    if (mustReverse())
        Collections.reverse(streams);
    setHasMoreData(streams.size() > 0);
    return streams;
}
Also used : StreamDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer) JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 3 with StreamDeserializer

use of com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer in project Klyph by jonathangerbaud.

the class ElementTimelineRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
    JSONArray data = result[0];
    JSONArray data2 = result[1];
    JSONArray links = result[2];
    JSONArray photos = result[3];
    JSONArray videos = result[4];
    JSONArray status = result[5];
    JSONArray events = result[6];
    JSONArray profiles = result[7];
    JSONArray pages = result[8];
    JSONArray pics = result[9];
    JSONArray places = result[10];
    JSONArray apps = result[11];
    assocData2(links, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData2(links, profiles, "via_id", "id", "via_name", "name", "via_type", "type");
    assocData(links, pics, "owner", "id", "owner_pic", "url");
    assocData2(photos, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData2(photos, profiles, "target", "id", "target_name", "name", "target_type", "type");
    assocData(photos, pics, "owner", "id", "owner_pic", "url");
    assocData(photos, places, "place", "page_id", "place_name", "name");
    assocData2(videos, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData(videos, pics, "owner", "id", "owner_pic", "url");
    assocData2(status, profiles, "uid", "id", "uid_name", "name", "uid_type", "type");
    assocData(status, pics, "uid", "id", "uid_pic", "url");
    assocData(status, places, "place_id", "page_id", "place_name", "name");
    assocData(pages, pics, "page_id", "id", "pic", "url");
    assocData2(data, profiles, "actor_id", "id", "actor_name", "name", "actor_type", "type");
    assocData2(data, profiles, "target_id", "id", "target_name", "name", "target_type", "type");
    assocData2(data2, profiles, "actor_id", "id", "actor_name", "name", "actor_type", "type");
    assocData2(data2, profiles, "target_id", "id", "target_name", "name", "target_type", "type");
    assocData(data, pics, "actor_id", "id", "actor_pic", "url");
    assocData(data2, pics, "actor_id", "id", "actor_pic", "url");
    assocData(data, places, "place", "page_id", "place_name", "name");
    assocData3(data, profiles, "tagged_ids", "id", "tagged_tags");
    assocStreamToEvent(data, events);
    assocStreamToLikedPages(data, pages);
    assocStreamToObjectBySubPostId(data, links, "link_id", "link");
    assocStreamToObjectBySubPostId(data, photos, "object_id", "photo");
    assocStreamToObjectBySubPostId(data, videos, "vid", "video");
    assocStreamToStatus(data, status);
    assocStreamToObjectById(data, apps, "app_id", "app_id", "application");
    assocStreamToObjectById(data, data2, "parent_post_id", "post_id", "parent_stream");
    StreamDeserializer deserializer = new StreamDeserializer();
    ArrayList<GraphObject> streams = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
    return streams;
}
Also used : StreamDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer) JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 4 with StreamDeserializer

use of com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer in project Klyph by jonathangerbaud.

the class NewsFeedRequest method handleResult.

@Override
public List<GraphObject> handleResult(JSONArray[] result) {
    JSONArray data = result[0];
    JSONArray data2 = result[1];
    JSONArray links = result[2];
    JSONArray photos = result[3];
    JSONArray videos = result[4];
    JSONArray status = result[5];
    JSONArray events = result[6];
    JSONArray profiles = result[7];
    JSONArray pages = result[8];
    JSONArray pics = result[9];
    JSONArray places = result[10];
    JSONArray apps = result[11];
    assocData2(links, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData2(links, profiles, "via_id", "id", "via_name", "name", "via_type", "type");
    assocData(links, pics, "owner", "id", "owner_pic", "url");
    assocData2(photos, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData2(photos, profiles, "target", "id", "target_name", "name", "target_type", "type");
    assocData(photos, pics, "owner", "id", "owner_pic", "url");
    assocData(photos, places, "place", "page_id", "place_name", "name");
    assocData2(videos, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData(videos, pics, "owner", "id", "owner_pic", "url");
    assocData2(status, profiles, "uid", "id", "uid_name", "name", "uid_type", "type");
    assocData(status, pics, "uid", "id", "uid_pic", "url");
    assocData(status, places, "place_id", "page_id", "place_name", "name");
    assocData(pages, pics, "page_id", "id", "pic", "url");
    assocData2(data, profiles, "actor_id", "id", "actor_name", "name", "actor_type", "type");
    assocData2(data, profiles, "target_id", "id", "target_name", "name", "target_type", "type");
    assocData(data, pics, "actor_id", "id", "actor_pic", "url");
    assocData2(data2, profiles, "actor_id", "id", "actor_name", "name", "actor_type", "type");
    assocData2(data2, profiles, "target_id", "id", "target_name", "name", "target_type", "type");
    assocData(data2, pics, "actor_id", "id", "actor_pic", "url");
    assocData(data, places, "place", "page_id", "place_name", "name");
    assocData3(data, profiles, "tagged_ids", "id", "tagged_tags");
    assocData3(data2, profiles, "tagged_ids", "id", "tagged_tags");
    assocStreamToEvent(data, events);
    assocStreamToLikedPages(data, pages);
    assocStreamToObjectBySubPostId(data, links, "link_id", "link");
    assocStreamToObjectBySubPostId(data, photos, "object_id", "photo");
    assocStreamToObjectBySubPostId(data, videos, "vid", "video");
    assocStreamToStatus(data, status);
    assocStreamToObjectById(data, apps, "app_id", "app_id", "application");
    assocStreamToObjectById(data, data2, "parent_post_id", "post_id", "parent_stream");
    StreamDeserializer deserializer = new StreamDeserializer();
    ArrayList<GraphObject> streams = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
    if (mustReverse())
        Collections.reverse(streams);
    setHasMoreData(streams.size() > 0);
    return streams;
}
Also used : StreamDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer) JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 5 with StreamDeserializer

use of com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer in project Klyph by jonathangerbaud.

the class StreamRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
    JSONArray sData = result[0];
    JSONArray sData2 = result[1];
    JSONArray links = result[2];
    JSONArray photos = result[3];
    JSONArray videos = result[4];
    JSONArray status = result[5];
    JSONArray events = result[6];
    JSONArray profiles = result[7];
    JSONArray pages = result[8];
    JSONArray pics = result[9];
    JSONArray places = result[10];
    JSONArray apps = result[11];
    assocData2(links, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData2(links, profiles, "via_id", "id", "via_name", "name", "via_type", "type");
    assocData(links, pics, "owner", "id", "owner_pic", "url");
    assocData2(photos, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData2(photos, profiles, "target", "id", "target_name", "name", "target_type", "type");
    assocData(photos, pics, "owner", "id", "owner_pic", "url");
    assocData(photos, places, "place", "page_id", "place_name", "name");
    assocData2(videos, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
    assocData(videos, pics, "owner", "id", "owner_pic", "url");
    assocData2(status, profiles, "uid", "id", "uid_name", "name", "uid_type", "type");
    assocData(status, pics, "uid", "id", "uid_pic", "url");
    assocData(status, places, "place_id", "page_id", "place_name", "name");
    assocData(pages, pics, "page_id", "id", "pic", "url");
    assocData2(sData, profiles, "actor_id", "id", "actor_name", "name", "actor_type", "type");
    assocData2(sData, profiles, "target_id", "id", "target_name", "name", "target_type", "type");
    assocData2(sData2, profiles, "actor_id", "id", "actor_name", "name", "actor_type", "type");
    assocData2(sData2, profiles, "target_id", "id", "target_name", "name", "target_type", "type");
    assocData(sData, pics, "actor_id", "id", "actor_pic", "url");
    assocData(sData, places, "place", "page_id", "place_name", "name");
    assocData3(sData, profiles, "tagged_ids", "id", "tagged_tags");
    assocData(sData2, pics, "actor_id", "id", "actor_pic", "url");
    assocData(sData2, places, "place", "page_id", "place_name", "name");
    assocData3(sData2, profiles, "tagged_ids", "id", "tagged_tags");
    assocStreamToEvent(sData, events);
    assocStreamToLikedPages(sData, pages);
    assocStreamToObjectBySubPostId(sData, links, "link_id", "link");
    assocStreamToObjectBySubPostId(sData, photos, "object_id", "photo");
    assocStreamToObjectBySubPostId(sData, videos, "vid", "video");
    assocStreamToStatus(sData, status);
    assocStreamToObjectById(sData, apps, "app_id", "app_id", "application");
    assocStreamToObjectById(sData, sData2, "parent_post_id", "post_id", "parent_stream");
    StreamDeserializer sDeserializer = new StreamDeserializer();
    List<GraphObject> streams = sDeserializer.deserializeArray(sData);
    ArrayList<GraphObject> list = new ArrayList<GraphObject>();
    if (streams.size() > 0)
        list.add(streams.get(0));
    setHasMoreData(false);
    return list;
}
Also used : StreamDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer) JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Aggregations

StreamDeserializer (com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer)6 GraphObject (com.abewy.android.apps.klyph.core.graph.GraphObject)6 ArrayList (java.util.ArrayList)6 JSONArray (org.json.JSONArray)6 CommentDeserializer (com.abewy.android.apps.klyph.core.fql.serializer.CommentDeserializer)1 JSONObject (org.json.JSONObject)1