private SyndEntry createEntry(ContentRecordVO contentVO, String langCode, String feedLink, HttpServletRequest req, HttpServletResponse resp) throws ApsSystemException {
SyndEntry entry = new SyndEntryImpl();
RssContentMapping mapping = this.getContentMapping().get(contentVO.getTypeCode());
try {
Content content = (Content) this.getContentManager().loadContent(contentVO.getId(), true);
ITextAttribute titleAttr = (ITextAttribute) content.getAttribute(mapping.getTitleAttributeName());
String title = (titleAttr.getTextForLang(langCode));
if (null == title || title.trim().length() == 0) {
title = titleAttr.getText();
}
entry.setTitle(title);
String link = this.createLink(content, feedLink);
entry.setLink(link);
entry.setPublishedDate(contentVO.getModify());
ITextAttribute descrAttr = (ITextAttribute) content.getAttribute(mapping.getDescriptionAttributeName());
if (null != descrAttr) {
SyndContent description = new SyndContentImpl();
description.setType(JpRssSystemConstants.SYNDCONTENT_TYPE_TEXTHTML);
String inLang = descrAttr.getTextForLang(langCode);
//TODO Ottimizzare!
RequestContext requestContext = new RequestContext();
requestContext.setRequest(req);
requestContext.setResponse(resp);
if (null != inLang && inLang.length() >0) {
String textValue = this.getLinkResolver().resolveLinks(inLang, requestContext);
if (null != textValue && textValue.trim().length()>0) {
description.setValue(textValue);
} else {
description.setValue(descrAttr.getText());
}
} else {
String textValue = this.getLinkResolver().resolveLinks(descrAttr.getText(), requestContext);
description.setValue(textValue);
}
entry.setDescription(description);
}
} catch (Throwable t) {