Search in sources :

Example 1 with NotificationProblem

use of org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem in project vorto by eclipse.

the class RequestAccessToNamespaceMessage method getContent.

@Override
public String getContent() {
    Map<String, Object> map = new HashMap<>();
    map.put("host", host);
    map.put("namespace", request.getNamespaceName());
    map.put("requestingUser", request.getRequestingUsername());
    map.put("targetUser", request.getTargetUsername());
    map.put("suggestedRoles", request.getSuggestedRoles());
    map.put("recipient", recipient.getUsername());
    String subject = Strings.nullToEmpty(request.getTargetSubject()).trim().isEmpty() ? "n/a" : request.getTargetSubject();
    map.put("subject", subject);
    try {
        return renderer.render(map);
    } catch (Exception e) {
        throw new NotificationProblem("Problem rendering request access to namespace email content", e);
    }
}
Also used : HashMap(java.util.HashMap) NotificationProblem(org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem)

Example 2 with NotificationProblem

use of org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem in project vorto by eclipse.

the class DeleteAccountMessage method getContent.

@Override
public String getContent() {
    Map<String, Object> ctx = new HashMap<>(1);
    ctx.put("user", recipient);
    try {
        return renderer.render(ctx);
    } catch (Exception e) {
        throw new NotificationProblem("Problem rendering delete account email content", e);
    }
}
Also used : HashMap(java.util.HashMap) NotificationProblem(org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem)

Example 3 with NotificationProblem

use of org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem in project vorto by eclipse.

the class RolesChangedInNamespaceMessage method getContent.

@Override
public String getContent() {
    Map<String, Object> map = new HashMap<>();
    map.put("namespace", namespace);
    map.put("roles", roles);
    map.put("recipient", recipient.getUsername());
    try {
        return renderer.render(map);
    } catch (Exception e) {
        throw new NotificationProblem("Problem rendering roles changed in namespace email content", e);
    }
}
Also used : HashMap(java.util.HashMap) NotificationProblem(org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem)

Example 4 with NotificationProblem

use of org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem in project vorto by eclipse.

the class WorkItemPendingMessage method getContent.

@Override
public String getContent() {
    Map<String, Object> ctx = new HashMap<>(1);
    ctx.put("user", recipient);
    ctx.put("model", modelInfo);
    try {
        return renderer.render(ctx);
    } catch (Exception e) {
        throw new NotificationProblem("Problem rendering notification message", e);
    }
}
Also used : HashMap(java.util.HashMap) NotificationProblem(org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem)

Example 5 with NotificationProblem

use of org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem in project vorto by eclipse.

the class CommentReplyMessage method getContent.

@Override
public String getContent() {
    Map<String, Object> ctx = new HashMap<>(1);
    ctx.put("model", modelInfo);
    ctx.put("comment", commentMessage);
    try {
        return renderer.render(ctx);
    } catch (Exception e) {
        throw new NotificationProblem("Problem rendering notification message", e);
    }
}
Also used : HashMap(java.util.HashMap) NotificationProblem(org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem)

Aggregations

NotificationProblem (org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem)8 HashMap (java.util.HashMap)7 Strings (com.google.common.base.Strings)1 ApiParam (io.swagger.annotations.ApiParam)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Comparator (java.util.Comparator)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1 Collectors (java.util.stream.Collectors)1 IUserContext (org.eclipse.vorto.repository.core.IUserContext)1 UserContext (org.eclipse.vorto.repository.core.impl.UserContext)1 IRole (org.eclipse.vorto.repository.domain.IRole)1 Namespace (org.eclipse.vorto.repository.domain.Namespace)1 User (org.eclipse.vorto.repository.domain.User)1 UserNamespaceRoles (org.eclipse.vorto.repository.domain.UserNamespaceRoles)1 IMessage (org.eclipse.vorto.repository.notification.IMessage)1