use of org.olat.collaboration.CollaborationTools in project openolat by klemens.
the class BusinessGroupMainRunController method buildTreeModel.
/**
* @return The menu tree model
*/
private TreeModel buildTreeModel() {
GenericTreeNode gtnChild, root;
GenericTreeModel gtm = new GenericTreeModel();
root = new GenericTreeNode(nodeIdPrefix.concat("-root"));
root.setTitle(businessGroup.getName());
root.setUserObject(ACTIVITY_MENUSELECT_OVERVIEW);
root.setAltText(translate("menutree.top.alt") + " " + businessGroup.getName());
root.setIconCssClass("o_icon o_icon_group");
gtm.setRootNode(root);
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(this.businessGroup);
if (collabTools.isToolEnabled(CollaborationTools.TOOL_NEWS)) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("new"));
gtnChild.setTitle(translate("menutree.news"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_INFORMATION);
gtnChild.setAltText(translate("menutree.news.alt"));
gtnChild.setIconCssClass("o_icon_news");
gtnChild.setCssClass("o_sel_group_news");
root.addChild(gtnChild);
nodeInformation = gtnChild;
}
if (calendarModule.isEnabled() && calendarModule.isEnableGroupCalendar() && collabTools.isToolEnabled(CollaborationTools.TOOL_CALENDAR)) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("cal"));
gtnChild.setTitle(translate("menutree.calendar"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_CALENDAR);
gtnChild.setAltText(translate("menutree.calendar.alt"));
gtnChild.setIconCssClass("o_calendar_icon");
gtnChild.setCssClass("o_sel_group_calendar");
root.addChild(gtnChild);
nodeCal = gtnChild;
}
boolean hasResources = businessGroupService.hasResources(businessGroup);
if (hasResources) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("courses"));
gtnChild.setTitle(translate("menutree.resources"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_SHOW_RESOURCES);
gtnChild.setAltText(translate("menutree.resources.alt"));
gtnChild.setIconCssClass("o_CourseModule_icon");
gtnChild.setCssClass("o_sel_group_resources");
root.addChild(gtnChild);
nodeResources = gtnChild;
}
if (businessGroup.isOwnersVisibleIntern() || businessGroup.isParticipantsVisibleIntern() || businessGroup.isWaitingListVisibleIntern()) {
// either owners, participants, the waiting list or all three are visible
// otherwise the node is not visible
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("members"));
gtnChild.setTitle(translate("menutree.members"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_MEMBERSLIST);
gtnChild.setAltText(translate("menutree.members.alt"));
gtnChild.setIconCssClass("o_icon_group");
gtnChild.setCssClass("o_sel_group_members");
root.addChild(gtnChild);
nodeGroupOwners = gtnChild;
}
if (collabTools.isToolEnabled(CollaborationTools.TOOL_CONTACT)) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("contact"));
gtnChild.setTitle(translate("menutree.contactform"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_CONTACTFORM);
gtnChild.setAltText(translate("menutree.contactform.alt"));
gtnChild.setIconCssClass("o_co_icon");
gtnChild.setCssClass("o_sel_group_contact");
root.addChild(gtnChild);
nodeContact = gtnChild;
}
if (collabTools.isToolEnabled(CollaborationTools.TOOL_FOLDER)) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("folder"));
gtnChild.setTitle(translate("menutree.folder"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_FOLDER);
gtnChild.setAltText(translate("menutree.folder.alt"));
gtnChild.setIconCssClass("o_bc_icon");
gtnChild.setCssClass("o_sel_group_folder");
root.addChild(gtnChild);
nodeFolder = gtnChild;
}
if (collabTools.isToolEnabled(CollaborationTools.TOOL_FORUM)) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("forum"));
gtnChild.setTitle(translate("menutree.forum"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_FORUM);
gtnChild.setAltText(translate("menutree.forum.alt"));
gtnChild.setIconCssClass("o_fo_icon");
gtnChild.setCssClass("o_sel_group_forum");
root.addChild(gtnChild);
nodeForum = gtnChild;
}
if (chatAvailable) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("chat"));
gtnChild.setTitle(translate("menutree.chat"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_CHAT);
gtnChild.setAltText(translate("menutree.chat.alt"));
gtnChild.setIconCssClass("o_icon_chat");
gtnChild.setCssClass("o_sel_group_chat");
root.addChild(gtnChild);
}
BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
if (collabTools.isToolEnabled(CollaborationTools.TOOL_WIKI) && securityModule.isWikiEnabled()) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("wiki"));
gtnChild.setTitle(translate("menutree.wiki"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_WIKI);
gtnChild.setAltText(translate("menutree.wiki.alt"));
gtnChild.setIconCssClass("o_wiki_icon");
gtnChild.setCssClass("o_sel_group_wiki");
root.addChild(gtnChild);
nodeWiki = gtnChild;
}
if (collabTools.isToolEnabled(CollaborationTools.TOOL_PORTFOLIO) && (portfolioModule.isEnabled() || portfolioV2Module.isEnabled())) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("eportfolio"));
gtnChild.setTitle(translate("menutree.portfolio"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_PORTFOLIO);
gtnChild.setAltText(translate("menutree.portfolio.alt"));
gtnChild.setIconCssClass("o_ep_icon");
gtnChild.setCssClass("o_sel_group_portfolio");
root.addChild(gtnChild);
nodePortfolio = gtnChild;
}
OpenMeetingsModule openMeetingsModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
if (openMeetingsModule.isEnabled() && collabTools.isToolEnabled(CollaborationTools.TOOL_OPENMEETINGS)) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("meetings"));
gtnChild.setTitle(translate("menutree.openmeetings"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_OPENMEETINGS);
gtnChild.setAltText(translate("menutree.openmeetings.alt"));
gtnChild.setIconCssClass("o_openmeetings_icon");
root.addChild(gtnChild);
nodeOpenMeetings = gtnChild;
}
if (isAdmin) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("admin"));
gtnChild.setTitle(translate("menutree.administration"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_ADMINISTRATION);
gtnChild.setIdent(ACTIVITY_MENUSELECT_ADMINISTRATION);
gtnChild.setAltText(translate("menutree.administration.alt"));
gtnChild.setIconCssClass("o_icon_settings");
root.addChild(gtnChild);
adminNodeId = gtnChild.getIdent();
nodeAdmin = gtnChild;
AccessControlModule acModule = (AccessControlModule) CoreSpringFactory.getBean("acModule");
if (acModule.isEnabled() && acService.isResourceAccessControled(businessGroup.getResource(), null)) {
gtnChild = new GenericTreeNode(nodeIdPrefix.concat("ac"));
gtnChild.setTitle(translate("menutree.ac"));
gtnChild.setUserObject(ACTIVITY_MENUSELECT_AC);
gtnChild.setIdent(ACTIVITY_MENUSELECT_AC);
gtnChild.setAltText(translate("menutree.ac.alt"));
gtnChild.setIconCssClass("o_icon_booking");
root.addChild(gtnChild);
}
}
return gtm;
}
use of org.olat.collaboration.CollaborationTools in project openolat by klemens.
the class BusinessGroupMainRunController method doShowMembers.
private void doShowMembers(UserRequest ureq) {
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(this.businessGroup);
boolean canEmail = collabTools.isToolEnabled(CollaborationTools.TOOL_CONTACT);
groupMembersToggleViewController = new GroupMembersRunController(ureq, getWindowControl(), businessGroup, canEmail);
listenTo(groupMembersToggleViewController);
mainPanel.setContent(groupMembersToggleViewController.getInitialComponent());
collabToolCtr = null;
addToHistory(ureq, ORES_TOOLMEMBERS, null);
}
use of org.olat.collaboration.CollaborationTools in project openolat by klemens.
the class BusinessGroupMainRunController method doInformations.
private void doInformations(UserRequest ureq) {
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLMSG);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ce.getOLATResourceable()));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
addToHistory(ureq, bwControl);
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
collabToolCtr = collabTools.createInfoMessageController(ureq, bwControl, isAdmin);
listenTo(collabToolCtr);
mainPanel.setContent(collabToolCtr.getInitialComponent());
}
use of org.olat.collaboration.CollaborationTools in project openolat by klemens.
the class BusinessGroupMainRunController method doWiki.
private Activateable2 doWiki(UserRequest ureq) {
addLoggingResourceable(LoggingResourceable.wrap(ORES_TOOLWIKI, OlatResourceableType.wiki));
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLWIKI);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapWikiOres(ce.getOLATResourceable()));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
addToHistory(ureq, bwControl);
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
collabToolCtr = collabTools.createWikiController(ureq, bwControl);
listenTo(collabToolCtr);
mainPanel.setContent(collabToolCtr.getInitialComponent());
return (Activateable2) collabToolCtr;
}
use of org.olat.collaboration.CollaborationTools in project openolat by klemens.
the class BusinessGroupMainRunController method createContactFormController.
/**
* generates the email adress list.
*
* @param ureq
* @return a contact form controller for this group
*/
private ContactFormController createContactFormController(UserRequest ureq) {
ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
// two named ContactLists, the new way using the contact form
// the same name as in the checkboxes are taken as contactlist names
// = new ContactList(translate("sendtochooser.form.chckbx.owners"));
ContactList ownerCntctLst;
// = new ContactList(translate("sendtochooser.form.chckbx.partip"));
ContactList partipCntctLst;
// = new ContactList(translate("sendtochooser.form.chckbx.waitingList"));
ContactList waitingListContactList;
if (sendToChooserForm.ownerChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_ALL)) {
ownerCntctLst = new ContactList(translate("sendtochooser.form.radio.owners.all"));
List<Identity> ownerList = businessGroupService.getMembers(businessGroup, GroupRoles.coach.name());
ownerCntctLst.addAllIdentites(ownerList);
cmsg.addEmailTo(ownerCntctLst);
} else {
if (sendToChooserForm.ownerChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_CHOOSE)) {
ownerCntctLst = new ContactList(translate("sendtochooser.form.radio.owners.choose"));
List<Identity> ownerList = businessGroupService.getMembers(businessGroup, GroupRoles.coach.name());
List<Identity> changeableOwnerList = new ArrayList<>(ownerList);
for (Identity identity : ownerList) {
boolean keyIsSelected = false;
for (Long key : sendToChooserForm.getSelectedOwnerKeys()) {
if (key.equals(identity.getKey())) {
keyIsSelected = true;
break;
}
}
if (!keyIsSelected) {
changeableOwnerList.remove(changeableOwnerList.indexOf(identity));
}
}
ownerCntctLst.addAllIdentites(changeableOwnerList);
cmsg.addEmailTo(ownerCntctLst);
}
}
if (sendToChooserForm != null) {
if (sendToChooserForm.participantChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_ALL)) {
partipCntctLst = new ContactList(translate("sendtochooser.form.radio.partip.all"));
List<Identity> participantsList = businessGroupService.getMembers(businessGroup, GroupRoles.participant.name());
partipCntctLst.addAllIdentites(participantsList);
cmsg.addEmailTo(partipCntctLst);
} else {
if (sendToChooserForm.participantChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_CHOOSE)) {
partipCntctLst = new ContactList(translate("sendtochooser.form.radio.partip.choose"));
List<Identity> participantsList = businessGroupService.getMembers(businessGroup, GroupRoles.participant.name());
List<Identity> changeableParticipantsList = new ArrayList<>(participantsList);
for (Identity identity : participantsList) {
boolean keyIsSelected = false;
for (Long key : sendToChooserForm.getSelectedPartipKeys()) {
if (key.equals(identity.getKey())) {
keyIsSelected = true;
break;
}
}
if (!keyIsSelected) {
changeableParticipantsList.remove(changeableParticipantsList.indexOf(identity));
}
}
partipCntctLst.addAllIdentites(changeableParticipantsList);
cmsg.addEmailTo(partipCntctLst);
}
}
}
if (sendToChooserForm != null && isAdmin && businessGroup.getWaitingListEnabled().booleanValue()) {
if (sendToChooserForm.waitingListChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_ALL)) {
waitingListContactList = new ContactList(translate("sendtochooser.form.radio.waitings.all"));
List<Identity> waitingListIdentities = businessGroupService.getMembers(businessGroup, GroupRoles.waiting.name());
waitingListContactList.addAllIdentites(waitingListIdentities);
cmsg.addEmailTo(waitingListContactList);
} else {
if (sendToChooserForm.waitingListChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_CHOOSE)) {
waitingListContactList = new ContactList(translate("sendtochooser.form.radio.waitings.choose"));
List<Identity> waitingListIdentities = businessGroupService.getMembers(businessGroup, GroupRoles.waiting.name());
List<Identity> changeableWaitingListIdentities = new ArrayList<>(waitingListIdentities);
for (Identity indentity : waitingListIdentities) {
boolean keyIsSelected = false;
for (Long key : sendToChooserForm.getSelectedWaitingKeys()) {
if (key.equals(indentity.getKey())) {
keyIsSelected = true;
break;
}
}
if (!keyIsSelected) {
changeableWaitingListIdentities.remove(changeableWaitingListIdentities.indexOf(indentity));
}
}
waitingListContactList.addAllIdentites(changeableWaitingListIdentities);
cmsg.addEmailTo(waitingListContactList);
}
}
}
cmsg.setSubject(translate("businessgroup.contact.subject", businessGroup.getName()));
if (sendToChooserForm.waitingListChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_NOTHING)) {
String restUrl = BusinessControlFactory.getInstance().getAsURIString(getWindowControl().getBusinessControl(), true);
cmsg.setBodyText(getTranslator().translate("businessgroup.contact.bodytext", new String[] { businessGroup.getName(), "<a href='" + restUrl + "'>" + restUrl + "</a>" }));
} else {
cmsg.setBodyText("");
}
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
return collabTools.createContactFormController(ureq, getWindowControl(), cmsg);
}
Aggregations