Search in sources :

Example 1 with PortfolioV2Module

use of org.olat.modules.portfolio.PortfolioV2Module in project OpenOLAT by OpenOLAT.

the class CollaborationTools method createPortfolioController.

/**
 * return an controller for the wiki tool
 * @param ureq
 * @param wControl
 * @return
 */
public Controller createPortfolioController(final UserRequest ureq, final WindowControl wControl, final TooledStackedPanel stackPanel, final BusinessGroup group) {
    final NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(ores);
    Property mapProperty = npm.findProperty(null, null, PROP_CAT_BG_COLLABTOOLS, KEY_PORTFOLIO);
    if (mapProperty != null) {
        return createPortfolioController(ureq, wControl, stackPanel, mapProperty);
    } else {
        return coordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerCallback<Controller>() {

            @Override
            public Controller execute() {
                Controller ctrl;
                Property mapKeyProperty = npm.findProperty(null, null, PROP_CAT_BG_COLLABTOOLS, KEY_PORTFOLIO);
                if (mapKeyProperty == null) {
                    PortfolioV2Module moduleV2 = CoreSpringFactory.getImpl(PortfolioV2Module.class);
                    if (moduleV2.isEnabled()) {
                        PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
                        Binder binder = portfolioService.createNewBinder(group.getName(), group.getDescription(), null, null);
                        CoreSpringFactory.getImpl(BinderUserInformationsDAO.class).updateBinderUserInformationsInSync(binder, ureq.getIdentity());
                        mapKeyProperty = npm.createPropertyInstance(null, null, PROP_CAT_BG_COLLABTOOLS, KEY_PORTFOLIO, null, binder.getKey(), "2", null);
                        BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForBusinessGroup();
                        BinderController binderCtrl = new BinderController(ureq, wControl, stackPanel, secCallback, binder, BinderConfiguration.createBusinessGroupConfig());
                        List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromResourceType("Toc");
                        binderCtrl.activate(ureq, entries, null);
                        ctrl = binderCtrl;
                        ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(binder));
                        ThreadLocalUserActivityLogger.log(PortfolioLoggingAction.PORTFOLIO_BINDER_CREATED, getClass());
                    } else {
                        EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
                        PortfolioStructureMap map = ePFMgr.createAndPersistPortfolioDefaultMap(group.getName(), group.getDescription());
                        Translator pT = Util.createPackageTranslator(EPCreateMapController.class, ureq.getLocale());
                        // add a page, as each map should have at least one per default!
                        ePFMgr.createAndPersistPortfolioPage(map, pT.translate("new.page.title"), pT.translate("new.page.desc"));
                        mapKeyProperty = npm.createPropertyInstance(null, null, PROP_CAT_BG_COLLABTOOLS, KEY_PORTFOLIO, null, map.getKey(), null, null);
                        EPSecurityCallback secCallback = new EPSecurityCallbackImpl(true, true);
                        ctrl = EPUIFactory.createMapViewController(ureq, wControl, map, secCallback);
                    }
                    npm.saveProperty(mapKeyProperty);
                } else {
                    ctrl = createPortfolioController(ureq, wControl, stackPanel, mapProperty);
                }
                return ctrl;
            }
        });
    }
}
Also used : PortfolioStructureMap(org.olat.portfolio.model.structel.PortfolioStructureMap) PortfolioV2Module(org.olat.modules.portfolio.PortfolioV2Module) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) WeeklyCalendarController(org.olat.commons.calendar.ui.WeeklyCalendarController) EPCreateMapController(org.olat.portfolio.ui.structel.EPCreateMapController) OpenMeetingsRunController(org.olat.modules.openmeetings.ui.OpenMeetingsRunController) ChatToolController(org.olat.instantMessaging.ui.ChatToolController) CourseLinkProviderController(org.olat.course.run.calendar.CourseLinkProviderController) BinderController(org.olat.modules.portfolio.ui.BinderController) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) ContactFormController(org.olat.modules.co.ContactFormController) Controller(org.olat.core.gui.control.Controller) CalendarController(org.olat.commons.calendar.ui.CalendarController) InfoGroupRunController(org.olat.group.ui.run.InfoGroupRunController) EPSecurityCallbackImpl(org.olat.portfolio.EPSecurityCallbackImpl) EPFrontendManager(org.olat.portfolio.manager.EPFrontendManager) Binder(org.olat.modules.portfolio.Binder) PortfolioService(org.olat.modules.portfolio.PortfolioService) BinderController(org.olat.modules.portfolio.ui.BinderController) Translator(org.olat.core.gui.translator.Translator) EPCreateMapController(org.olat.portfolio.ui.structel.EPCreateMapController) EPSecurityCallback(org.olat.portfolio.EPSecurityCallback) ArrayList(java.util.ArrayList) List(java.util.List) NarrowedPropertyManager(org.olat.properties.NarrowedPropertyManager) Property(org.olat.properties.Property)

