use of org.mamute.model.interfaces.RssContent in project mamute by caelum.
the class QuestionDAOTest method should_find_questions_visible_and_order_by_creation_date_of_a_tag.
@Test
public void should_find_questions_visible_and_order_by_creation_date_of_a_tag() throws Exception {
Question question1 = question(author, java);
Question question2 = question(author, defaultTag);
Question invisible = question(author, defaultTag);
invisible.remove();
session.save(question1);
session.save(question2);
session.save(invisible);
List<RssContent> questions = questionsForAnyone.orderedByCreationDate(30, defaultTag);
assertEquals(1, questions.size());
}
use of org.mamute.model.interfaces.RssContent in project mamute by caelum.
the class QuestionDAOTest method should_find_questions_visible_and_order_by_creation_date.
@Test
public void should_find_questions_visible_and_order_by_creation_date() throws Exception {
Question question1 = question(author, java);
Question question2 = question(author, java);
question2.remove();
session.save(question1);
session.save(question2);
List<RssContent> questions = questionsForAnyone.orderedByCreationDate(5);
assertEquals(1, questions.size());
}
use of org.mamute.model.interfaces.RssContent in project mamute by caelum.
the class RssController method rssByTag.
@Get
public void rssByTag(String tagName) throws IOException {
Tag tag = tags.findByName(tagName);
if (tag == null) {
result.notFound();
return;
}
List<RssContent> orderedByDate = questions.orderedByCreationDate(MAX_RESULTS, tag);
String title = bundle.getMessage("questions.rss.title", bundle.getMessage("site.name"));
String description = bundle.getMessage("questions.rss.description", bundle.getMessage("site.name"));
buildRss(orderedByDate, title, description);
}
use of org.mamute.model.interfaces.RssContent in project mamute by caelum.
the class RssFeedFactory method build.
public void build(List<RssContent> rssContents, OutputStream output, String rssTitle, String rssDescription) {
stream = new PrintStream(output);
open(output, rssTitle, rssDescription);
for (RssContent rssContent : rssContents) {
entryFactory.writeEntry(rssContent, output);
stream.print('\n');
}
close(output);
}
Aggregations