use of org.olat.modules.fo.ui.ForumController in project OpenOLAT by OpenOLAT.
the class ForumUIFactory method getTitledForumController.
/**
* Provides a ForumController wrapped in a titled controller.
* @param ureq
* @param forum
* @param forumCallback
* @param title
* @return a TitledWrapperController
*/
public static Controller getTitledForumController(UserRequest ureq, WindowControl wControl, Forum forum, ForumCallback forumCallback, TitleInfo titleInfo) {
ForumController popupFoCtr = new ForumController(ureq, wControl, forum, forumCallback, true);
TitledWrapperController forumWrapperController = new TitledWrapperController(ureq, wControl, popupFoCtr, "o_course_run", titleInfo);
// Set CSS values to default forum icons if no values are set in the title info
if (!StringHelper.containsNonWhitespace(titleInfo.getIconCssClass())) {
forumWrapperController.setIconCssClass(ForumHelper.CSS_ICON_CLASS_FORUM);
}
return forumWrapperController;
}
use of org.olat.modules.fo.ui.ForumController in project OpenOLAT by OpenOLAT.
the class WikiMainController method selectTab.
private void selectTab(UserRequest ureq, String command, String compName, WikiPage page, Wiki wiki) {
// first release a potential lock on this page. only when the edit tab
// is acitve
// a lock will be created. in all other cases it is save to release an
// existing lock
doReleaseEditLock();
if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED)) {
updatePageContext(ureq, page);
}
if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED) && compName.equals("vc_article")) {
/**
*********************************************************************
* tabbed pane change to article
*********************************************************************
*/
// if(page.getContent().equals(""))
// wikiArticleComp.setVisible(false);
// FIXME:guido: ... && comp == articleContent)) etc.
} else if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED) && compName.equals("vc_edit")) {
/**
*********************************************************************
* tabbed pane change to edit tab
*********************************************************************
*/
wikiEditForm.resetUpdateComment();
updateFileAndLinkList(wiki);
// try to edit acquire lock for this page
tryToSetEditLock(page, ureq, ores);
} else if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED) && compName.equals("vc_versions")) {
/**
*********************************************************************
* tabbed pane change to versioning tab
*********************************************************************
*/
versioningTableModel = new HistoryTableDateModel(wiki.getHistory(page), getTranslator());
removeAsListenerAndDispose(versioningTableCtr);
versioningTableCtr = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
listenTo(versioningTableCtr);
versioningTableModel.addColumnDescriptors(versioningTableCtr);
versioningTableCtr.setTableDataModel(versioningTableModel);
versioningTableCtr.modelChanged();
versioningTableCtr.setSortColumn(1, false);
versioningContent.put("versions", versioningTableCtr.getInitialComponent());
versioningContent.contextPut("diffs", diffs);
} else if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED) && compName.equals("vc_discuss")) {
/**
*********************************************************************
* tabbed pane change to discussion tab
*********************************************************************
*/
Forum forum = null;
if (page.getForumKey() > 0) {
forum = ForumManager.getInstance().loadForum(Long.valueOf(page.getForumKey()));
}
if (forum == null) {
forum = ForumManager.getInstance().addAForum();
page.setForumKey(forum.getKey().longValue());
WikiManager.getInstance().updateWikiPageProperties(ores, page);
}
ForumCallback forumCallback = securityCallback.getForumCallback();
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(forum);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
removeAsListenerAndDispose(forumController);
forumController = new ForumController(ureq, bwControl, forum, forumCallback, false);
listenTo(forumController);
discussionContent.put("articleforum", forumController.getInitialComponent());
}
OLATResourceable pageRes = OresHelper.createOLATResourceableTypeWithoutCheck("path=" + page.getPageName());
WindowControl wc = addToHistory(ureq, pageRes, null);
OLATResourceable tabOres = tabs.getTabResource();
addToHistory(ureq, tabOres, null, wc, true);
}
use of org.olat.modules.fo.ui.ForumController in project OpenOLAT by OpenOLAT.
the class ForumUIFactory method getPopupableForumController.
/**
* Provides a popable ForumController wrapped in a titled controller.
* @param ureq
* @param forum
* @param forumCallback
* @param title
* @return a ChiefController
*/
public static PopupBrowserWindow getPopupableForumController(UserRequest ureq, WindowControl wControl, final Forum forum, final ForumCallback forumCallback, final TitleInfo titleInfo) {
ControllerCreator ctrlCreator = new ControllerCreator() {
public Controller createController(UserRequest lureq, WindowControl lwControl) {
Controller forumWrapperController = getTitledForumController(lureq, lwControl, forum, forumCallback, titleInfo);
// use on column layout
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, forumWrapperController);
// dispose content on layout dispose
layoutCtr.addDisposableChildController(forumWrapperController);
return layoutCtr;
}
};
// wrap the content controller into a full header layout
ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
PopupBrowserWindow pbw = wControl.getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
return pbw;
}
use of org.olat.modules.fo.ui.ForumController in project openolat by klemens.
the class WikiMainController method selectTab.
private void selectTab(UserRequest ureq, String command, String compName, WikiPage page, Wiki wiki) {
// first release a potential lock on this page. only when the edit tab
// is acitve
// a lock will be created. in all other cases it is save to release an
// existing lock
doReleaseEditLock();
if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED)) {
updatePageContext(ureq, page);
}
if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED) && compName.equals("vc_article")) {
/**
*********************************************************************
* tabbed pane change to article
*********************************************************************
*/
// if(page.getContent().equals(""))
// wikiArticleComp.setVisible(false);
// FIXME:guido: ... && comp == articleContent)) etc.
} else if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED) && compName.equals("vc_edit")) {
/**
*********************************************************************
* tabbed pane change to edit tab
*********************************************************************
*/
wikiEditForm.resetUpdateComment();
updateFileAndLinkList(wiki);
// try to edit acquire lock for this page
tryToSetEditLock(page, ureq, ores);
} else if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED) && compName.equals("vc_versions")) {
/**
*********************************************************************
* tabbed pane change to versioning tab
*********************************************************************
*/
versioningTableModel = new HistoryTableDateModel(wiki.getHistory(page), getTranslator());
removeAsListenerAndDispose(versioningTableCtr);
versioningTableCtr = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
listenTo(versioningTableCtr);
versioningTableModel.addColumnDescriptors(versioningTableCtr);
versioningTableCtr.setTableDataModel(versioningTableModel);
versioningTableCtr.modelChanged();
versioningTableCtr.setSortColumn(1, false);
versioningContent.put("versions", versioningTableCtr.getInitialComponent());
versioningContent.contextPut("diffs", diffs);
} else if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED) && compName.equals("vc_discuss")) {
/**
*********************************************************************
* tabbed pane change to discussion tab
*********************************************************************
*/
Forum forum = null;
if (page.getForumKey() > 0) {
forum = ForumManager.getInstance().loadForum(Long.valueOf(page.getForumKey()));
}
if (forum == null) {
forum = ForumManager.getInstance().addAForum();
page.setForumKey(forum.getKey().longValue());
WikiManager.getInstance().updateWikiPageProperties(ores, page);
}
ForumCallback forumCallback = securityCallback.getForumCallback();
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(forum);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
removeAsListenerAndDispose(forumController);
forumController = new ForumController(ureq, bwControl, forum, forumCallback, false);
listenTo(forumController);
discussionContent.put("articleforum", forumController.getInitialComponent());
}
OLATResourceable pageRes = OresHelper.createOLATResourceableTypeWithoutCheck("path=" + page.getPageName());
WindowControl wc = addToHistory(ureq, pageRes, null);
OLATResourceable tabOres = tabs.getTabResource();
addToHistory(ureq, tabOres, null, wc, true);
}
use of org.olat.modules.fo.ui.ForumController in project openolat by klemens.
the class ForumUIFactory method getTitledForumController.
/**
* Provides a ForumController wrapped in a titled controller.
* @param ureq
* @param forum
* @param forumCallback
* @param title
* @return a TitledWrapperController
*/
public static Controller getTitledForumController(UserRequest ureq, WindowControl wControl, Forum forum, ForumCallback forumCallback, TitleInfo titleInfo) {
ForumController popupFoCtr = new ForumController(ureq, wControl, forum, forumCallback, true);
TitledWrapperController forumWrapperController = new TitledWrapperController(ureq, wControl, popupFoCtr, "o_course_run", titleInfo);
// Set CSS values to default forum icons if no values are set in the title info
if (!StringHelper.containsNonWhitespace(titleInfo.getIconCssClass())) {
forumWrapperController.setIconCssClass(ForumHelper.CSS_ICON_CLASS_FORUM);
}
return forumWrapperController;
}
Aggregations