Example 2 with PortfolioV2Module

use of org.olat.modules.portfolio.PortfolioV2Module in project OpenOLAT by OpenOLAT.

the class CollaborationToolsFactory method initAvailableTools.

/**
 * Helper method to initialize the list of enabled tools based system wide
 * configuration.
 */
public synchronized void initAvailableTools() {
    ArrayList<String> toolArr = new ArrayList<String>();
    toolArr.add(CollaborationTools.TOOL_NEWS);
    toolArr.add(CollaborationTools.TOOL_CONTACT);
    CalendarModule calendarModule = CoreSpringFactory.getImpl(CalendarModule.class);
    if (calendarModule.isEnabled() && calendarModule.isEnableGroupCalendar()) {
        toolArr.add(CollaborationTools.TOOL_CALENDAR);
    }
    toolArr.add(CollaborationTools.TOOL_FOLDER);
    toolArr.add(CollaborationTools.TOOL_FORUM);
    if (CoreSpringFactory.getImpl(InstantMessagingModule.class).isEnabled()) {
        toolArr.add(CollaborationTools.TOOL_CHAT);
    }
    BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
    if (securityModule.isWikiEnabled()) {
        toolArr.add(CollaborationTools.TOOL_WIKI);
    }
    PortfolioModule portfolioModule = CoreSpringFactory.getImpl(PortfolioModule.class);
    PortfolioV2Module portfolioV2Module = CoreSpringFactory.getImpl(PortfolioV2Module.class);
    if (portfolioModule.isEnabled() || portfolioV2Module.isEnabled()) {
        toolArr.add(CollaborationTools.TOOL_PORTFOLIO);
    }
    OpenMeetingsModule openMeetingsModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
    if (openMeetingsModule.isEnabled()) {
        toolArr.add(CollaborationTools.TOOL_OPENMEETINGS);
    }
    TOOLS = ArrayHelper.toArray(toolArr);
}
Also used : ArrayList(java.util.ArrayList) PortfolioV2Module(org.olat.modules.portfolio.PortfolioV2Module) BaseSecurityModule(org.olat.basesecurity.BaseSecurityModule) CalendarModule(org.olat.commons.calendar.CalendarModule) OpenMeetingsModule(org.olat.modules.openmeetings.OpenMeetingsModule) InstantMessagingModule(org.olat.instantMessaging.InstantMessagingModule) PortfolioModule(org.olat.portfolio.PortfolioModule)

Example 3 with PortfolioV2Module

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

the class CollaborationTools method createPortfolioController.

/**
 * return an controller for the wiki tool
 * @param ureq
 * @param wControl
 * @return
 */
