Search in sources :

Example 11 with MangoPermissionModel

use of com.infiniteautomation.mango.rest.latest.model.permissions.MangoPermissionModel in project ma-modules-public by infiniteautomation.

the class AbstractEventDetectorModel method fromVO.

@Override
public void fromVO(T vo) {
    super.fromVO(vo);
    this.readPermission = new MangoPermissionModel(vo.getReadPermission());
    this.editPermission = new MangoPermissionModel(vo.getEditPermission());
    this.data = vo.getData();
    this.sourceId = vo.getSourceId();
    this.description = vo.getDescription();
    this.rtnApplicable = vo.isRtnApplicable();
    this.alarmLevel = vo.getAlarmLevel();
    this.sourceTypeName = vo.getDetectorSourceType();
    this.handlerXids = vo.getEventHandlerXids();
}
Also used : MangoPermissionModel(com.infiniteautomation.mango.rest.latest.model.permissions.MangoPermissionModel)

Example 12 with MangoPermissionModel

use of com.infiniteautomation.mango.rest.latest.model.permissions.MangoPermissionModel in project ma-modules-public by infiniteautomation.

the class AbstractEventHandlerModel method fromVO.

@Override
public void fromVO(T vo) {
    super.fromVO(vo);
    this.disabled = vo.isDisabled();
    this.readPermission = new MangoPermissionModel(vo.getReadPermission());
    this.editPermission = new MangoPermissionModel(vo.getEditPermission());
    this.eventTypes = vo.getEventTypes().stream().map(EventTypeMatcherModel::new).collect(Collectors.toList());
}
Also used : MangoPermissionModel(com.infiniteautomation.mango.rest.latest.model.permissions.MangoPermissionModel) EventTypeMatcherModel(com.infiniteautomation.mango.rest.latest.model.event.EventTypeMatcherModel)

Aggregations

MangoPermissionModel (com.infiniteautomation.mango.rest.latest.model.permissions.MangoPermissionModel)12 Role (com.serotonin.m2m2.vo.role.Role)2 WatchListVO (com.serotonin.m2m2.watchlist.WatchListVO)2 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 TextNode (com.fasterxml.jackson.databind.node.TextNode)1 MangoPermission (com.infiniteautomation.mango.permission.MangoPermission)1 EventTypeMatcherModel (com.infiniteautomation.mango.rest.latest.model.event.EventTypeMatcherModel)1 TimePeriod (com.infiniteautomation.mango.rest.latest.model.time.TimePeriod)1 PermissionService (com.infiniteautomation.mango.spring.service.PermissionService)1 TranslatableMessage (com.serotonin.m2m2.i18n.TranslatableMessage)1 RTException (com.serotonin.m2m2.rt.RTException)1 DataSourceEventType (com.serotonin.m2m2.rt.event.type.DataSourceEventType)1 ExportCodes (com.serotonin.m2m2.util.ExportCodes)1 EventTypeVO (com.serotonin.m2m2.vo.event.EventTypeVO)1 MailingList (com.serotonin.m2m2.vo.mailingList.MailingList)1 MailingListRecipient (com.serotonin.m2m2.vo.mailingList.MailingListRecipient)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1