Skip to content
This repository was archived by the owner on Jan 15, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ class IdentityRunnable implements Runnable {

public void run() {
try {
if (!rootNode.hasNode("exo:applications/Social_Identity")) {
os.close();
return;
}

Node rootIdentity = rootNode.getNode("exo:applications/Social_Identity");
NodeIterator it = rootIdentity.getNodes();
it.skip(ctx.getDone(WriterContext.DataType.IDENTITIES));
Expand All @@ -139,6 +144,11 @@ class RelationshipRunnable implements Runnable {

public void run() {
try {
if (!rootNode.hasNode("exo:applications/Social_Relationship")) {
os.close();
return;
}

Node rootRelationship = rootNode.getNode("exo:applications/Social_Relationship");
NodeIterator it = rootRelationship.getNodes();
it.skip(ctx.getDone(WriterContext.DataType.RELATIONSHIPS));
Expand All @@ -164,6 +174,11 @@ class SpaceRunnable implements Runnable {

public void run() {
try {
if (!rootNode.hasNode("exo:applications/Social_Space/Space")) {
os.close();
return;
}

Node rootSpace = rootNode.getNode("exo:applications/Social_Space/Space");
NodeIterator it = rootSpace.getNodes();
it.skip(ctx.getDone(WriterContext.DataType.SPACES));
Expand Down Expand Up @@ -191,30 +206,37 @@ public void run() {
long remaining = ctx.getDone(WriterContext.DataType.ACTIVITIES);

try {
Node rootOrganizationActivity = rootNode.getNode("exo:applications/Social_Activity/organization");
NodeIterator userItOrganization = rootOrganizationActivity.getNodes();
while (userItOrganization.hasNext()) {

Node currentUser = userItOrganization.nextNode();
Node publishedNode = currentUser.getNode("published");
NodeIterator it = publishedNode.getNodes();

long size = it.getSize();
if (remaining >= size) {
remaining -= size;
continue;
if (rootNode.hasNode("exo:applications/Social_Activity/organization")) {
Node rootOrganizationActivity = rootNode.getNode("exo:applications/Social_Activity/organization");
NodeIterator userItOrganization = rootOrganizationActivity.getNodes();
while (userItOrganization.hasNext()) {

Node currentUser = userItOrganization.nextNode();
Node publishedNode = currentUser.getNode("published");
NodeIterator it = publishedNode.getNodes();

long size = it.getSize();
if (remaining >= size) {
remaining -= size;
continue;
}
else if (remaining > 0) {
it.skip(remaining);
readFrom(it, os);
remaining = 0;
}
else {
readFrom(it, os);
}

}
else if (remaining > 0) {
it.skip(remaining);
readFrom(it, os);
remaining = 0;
}
else {
readFrom(it, os);
}

}

if (!rootNode.hasNode("exo:applications/Social_Activity/space")) {
os.close();
return;
}

Node rootSpaceActivity = rootNode.getNode("exo:applications/Social_Activity/space");
NodeIterator userItSpace = rootSpaceActivity.getNodes();
while(userItSpace.hasNext()) {
Expand Down Expand Up @@ -260,6 +282,11 @@ public void run() {

try {

if (!rootNode.hasNode("exo:applications/Social_Profile")) {
os.close();
return;
}

//
Node rootProfile = rootNode.getNode("exo:applications/Social_Profile");
NodeIterator it = rootProfile.getNodes();
Expand Down