use of org.olat.modules.wiki.versioning.HistoryTableDateModel 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.wiki.versioning.HistoryTableDateModel 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);
}
Aggregations