Search in sources :

Example 1 with MediaPart

use of org.olat.modules.portfolio.model.MediaPart in project OpenOLAT by OpenOLAT.

the class MediaUploadController method getPageElement.

@Override
public PageElement getPageElement() {
    MediaPart part = new MediaPart();
    part.setMedia(mediaReference);
    return part;
}
Also used : MediaPart(org.olat.modules.portfolio.model.MediaPart)

Example 2 with MediaPart

use of org.olat.modules.portfolio.model.MediaPart in project OpenOLAT by OpenOLAT.

the class CollectVideoMediaController method getPageElement.

@Override
public PageElement getPageElement() {
    MediaPart part = new MediaPart();
    part.setMedia(mediaReference);
    return part;
}
Also used : MediaPart(org.olat.modules.portfolio.model.MediaPart)

Example 3 with MediaPart

use of org.olat.modules.portfolio.model.MediaPart in project OpenOLAT by OpenOLAT.

the class CollectFileMediaController method getPageElement.

@Override
public PageElement getPageElement() {
    MediaPart part = new MediaPart();
    part.setMedia(mediaReference);
    return part;
}
Also used : MediaPart(org.olat.modules.portfolio.model.MediaPart)

Example 4 with MediaPart

use of org.olat.modules.portfolio.model.MediaPart in project OpenOLAT by OpenOLAT.

the class MediaDAOTest method usedInBinders.

@Test
public void usedInBinders() {
    Identity author = JunitTestHelper.createAndPersistIdentityAsRndUser("pf-media-2");
    Binder binder = portfolioService.createNewBinder("Binder p2", "A binder with 2 page", null, author);
    Section section = binderDao.createSection("Section", "First section", null, null, binder);
    dbInstance.commitAndCloseSession();
    Section reloadedSection = binderDao.loadSectionByKey(section.getKey());
    Page page = pageDao.createAndPersist("Page 1", "A page with content.", null, null, true, reloadedSection, null);
    Media media = mediaDao.createMedia("Media", "Binder", "Une citation sur les classeurs", TextHandler.TEXT_MEDIA, "[Media:0]", null, 10, author);
    dbInstance.commitAndCloseSession();
    MediaPart mediaPart = new MediaPart();
    mediaPart.setMedia(media);
    PageBody reloadedBody = pageDao.loadPageBodyByKey(page.getBody().getKey());
    pageDao.persistPart(reloadedBody, mediaPart);
    dbInstance.commitAndCloseSession();
    // reload
    List<BinderPageUsage> binders = mediaDao.usedInBinders(media);
    Assert.assertNotNull(binders);
    Assert.assertEquals(1, binders.size());
    Assert.assertTrue(binders.get(0).getBinderKey().equals(binder.getKey()));
}
Also used : Binder(org.olat.modules.portfolio.Binder) MediaPart(org.olat.modules.portfolio.model.MediaPart) BinderPageUsage(org.olat.modules.portfolio.model.BinderPageUsage) Media(org.olat.modules.portfolio.Media) Page(org.olat.modules.portfolio.Page) Identity(org.olat.core.id.Identity) Section(org.olat.modules.portfolio.Section) PageBody(org.olat.modules.portfolio.PageBody) Test(org.junit.Test)

Example 5 with MediaPart

use of org.olat.modules.portfolio.model.MediaPart in project openolat by klemens.

the class MediaDAOTest method usedInBinders.

@Test
public void usedInBinders() {
    Identity author = JunitTestHelper.createAndPersistIdentityAsRndUser("pf-media-2");
    Binder binder = portfolioService.createNewBinder("Binder p2", "A binder with 2 page", null, author);
    Section section = binderDao.createSection("Section", "First section", null, null, binder);
    dbInstance.commitAndCloseSession();
    Section reloadedSection = binderDao.loadSectionByKey(section.getKey());
    Page page = pageDao.createAndPersist("Page 1", "A page with content.", null, null, true, reloadedSection, null);
    Media media = mediaDao.createMedia("Media", "Binder", "Une citation sur les classeurs", TextHandler.TEXT_MEDIA, "[Media:0]", null, 10, author);
    dbInstance.commitAndCloseSession();
    MediaPart mediaPart = new MediaPart();
    mediaPart.setMedia(media);
    PageBody reloadedBody = pageDao.loadPageBodyByKey(page.getBody().getKey());
    pageDao.persistPart(reloadedBody, mediaPart);
    dbInstance.commitAndCloseSession();
    // reload
    List<BinderPageUsage> binders = mediaDao.usedInBinders(media);
    Assert.assertNotNull(binders);
    Assert.assertEquals(1, binders.size());
    Assert.assertTrue(binders.get(0).getBinderKey().equals(binder.getKey()));
}
Also used : Binder(org.olat.modules.portfolio.Binder) MediaPart(org.olat.modules.portfolio.model.MediaPart) BinderPageUsage(org.olat.modules.portfolio.model.BinderPageUsage) Media(org.olat.modules.portfolio.Media) Page(org.olat.modules.portfolio.Page) Identity(org.olat.core.id.Identity) Section(org.olat.modules.portfolio.Section) PageBody(org.olat.modules.portfolio.PageBody) Test(org.junit.Test)

Aggregations

MediaPart (org.olat.modules.portfolio.model.MediaPart)14 Test (org.junit.Test)2 Identity (org.olat.core.id.Identity)2 Binder (org.olat.modules.portfolio.Binder)2 Media (org.olat.modules.portfolio.Media)2 Page (org.olat.modules.portfolio.Page)2 PageBody (org.olat.modules.portfolio.PageBody)2 Section (org.olat.modules.portfolio.Section)2 BinderPageUsage (org.olat.modules.portfolio.model.BinderPageUsage)2