Search in sources :

Example 11 with DiscussionEntry

use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.

the class DiscussionManager method replyToDiscussionEntry.

public static void replyToDiscussionEntry(CanvasContext canvasContext, long topicId, long entryId, String message, File attachment, String mimeType, StatusCallback<DiscussionEntry> callback) {
    if (isTesting() || mTesting) {
    // TODO:
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().build();
        DiscussionAPI.replyToDiscussionEntryWithAttachment(adapter, canvasContext, topicId, entryId, message, attachment, mimeType, callback, params);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 12 with DiscussionEntry

use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.

the class DiscussionManager method postToDiscussionTopic.

public static void postToDiscussionTopic(CanvasContext canvasContext, long topicId, String message, StatusCallback<DiscussionEntry> callback) {
    if (isTesting() || mTesting) {
    // TODO:
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().build();
        DiscussionAPI.postToDiscussionTopic(adapter, canvasContext, topicId, message, callback, params);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 13 with DiscussionEntry

use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.

the class DiscussionManager method getDiscussionEntries.

public static void getDiscussionEntries(CanvasContext canvasContext, long topicId, boolean forceNetwork, StatusCallback<List<DiscussionEntry>> callback) {
    if (isTesting() || mTesting) {
    // TODO:
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
        DiscussionAPI.getDiscussionEntries(adapter, canvasContext, topicId, callback, params);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 14 with DiscussionEntry

use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.

the class DiscussionManager method replyToDiscussionEntry.

public static void replyToDiscussionEntry(CanvasContext canvasContext, long topicId, long entryId, String message, StatusCallback<DiscussionEntry> callback) {
    if (isTesting() || mTesting) {
    // TODO:
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().build();
        DiscussionAPI.replyToDiscussionEntry(adapter, canvasContext, topicId, entryId, message, callback, params);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 15 with DiscussionEntry

use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.

the class DiscussionEntryHTMLConverterTest method getReadState_unread.

@Test
public void getReadState_unread() throws Exception {
    DiscussionEntryHtmlConverter converter = new DiscussionEntryHtmlConverter();
    DiscussionEntry discussionEntry = new DiscussionEntry();
    discussionEntry.setUnread(true);
    String testValue = converter.getReadState(discussionEntry);
    assertEquals("unread", testValue);
}
Also used : DiscussionEntryHtmlConverter(com.instructure.pandautils.discussions.DiscussionEntryHtmlConverter) DiscussionEntry(com.instructure.canvasapi2.models.DiscussionEntry) Test(org.junit.Test)

Aggregations

DiscussionEntry (com.instructure.canvasapi2.models.DiscussionEntry)14 Test (org.junit.Test)14 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)6 RestParams (com.instructure.canvasapi2.builders.RestParams)6 DiscussionTopic (com.instructure.canvasapi2.models.DiscussionTopic)4 DiscussionTopicHeader (com.instructure.canvasapi2.models.DiscussionTopicHeader)4 DiscussionEntryHtmlConverter (com.instructure.pandautils.discussions.DiscussionEntryHtmlConverter)2 Assignment (com.instructure.canvasapi2.models.Assignment)1 RemoteFile (com.instructure.canvasapi2.models.RemoteFile)1 ArrayList (java.util.ArrayList)1