Search in sources :

Example 6 with InfoMessageImpl

use of org.olat.commons.info.model.InfoMessageImpl in project openolat by klemens.

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);
    }
}
Also used : InfoMessage(org.olat.commons.info.InfoMessage) InfoMessageImpl(org.olat.commons.info.model.InfoMessageImpl) Identity(org.olat.core.id.Identity)

Aggregations

InfoMessageImpl (org.olat.commons.info.model.InfoMessageImpl)6 Identity (org.olat.core.id.Identity)4 CollaborationTools (org.olat.collaboration.CollaborationTools)2 InfoMessage (org.olat.commons.info.InfoMessage)2 Translator (org.olat.core.gui.translator.Translator)2 Property (org.olat.properties.Property)2