Package org.eurekastreams.server.service.actions.strategies.activity.plugins

Examples of org.eurekastreams.server.service.actions.strategies.activity.plugins.FeedObjectActivityBuilder


     *             exception feed throws.
     */
    @Test
    public void withSpecificMapper() throws Exception
    {
        final FeedObjectActivityBuilder flickrObjectMapper = context.mock(FeedObjectActivityBuilder.class);
        final SyndEntryImpl entry1 = context.mock(SyndEntryImpl.class, "e1");
        final List<SyndEntryImpl> entryList = Collections.singletonList(entry1);

        setupNoSyMod();
        setupFetchAnonymous();
View Full Code Here


            {
                requestorAccounts.add(feedSubscriber.getRequestor().getAccountId());
            }
            Map<String, SyndFeed> syndFeeds = feedFetcherFactory.getSyndicatedFeed(feed.getUrl(), requestorAccounts);

            FeedObjectActivityBuilder selectedObjectMapper = null;
            for (ObjectBuilderForSpecificUrl entry : specificUrlMappers)
            {
                if (entry.match(feed.getUrl()))
                {
                    selectedObjectMapper = entry.getBuilder();
View Full Code Here

     */
    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;
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.service.actions.strategies.activity.plugins.FeedObjectActivityBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.