Search in sources :

Example 1 with FeedItemDisplayConfig

use of org.olat.modules.webFeed.ui.FeedItemDisplayConfig in project openolat by klemens.

the class LiveBlogArtefactHandler method getSpecialMapViewController.

/**
 * @see org.olat.portfolio.EPAbstractHandler#getSpecialMapViewController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
 */
@Override
public Controller getSpecialMapViewController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact) {
    boolean isOwner = ureq.getIdentity().equalsByPersistableKey(artefact.getAuthor());
    FeedSecurityCallback callback = new FeedResourceSecurityCallback(ureq.getUserSession().getRoles().isOLATAdmin(), isOwner);
    String businessPath = artefact.getBusinessPath();
    Long resid = Long.parseLong(businessPath.substring(10, businessPath.length() - 1));
    OLATResource ores = OLATResourceManager.getInstance().findResourceable(resid, BlogFileResource.TYPE_NAME);
    FeedItemDisplayConfig displayConfig = new FeedItemDisplayConfig(false, true, true);
    return BlogUIFactory.getInstance(ureq.getLocale()).createMainController(ores, ureq, wControl, callback, displayConfig);
}
Also used : FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) OLATResource(org.olat.resource.OLATResource) FeedItemDisplayConfig(org.olat.modules.webFeed.ui.FeedItemDisplayConfig) FeedResourceSecurityCallback(org.olat.modules.webFeed.FeedResourceSecurityCallback)

Example 2 with FeedItemDisplayConfig

use of org.olat.modules.webFeed.ui.FeedItemDisplayConfig in project OpenOLAT by OpenOLAT.

the class LiveBlogArtefactHandler method getSpecialMapViewController.

/**
 * @see org.olat.portfolio.EPAbstractHandler#getSpecialMapViewController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
 */
@Override
public Controller getSpecialMapViewController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact) {
    boolean isOwner = ureq.getIdentity().equalsByPersistableKey(artefact.getAuthor());
    FeedSecurityCallback callback = new FeedResourceSecurityCallback(ureq.getUserSession().getRoles().isOLATAdmin(), isOwner);
    String businessPath = artefact.getBusinessPath();
    Long resid = Long.parseLong(businessPath.substring(10, businessPath.length() - 1));
    OLATResource ores = OLATResourceManager.getInstance().findResourceable(resid, BlogFileResource.TYPE_NAME);
    FeedItemDisplayConfig displayConfig = new FeedItemDisplayConfig(false, true, true);
    return BlogUIFactory.getInstance(ureq.getLocale()).createMainController(ores, ureq, wControl, callback, displayConfig);
}
Also used : FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) OLATResource(org.olat.resource.OLATResource) FeedItemDisplayConfig(org.olat.modules.webFeed.ui.FeedItemDisplayConfig) FeedResourceSecurityCallback(org.olat.modules.webFeed.FeedResourceSecurityCallback)

Example 3 with FeedItemDisplayConfig

use of org.olat.modules.webFeed.ui.FeedItemDisplayConfig in project OpenOLAT by OpenOLAT.

the class LiveBlogArtefactHandler method createDetailsController.

@Override
public Controller createDetailsController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact, boolean readOnlyMode) {
    FeedSecurityCallback callback = new FeedResourceSecurityCallback(false, false);
    String businessPath = artefact.getBusinessPath();
    Long resid = Long.parseLong(businessPath.substring(10, businessPath.length() - 1));
    OLATResource ores = OLATResourceManager.getInstance().findResourceable(resid, BlogFileResource.TYPE_NAME);
    FeedItemDisplayConfig displayConfig = new FeedItemDisplayConfig(false, false, readOnlyMode);
    FeedMainController detailsController = BlogUIFactory.getInstance(ureq.getLocale()).createMainController(ores, ureq, wControl, callback, displayConfig);
    return detailsController;
}
Also used : FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) OLATResource(org.olat.resource.OLATResource) FeedItemDisplayConfig(org.olat.modules.webFeed.ui.FeedItemDisplayConfig) FeedResourceSecurityCallback(org.olat.modules.webFeed.FeedResourceSecurityCallback)

Example 4 with FeedItemDisplayConfig

use of org.olat.modules.webFeed.ui.FeedItemDisplayConfig in project openolat by klemens.

the class LiveBlogArtefactHandler method createDetailsController.

@Override
public Controller createDetailsController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact, boolean readOnlyMode) {
    FeedSecurityCallback callback = new FeedResourceSecurityCallback(false, false);
    String businessPath = artefact.getBusinessPath();
    Long resid = Long.parseLong(businessPath.substring(10, businessPath.length() - 1));
    OLATResource ores = OLATResourceManager.getInstance().findResourceable(resid, BlogFileResource.TYPE_NAME);
    FeedItemDisplayConfig displayConfig = new FeedItemDisplayConfig(false, false, readOnlyMode);
    FeedMainController detailsController = BlogUIFactory.getInstance(ureq.getLocale()).createMainController(ores, ureq, wControl, callback, displayConfig);
    return detailsController;
}
Also used : FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) OLATResource(org.olat.resource.OLATResource) FeedItemDisplayConfig(org.olat.modules.webFeed.ui.FeedItemDisplayConfig) FeedResourceSecurityCallback(org.olat.modules.webFeed.FeedResourceSecurityCallback)

Aggregations

FeedResourceSecurityCallback (org.olat.modules.webFeed.FeedResourceSecurityCallback)4 FeedSecurityCallback (org.olat.modules.webFeed.FeedSecurityCallback)4 FeedItemDisplayConfig (org.olat.modules.webFeed.ui.FeedItemDisplayConfig)4 OLATResource (org.olat.resource.OLATResource)4 FeedMainController (org.olat.modules.webFeed.ui.FeedMainController)2