Map<String, RssContentMapping> mappings = new HashMap<String, RssContentMapping>();
try {
Map<String, IApsEntity> contentTypes = this.getContentManager().getEntityPrototypes();
Iterator<IApsEntity> contentTypeIter = contentTypes.values().iterator();
while (contentTypeIter.hasNext()) {
IApsEntity contentType = contentTypeIter.next();
AttributeInterface attributeTitle = contentType.getAttributeByRole(JpRssSystemConstants.ATTRIBUTE_ROLE_RSS_CONTENT_TITLE);
if (null != attributeTitle) {
RssContentMapping mapping = new RssContentMapping();
mapping.setContentType(contentType.getTypeCode());
mapping.setTitleAttributeName(attributeTitle.getName());
AttributeInterface attributeDescr = contentType.getAttributeByRole(JpRssSystemConstants.ATTRIBUTE_ROLE_RSS_CONTENT_DESCRIPTION);
if (null != attributeDescr) {
mapping.setDescriptionAttributeName(attributeDescr.getName());
}
mappings.put(contentType.getTypeCode(), mapping);
}
}
} catch (Throwable t) {
ApsSystemUtils.logThrowable(t, this, "loadMappingConfig");
throw new ApsSystemException("Error loading rss content mapping", t);