Search in sources :

Example 21 with MailingListRecipient

use of com.serotonin.m2m2.vo.mailingList.MailingListRecipient in project ma-modules-public by infiniteautomation.

the class PhoneEntryModel method fromModel.

@Override
public MailingListRecipient fromModel() {
    PhoneEntry entry = new PhoneEntry();
    entry.setPhone(phone);
    return entry;
}
Also used : PhoneEntry(com.serotonin.m2m2.vo.mailingList.PhoneEntry)

Example 22 with MailingListRecipient

use of com.serotonin.m2m2.vo.mailingList.MailingListRecipient in project ma-modules-public by infiniteautomation.

the class UserEntryModel method fromModel.

@Override
public MailingListRecipient fromModel() {
    UserEntry entry = new UserEntry();
    Integer user = UserDao.getInstance().getIdByXid(username);
    if (user != null) {
        entry.setUserId(user);
    }
    return entry;
}
Also used : UserEntry(com.serotonin.m2m2.vo.mailingList.UserEntry)

Example 23 with MailingListRecipient

use of com.serotonin.m2m2.vo.mailingList.MailingListRecipient in project ma-modules-public by infiniteautomation.

the class UserPhoneEntryModel method fromModel.

@Override
public MailingListRecipient fromModel() {
    UserEntry entry = new UserEntry();
    Integer user = UserDao.getInstance().getIdByXid(username);
    if (user != null) {
        entry.setUserId(user);
    }
    return entry;
}
Also used : UserEntry(com.serotonin.m2m2.vo.mailingList.UserEntry)

Example 24 with MailingListRecipient

use of com.serotonin.m2m2.vo.mailingList.MailingListRecipient in project ma-modules-public by infiniteautomation.

the class AddressEntryModel method fromModel.

@Override
public MailingListRecipient fromModel() {
    AddressEntry entry = new AddressEntry();
    entry.setAddress(address);
    return entry;
}
Also used : AddressEntry(com.serotonin.m2m2.vo.mailingList.AddressEntry)

Example 25 with MailingListRecipient

use of com.serotonin.m2m2.vo.mailingList.MailingListRecipient in project ma-modules-public by infiniteautomation.

the class MailingListEntryModel method fromModel.

@Override
public MailingListRecipient fromModel() {
    MailingListEntry entry = new MailingListEntry();
    Integer id = MailingListDao.getInstance().getIdByXid(xid);
    if (id != null) {
        entry.setMailingListId(id);
    }
    return entry;
}
Also used : MailingListEntry(com.serotonin.m2m2.vo.mailingList.MailingListEntry)

Aggregations

MailingListRecipient (com.serotonin.m2m2.vo.mailingList.MailingListRecipient)31 ArrayList (java.util.ArrayList)17 AddressEntry (com.serotonin.m2m2.vo.mailingList.AddressEntry)13 MailingList (com.serotonin.m2m2.vo.mailingList.MailingList)13 Test (org.junit.Test)10 MailingListEntry (com.serotonin.m2m2.vo.mailingList.MailingListEntry)9 EmailEventHandlerVO (com.serotonin.m2m2.vo.event.EmailEventHandlerVO)8 UserEntry (com.serotonin.m2m2.vo.mailingList.UserEntry)8 PhoneEntry (com.serotonin.m2m2.vo.mailingList.PhoneEntry)7 EventInstance (com.serotonin.m2m2.rt.event.EventInstance)6 IntStringPair (com.serotonin.db.pair.IntStringPair)5 ShouldNeverHappenException (com.serotonin.ShouldNeverHappenException)4 User (com.serotonin.m2m2.vo.User)4 RecipientListEntryType (com.serotonin.m2m2.vo.mailingList.RecipientListEntryType)4 RecipientListEntryBean (com.serotonin.m2m2.web.dwr.beans.RecipientListEntryBean)4 HashSet (java.util.HashSet)4 List (java.util.List)4 ScriptPermissions (com.infiniteautomation.mango.util.script.ScriptPermissions)3 EmailRecipientModel (com.infiniteautomation.mango.rest.latest.model.mailingList.EmailRecipientModel)2 ExpectValidationException (com.infiniteautomation.mango.rules.ExpectValidationException)2