Search in sources :

Example 1 with MailingListMessage

use of com.axelor.apps.base.db.MailingListMessage in project axelor-open-suite by axelor.

the class MailingListMessageBaseRepository method populate.

@Override
public Map<String, Object> populate(Map<String, Object> json, Map<String, Object> context) {
    if (json != null && json.get("id") != null) {
        final MailingListMessage entity = find((Long) json.get("id"));
        final MailFollowerRepository followers = Beans.get(MailFollowerRepository.class);
        final MailFollower follower = followers.findOne(entity, AuthUtils.getUser());
        json.put("_following", follower != null && follower.getArchived() == Boolean.FALSE);
        json.put("_image", entity.getImage() != null);
    }
    return json;
}
Also used : MailingListMessage(com.axelor.apps.base.db.MailingListMessage) MailFollowerRepository(com.axelor.mail.db.repo.MailFollowerRepository) MailFollower(com.axelor.mail.db.MailFollower)

Aggregations

MailingListMessage (com.axelor.apps.base.db.MailingListMessage)1 MailFollower (com.axelor.mail.db.MailFollower)1 MailFollowerRepository (com.axelor.mail.db.repo.MailFollowerRepository)1