use of org.olat.commons.info.InfoMessage in project OpenOLAT by OpenOLAT.
the class InfoMessageFrontendManagerImpl method updateInfoMessagesOfIdentity.
@Override
public void updateInfoMessagesOfIdentity(BusinessGroupRef businessGroup, IdentityRef identity) {
List<InfoMessage> infoMessages = infoMessageManager.loadInfoMessagesOfIdentity(businessGroup, identity);
for (InfoMessage infoMessage : infoMessages) {
Identity author = infoMessage.getAuthor();
if (author != null && author.getKey().equals(identity.getKey())) {
((InfoMessageImpl) infoMessage).setAuthor(null);
}
Identity modifier = infoMessage.getModifier();
if (modifier != null && modifier.getKey().equals(identity.getKey())) {
infoMessage.setModifier(null);
}
infoMessageManager.saveInfoMessage(infoMessage);
}
}
use of org.olat.commons.info.InfoMessage in project OpenOLAT by OpenOLAT.
the class InfoMessageFrontendManagerImpl method removeInfoMessagesAndSubscriptionContext.
@Override
public void removeInfoMessagesAndSubscriptionContext(BusinessGroup group) {
List<InfoMessage> messages = infoMessageManager.loadInfoMessageByResource(group, InfoMessageFrontendManager.businessGroupResSubPath, null, null, null, 0, 0);
List<String> pathToDelete = new ArrayList<>();
for (InfoMessage im : messages) {
infoMessageManager.deleteInfoMessage(im);
if (StringHelper.containsNonWhitespace(im.getAttachmentPath())) {
pathToDelete.add(im.getAttachmentPath());
}
}
String resName = group.getResourceableTypeName();
Long resId = group.getResourceableId();
SubscriptionContext subscriptionContext = new SubscriptionContext(resName, resId, "");
infoSubscriptionManager.deleteSubscriptionContext(subscriptionContext);
deleteAttachments(pathToDelete);
}
use of org.olat.commons.info.InfoMessage in project OpenOLAT by OpenOLAT.
the class InfoMessagesWebService method getInfoMessageWebservice.
@Path("{infoMessageKey}")
public InfoMessageWebService getInfoMessageWebservice(@PathParam("infoMessageKey") Long infoMessageKey) {
InfoMessageFrontendManager messageManager = CoreSpringFactory.getImpl(InfoMessageFrontendManager.class);
InfoMessage msg = messageManager.loadInfoMessage(infoMessageKey);
return new InfoMessageWebService(msg);
}
use of org.olat.commons.info.InfoMessage in project OpenOLAT by OpenOLAT.
the class InfoDisplayController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == newInfoLink) {
InfoMessage msg = infoMessageManager.createInfoMessage(ores, resSubPath, businessPath, getIdentity());
start = new CreateInfoStep(ureq, sendMailOptions, msg);
newInfoWizard = new StepsMainRunController(ureq, getWindowControl(), start, new FinishedCallback(), new CancelCallback(), translate("create_message"), "o_sel_info_messages_create_wizard");
listenTo(newInfoWizard);
getWindowControl().pushAsModalDialog(newInfoWizard.getInitialComponent());
} else if (deleteLinks.contains(source)) {
InfoMessage msg = (InfoMessage) source.getUserObject();
popupDelete(ureq, msg);
} else if (editLinks.contains(source)) {
InfoMessage msg = (InfoMessage) source.getUserObject();
popupEdit(ureq, msg);
} else if (source == oldMsgsLink) {
maxResults = -1;
after = null;
loadMessages();
} else if (source == newMsgsLink) {
maxResults = maxResultsConfig;
after = afterConfig;
loadMessages();
} else {
super.formInnerEvent(ureq, source, event);
}
}
use of org.olat.commons.info.InfoMessage in project OpenOLAT by OpenOLAT.
the class InfoPeekViewController method init.
private void init(UserRequest ureq) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(translate("peekview.noInfos"));
tableConfig.setDisplayTableHeader(false);
tableConfig.setCustomCssClass("o_portlet_table");
tableConfig.setDisplayRowCount(false);
tableConfig.setPageingEnabled(false);
tableConfig.setDownloadOffered(false);
tableConfig.setSortingEnabled(false);
removeAsListenerAndDispose(tableController);
tableController = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
tableController.addColumnDescriptor(new CustomRenderColumnDescriptor("peekview.title", 0, null, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, new InfoNodeRenderer()));
String resSubPath = courseNode.getIdent();
List<InfoMessage> infos = infoService.loadInfoMessageByResource(ores, resSubPath, null, null, null, 0, 5);
InfosTableModel model = new InfosTableModel(infos);
tableController.setTableDataModel(model);
listenTo(tableController);
}
Aggregations