psevestre / vosao-old

Automatically exported from code.google.com/p/vosao
GNU Lesser General Public License v2.1
0 stars 0 forks source link

getDescription method doesn't accept language as parameter #488

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It could be nice to have a getDescription method in RssTool that allow language 
parameter so the description to be used in rss xml generation can be 
localizable.

The method could be something like this:

public String getDescription(PageEntity page, String lang) {
    RssatomConfig rssatomConfig = new RssatomConfig(getPlugin());
    page.setSkipPostProcessing(true);
    String content = StrUtil.extractTextFromHTML(
           getBusiness().getPageBusiness().render(page, PAGE_TEMPLATE, lang));
    if (StringUtils.isEmpty(content)) {
      return "";
    }
    int end = content.length() > rssatomConfig.getItemSize() ? 
                 rssatomConfig.getItemSize() : content.length();
    return content.substring(0, end - 1);
}

Original issue reported on code.google.com by sant...@gmail.com on 28 Jun 2011 at 3:40

Attachments:

GoogleCodeExporter commented 9 years ago
Accepted for rssatom-0.9.1

Original comment by kinyelo@gmail.com on 10 Jul 2011 at 8:49

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1069.

Original comment by kinyelo@gmail.com on 10 Jul 2011 at 8:57