use of org.jamwiki.parser.AbstractParser in project OpenOLAT by OpenOLAT.
the class WikiPageDocument method getContent.
private static String getContent(WikiPage wikiPage) {
try {
ParserInput input = new ParserInput();
input.setWikiUser(null);
input.setAllowSectionEdit(false);
input.setDepth(2);
input.setContext("");
input.setLocale(Locale.ENGLISH);
input.setTopicName("dummy");
input.setUserIpAddress("0.0.0.0");
input.setDataHandler(DUMMY_DATA_HANDLER);
input.setVirtualWiki("/olat");
AbstractParser parser = new JFlexParser(input);
ParserDocument parsedDoc = parser.parseHTML(wikiPage.getContent());
String parsedContent = parsedDoc.getContent();
String filteredContent = FilterFactory.getHtmlTagAndDescapingFilter().filter(parsedContent);
return filteredContent;
} catch (Exception e) {
log.error("", e);
return wikiPage.getContent();
}
}
use of org.jamwiki.parser.AbstractParser in project openolat by klemens.
the class WikiPageDocument method getContent.
private static String getContent(WikiPage wikiPage) {
try {
ParserInput input = new ParserInput();
input.setWikiUser(null);
input.setAllowSectionEdit(false);
input.setDepth(2);
input.setContext("");
input.setLocale(Locale.ENGLISH);
input.setTopicName("dummy");
input.setUserIpAddress("0.0.0.0");
input.setDataHandler(DUMMY_DATA_HANDLER);
input.setVirtualWiki("/olat");
AbstractParser parser = new JFlexParser(input);
ParserDocument parsedDoc = parser.parseHTML(wikiPage.getContent());
String parsedContent = parsedDoc.getContent();
String filteredContent = FilterFactory.getHtmlTagAndDescapingFilter().filter(parsedContent);
return filteredContent;
} catch (Exception e) {
log.error("", e);
return wikiPage.getContent();
}
}
use of org.jamwiki.parser.AbstractParser in project openolat by klemens.
the class WikiPageMediaController method getContent.
private static String getContent(String content) {
try {
ParserInput input = new ParserInput();
input.setWikiUser(null);
input.setAllowSectionEdit(false);
input.setDepth(2);
input.setContext("");
input.setLocale(Locale.ENGLISH);
input.setTopicName("dummy");
input.setUserIpAddress("0.0.0.0");
input.setDataHandler(new DummyDataHandler());
input.setVirtualWiki("/olat");
AbstractParser parser = new JFlexParser(input);
ParserDocument parsedDoc = parser.parseHTML(content);
String parsedContent = parsedDoc.getContent();
return FilterFactory.getHtmlTagAndDescapingFilter().filter(parsedContent);
} catch (Exception e) {
log.error("", e);
return content;
}
}
use of org.jamwiki.parser.AbstractParser in project OpenOLAT by OpenOLAT.
the class WikiPageMediaController method getContent.
private static String getContent(String content) {
try {
ParserInput input = new ParserInput();
input.setWikiUser(null);
input.setAllowSectionEdit(false);
input.setDepth(2);
input.setContext("");
input.setLocale(Locale.ENGLISH);
input.setTopicName("dummy");
input.setUserIpAddress("0.0.0.0");
input.setDataHandler(new DummyDataHandler());
input.setVirtualWiki("/olat");
AbstractParser parser = new JFlexParser(input);
ParserDocument parsedDoc = parser.parseHTML(content);
String parsedContent = parsedDoc.getContent();
return FilterFactory.getHtmlTagAndDescapingFilter().filter(parsedContent);
} catch (Exception e) {
log.error("", e);
return content;
}
}
use of org.jamwiki.parser.AbstractParser in project OpenOLAT by OpenOLAT.
the class WikiArtefactDetailsController method getContent.
private static String getContent(String content) {
try {
ParserInput input = new ParserInput();
input.setWikiUser(null);
input.setAllowSectionEdit(false);
input.setDepth(2);
input.setContext("");
input.setLocale(Locale.ENGLISH);
input.setTopicName("dummy");
input.setUserIpAddress("0.0.0.0");
input.setDataHandler(new DummyDataHandler());
input.setVirtualWiki("/olat");
AbstractParser parser = new JFlexParser(input);
ParserDocument parsedDoc = parser.parseHTML(content);
String parsedContent = parsedDoc.getContent();
return FilterFactory.getHtmlTagAndDescapingFilter().filter(parsedContent);
} catch (Exception e) {
log.error("", e);
return content;
}
}
Aggregations