public Controller createPortfolioController(final UserRequest ureq, final WindowControl wControl, final TooledStackedPanel stackPanel, final BusinessGroup group) {
    final NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(ores);
    Property mapProperty = npm.findProperty(null, null, PROP_CAT_BG_COLLABTOOLS, KEY_PORTFOLIO);
    if (mapProperty != null) {
        return createPortfolioController(ureq, wControl, stackPanel, mapProperty);
    } else {
        return coordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerCallback<Controller>() {

            @Override
            public Controller execute() {
                Controller ctrl;
                Property mapKeyProperty = npm.findProperty(null, null, PROP_CAT_BG_COLLABTOOLS, KEY_PORTFOLIO);
                if (mapKeyProperty == null) {
                    PortfolioV2Module moduleV2 = CoreSpringFactory.getImpl(PortfolioV2Module.class);
                    if (moduleV2.isEnabled()) {
                        PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
                        Binder binder = portfolioService.createNewBinder(group.getName(), group.getDescription(), null, null);
                        CoreSpringFactory.getImpl(BinderUserInformationsDAO.class).updateBinderUserInformationsInSync(binder, ureq.getIdentity());
                        mapKeyProperty = npm.createPropertyInstance(null, null, PROP_CAT_BG_COLLABTOOLS, KEY_PORTFOLIO, null, binder.getKey(), "2", null);
                        BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForBusinessGroup();
                        BinderController binderCtrl = new BinderController(ureq, wControl, stackPanel, secCallback, binder, BinderConfiguration.createBusinessGroupConfig());
                        List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromResourceType("Toc");
                        binderCtrl.activate(ureq, entries, null);
                        ctrl = binderCtrl;
                        ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(binder));
                        ThreadLocalUserActivityLogger.log(PortfolioLoggingAction.PORTFOLIO_BINDER_CREATED, getClass());
                    } else {
                        EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
                        PortfolioStructureMap map = ePFMgr.createAndPersistPortfolioDefaultMap(group.getName(), group.getDescription());
                        Translator pT = Util.createPackageTranslator(EPCreateMapController.class, ureq.getLocale());
                        // add a page, as each map should have at least one per default!
                        ePFMgr.createAndPersistPortfolioPage(map, pT.translate("new.page.title"), pT.translate("new.page.desc"));
                        mapKeyProperty = npm.createPropertyInstance(null, null, PROP_CAT_BG_COLLABTOOLS, KEY_PORTFOLIO, null, map.getKey(), null, null);
                        EPSecurityCallback secCallback = new EPSecurityCallbackImpl(true, true);
                        ctrl = EPUIFactory.createMapViewController(ureq, wControl, map, secCallback);
                    }
                    npm.saveProperty(mapKeyProperty);
                } else {
                    ctrl = createPortfolioController(ureq, wControl, stackPanel, mapProperty);
                }
                return ctrl;
            }
        });
    }
}
Also used : PortfolioStructureMap(org.olat.portfolio.model.structel.PortfolioStructureMap) PortfolioV2Module(org.olat.modules.portfolio.PortfolioV2Module) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) WeeklyCalendarController(org.olat.commons.calendar.ui.WeeklyCalendarController) EPCreateMapController(org.olat.portfolio.ui.structel.EPCreateMapController) OpenMeetingsRunController(org.olat.modules.openmeetings.ui.OpenMeetingsRunController) ChatToolController(org.olat.instantMessaging.ui.ChatToolController) CourseLinkProviderController(org.olat.course.run.calendar.CourseLinkProviderController) BinderController(org.olat.modules.portfolio.ui.BinderController) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) ContactFormController(org.olat.modules.co.ContactFormController) Controller(org.olat.core.gui.control.Controller) CalendarController(org.olat.commons.calendar.ui.CalendarController) InfoGroupRunController(org.olat.group.ui.run.InfoGroupRunController) EPSecurityCallbackImpl(org.olat.portfolio.EPSecurityCallbackImpl) EPFrontendManager(org.olat.portfolio.manager.EPFrontendManager) Binder(org.olat.modules.portfolio.Binder) PortfolioService(org.olat.modules.portfolio.PortfolioService) BinderController(org.olat.modules.portfolio.ui.BinderController) Translator(org.olat.core.gui.translator.Translator) EPCreateMapController(org.olat.portfolio.ui.structel.EPCreateMapController) EPSecurityCallback(org.olat.portfolio.EPSecurityCallback) ArrayList(java.util.ArrayList) List(java.util.List) NarrowedPropertyManager(org.olat.properties.NarrowedPropertyManager) Property(org.olat.properties.Property)

