Search in sources :

Example 81 with FeedImpl

use of org.olat.modules.webFeed.model.FeedImpl in project openolat by klemens.

the class RomeFeedFetcherTest method justifiyFeed_externalImageIsNull.

@Test
public void justifiyFeed_externalImageIsNull() {
    String urlOld = "http://example.com/image1.jpg";
    Feed feed = new FeedImpl(oresMock);
    feed.setExternalImageURL(urlOld);
    when(syndFeedMock.getImage()).thenReturn(null);
    Feed justifiedFeed = sut.justifyFeed(feed, syndFeedMock);
    assertThat(justifiedFeed.getExternalImageURL()).isNull();
}
Also used : FeedImpl(org.olat.modules.webFeed.model.FeedImpl) SyndFeed(com.rometools.rome.feed.synd.SyndFeed) Feed(org.olat.modules.webFeed.Feed) Test(org.junit.Test)

Example 82 with FeedImpl

use of org.olat.modules.webFeed.model.FeedImpl in project openolat by klemens.

the class FeedDAO method copyFeed.

public Feed copyFeed(OLATResourceable source, OLATResourceable target) {
    if (source == null || target == null)
        return null;
    FeedImpl feed = (FeedImpl) loadFeed(source);
    dbInstance.getCurrentEntityManager().detach(feed);
    feed.setKey(null);
    feed.setResourceableId(target.getResourceableId());
    feed.setResourceableType(target.getResourceableTypeName());
    dbInstance.getCurrentEntityManager().persist(feed);
    return feed;
}
Also used : FeedImpl(org.olat.modules.webFeed.model.FeedImpl)

Aggregations

FeedImpl (org.olat.modules.webFeed.model.FeedImpl)82 Feed (org.olat.modules.webFeed.Feed)76 Test (org.junit.Test)74 BlogFileResource (org.olat.fileresource.types.BlogFileResource)58 Item (org.olat.modules.webFeed.Item)38 ItemImpl (org.olat.modules.webFeed.model.ItemImpl)36 VFSContainer (org.olat.core.util.vfs.VFSContainer)22 SyndFeed (com.rometools.rome.feed.synd.SyndFeed)8 Date (java.util.Date)6 OLATResource (org.olat.resource.OLATResource)4 Path (java.nio.file.Path)2 GregorianCalendar (java.util.GregorianCalendar)2 Before (org.junit.Before)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2