*/
private Activity getActivityFromATOMEntry(final Feed feed, final SyndEntryImpl inEntry,
final FeedObjectActivityBuilder inSelectedObjectMapper)
{
SyndEntryImpl entry = inEntry;
FeedObjectActivityBuilder selectedObjectMapper = inSelectedObjectMapper;
Activity activity = new Activity();
activity.setAppType(EntityType.PLUGIN);
activity.setAppId(feed.getPlugin().getId());
activity.setAppSource(feed.getUrl());
final Map<String, GeneralGadgetDefinition> gadgetDefs = //
new HashMap<String, GeneralGadgetDefinition>();
gadgetDefs.put(feed.getPlugin().getUrl(), feed.getPlugin());
try
{
List<GadgetMetaDataDTO> meta = metaDataFetcher.getGadgetsMetaData(gadgetDefs);
if (meta.size() > 0)
{
activity.setAppName(meta.get(0).getTitle());
}
}
catch (Exception ex)
{
log.error("Error getting plugin definition");
activity.setAppName(feed.getTitle());
}
activity.setPostedTime(entry.getPublishedDate());
activity.setUpdated(entry.getUpdatedDate());
activity.setVerb(ActivityVerb.POST);
if (selectedObjectMapper == null)
{
BaseObjectType type = feed.getPlugin().getObjectType();
ActivityStreamsModule activityModule = (ActivityStreamsModule) entry.getModule(ActivityStreamsModule.URI);
if (activityModule != null)
{
type = BaseObjectType.valueOf(activityModule.getObjectType());
entry = activityModule.getAtomEntry();
}
if (!standardFeedMappers.containsKey(type))
{
type = BaseObjectType.NOTE;
}
selectedObjectMapper = standardFeedMappers.get(type);
}
selectedObjectMapper.build(feed, entry, activity);
return activity;
}