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;
}
});
}
}
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);
}
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;
}
});
}
}
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);
}
Aggregations