package cz.zcu.kiv.eeg.KIMBridge.repository.linkedin;

import com.google.code.linkedinapi.schema.Post;
import cz.zcu.kiv.eeg.KIMBridge.repository.ITextDocument;

/**
 * @author Jan Smitka <jan@smitka.org>
 */
public class LinkedInDocument implements ITextDocument {
	private Post postData;

	public LinkedInDocument(Post post) {
		postData = post;
	}

	@Override
	public String getContents() {
		return String.format("%s%n%s", postData.getTitle(), postData.getSummary());
	}

	@Override
	public String getTitle() {
		return null;
	}
}

@@ -96,16 +96,67 @@
 a.Post;%0A
+import com.google.code.linkedinapi.schema.Comment;%0A
 import c
@@ -468,16 +468,22 @@
 (%22%25s%25n%25s
+%25n%25n%25s
 %22, postD
@@ -519,16 +519,34 @@
 ummary()
+, getAllComments()
 );%0A%09%7D%0A%0A%09
@@ -600,11 +600,391 @@
 null;%0A%09%7D
+%0A%0A%09private String getAllComments() %7B%0A%09%09StringBuilder str = new StringBuilder();%0A%09%09for (Comment comment : postData.getComments().getCommentList()) %7B%0A%09%09%09str.append(comment.getCreator().getFirstName());%0A%09%09%09str.append(%22 %22);%0A%09%09%09str.append(comment.getCreator().getLastName());%0A%09%09%09str.append(%22%5Cn%22);%0A%09%09%09str.append(comment.getText());%0A%09%09%09str.append(%22%5Cn%5Cn%22);%0A%09%09%7D%0A%09%09return str.toString();%0A%09%7D
 %0A%7D%0A

comment serialization in post contents (testing required).