Example 4 with PortfolioV2Module

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

the class CollaborationToolsFactory method initAvailableTools.

/**
 * Helper method to initialize the list of enabled tools based system wide
 * configuration.
 */
public synchronized void initAvailableTools() {
    ArrayList<String> toolArr = new ArrayList<String>();
    toolArr.add(CollaborationTools.TOOL_NEWS);
    toolArr.add(CollaborationTools.TOOL_CONTACT);
    CalendarModule calendarModule = CoreSpringFactory.getImpl(CalendarModule.class);
    if (calendarModule.isEnabled() && calendarModule.isEnableGroupCalendar()) {
        toolArr.add(CollaborationTools.TOOL_CALENDAR);
    }
    toolArr.add(CollaborationTools.TOOL_FOLDER);
    toolArr.add(CollaborationTools.TOOL_FORUM);
    if (CoreSpringFactory.getImpl(InstantMessagingModule.class).isEnabled()) {
        toolArr.add(CollaborationTools.TOOL_CHAT);
    }
    BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
    if (securityModule.isWikiEnabled()) {
        toolArr.add(CollaborationTools.TOOL_WIKI);
    }
    PortfolioModule portfolioModule = CoreSpringFactory.getImpl(PortfolioModule.class);
    PortfolioV2Module portfolioV2Module = CoreSpringFactory.getImpl(PortfolioV2Module.class);
    if (portfolioModule.isEnabled() || portfolioV2Module.isEnabled()) {
        toolArr.add(CollaborationTools.TOOL_PORTFOLIO);
    }
    OpenMeetingsModule openMeetingsModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
    if (openMeetingsModule.isEnabled()) {
        toolArr.add(CollaborationTools.TOOL_OPENMEETINGS);
    }
    TOOLS = ArrayHelper.toArray(toolArr);
}
Also used : ArrayList(java.util.ArrayList) PortfolioV2Module(org.olat.modules.portfolio.PortfolioV2Module) BaseSecurityModule(org.olat.basesecurity.BaseSecurityModule) CalendarModule(org.olat.commons.calendar.CalendarModule) OpenMeetingsModule(org.olat.modules.openmeetings.OpenMeetingsModule) InstantMessagingModule(org.olat.instantMessaging.InstantMessagingModule) PortfolioModule(org.olat.portfolio.PortfolioModule)

Aggregations

ArrayList (java.util.ArrayList)4 PortfolioV2Module (org.olat.modules.portfolio.PortfolioV2Module)4 List (java.util.List)2 BaseSecurityModule (org.olat.basesecurity.BaseSecurityModule)2 CalendarModule (org.olat.commons.calendar.CalendarModule)2 CalendarController (org.olat.commons.calendar.ui.CalendarController)2 WeeklyCalendarController (org.olat.commons.calendar.ui.WeeklyCalendarController)2 FolderRunController (org.olat.core.commons.modules.bc.FolderRunController)2 Controller (org.olat.core.gui.control.Controller)2 Translator (org.olat.core.gui.translator.Translator)2 CourseLinkProviderController (org.olat.course.run.calendar.CourseLinkProviderController)2 InfoGroupRunController (org.olat.group.ui.run.InfoGroupRunController)2 InstantMessagingModule (org.olat.instantMessaging.InstantMessagingModule)2 ChatToolController (org.olat.instantMessaging.ui.ChatToolController)2 ContactFormController (org.olat.modules.co.ContactFormController)2 OpenMeetingsModule (org.olat.modules.openmeetings.OpenMeetingsModule)2 OpenMeetingsRunController (org.olat.modules.openmeetings.ui.OpenMeetingsRunController)2 Binder (org.olat.modules.portfolio.Binder)2 BinderSecurityCallback (org.olat.modules.portfolio.BinderSecurityCallback)2 PortfolioService (org.olat.modules.portfolio.PortfolioService)2