Search in sources :

Example 1 with Contact

use of uk.ac.bbsrc.tgac.miso.core.data.impl.Contact in project miso-lims by miso-lims.

the class Dtos method to.

public static Project to(@Nonnull ProjectDto dto) {
    Project to = new ProjectImpl();
    setLong(to::setId, dto.getId(), false);
    setString(to::setName, dto.getName());
    setDate(to::setCreationTime, dto.getCreationDate());
    setString(to::setAlias, dto.getAlias());
    setString(to::setShortName, dto.getShortName());
    setString(to::setDescription, dto.getDescription());
    setObject(to::setStatus, dto.getStatus(), (key) -> StatusType.get(key));
    setObject(to::setReferenceGenome, ReferenceGenomeImpl::new, dto.getReferenceGenomeId());
    setObject(to::setDefaultTargetedSequencing, TargetedSequencing::new, dto.getDefaultTargetedSequencingId());
    setObject(to::setPipeline, Pipeline::new, dto.getPipelineId());
    setBoolean(to::setSecondaryNaming, dto.isSecondaryNaming(), false);
    setString(to::setRebNumber, dto.getRebNumber());
    setDate(to::setRebExpiry, dto.getRebExpiry());
    setInteger(to::setSamplesExpected, dto.getSamplesExpected(), true);
    if (dto.getContactId() != null || !isStringEmptyOrNull(dto.getContactName()) || !isStringEmptyOrNull(dto.getContactEmail())) {
        Contact contact = new Contact();
        setLong(contact::setId, dto.getContactId(), false);
        setString(contact::setName, dto.getContactName());
        setString(contact::setEmail, dto.getContactEmail());
        to.setContact(contact);
    }
    return to;
}
Also used : ReferenceGenomeImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.ReferenceGenomeImpl) SampleNumberPerProject(uk.ac.bbsrc.tgac.miso.core.data.SampleNumberPerProject) Project(uk.ac.bbsrc.tgac.miso.core.data.Project) SampleNumberPerProjectImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleNumberPerProjectImpl) ProjectImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.ProjectImpl) TargetedSequencing(uk.ac.bbsrc.tgac.miso.core.data.impl.TargetedSequencing) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto) Pipeline(uk.ac.bbsrc.tgac.miso.core.data.impl.Pipeline) Contact(uk.ac.bbsrc.tgac.miso.core.data.impl.Contact)

Example 2 with Contact

use of uk.ac.bbsrc.tgac.miso.core.data.impl.Contact in project miso-lims by miso-lims.

the class Dtos method to.

public static Contact to(@Nonnull ContactDto from) {
    Contact to = new Contact();
    setLong(to::setId, from.getId(), false);
    setString(to::setName, from.getName());
    setString(to::setEmail, from.getEmail());
    return to;
}
Also used : IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto) Contact(uk.ac.bbsrc.tgac.miso.core.data.impl.Contact)

Example 3 with Contact

use of uk.ac.bbsrc.tgac.miso.core.data.impl.Contact in project miso-lims by miso-lims.

the class TransferRestController method addNotification.

@PostMapping("/{transferId}/notifications")
@ResponseBody
public TransferNotificationDto addNotification(@PathVariable long transferId, @RequestBody TransferNotificationDto dto, @RequestParam(defaultValue = "false") boolean saveContact) throws IOException {
    Transfer transfer = RestUtils.retrieve("Transfer", transferId, transferService);
    TransferNotificationDto result = RestUtils.createObject("Notification", dto, from -> {
        TransferNotification notification = Dtos.to(from);
        notification.setTransfer(transfer);
        return notification;
    }, transferNotificationService, Dtos::asDto);
    if (saveContact) {
        Contact contact = new Contact();
        contact.setName(result.getRecipientName());
        contact.setEmail(result.getRecipientEmail());
        contactService.create(contact);
    }
    return result;
}
Also used : Dtos(uk.ac.bbsrc.tgac.miso.dto.Dtos) TransferNotificationDto(uk.ac.bbsrc.tgac.miso.dto.TransferNotificationDto) TransferNotification(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferNotification) Transfer(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.Transfer) Contact(uk.ac.bbsrc.tgac.miso.core.data.impl.Contact) PostMapping(org.springframework.web.bind.annotation.PostMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 4 with Contact

use of uk.ac.bbsrc.tgac.miso.core.data.impl.Contact in project miso-lims by miso-lims.

the class HibernateContactDaoIT method getCreateItem.

@Override
public Contact getCreateItem() {
    Contact contact = new Contact();
    contact.setName("New Person");
    contact.setEmail("new@example.com");
    return contact;
}
Also used : Contact(uk.ac.bbsrc.tgac.miso.core.data.impl.Contact)

Example 5 with Contact

use of uk.ac.bbsrc.tgac.miso.core.data.impl.Contact in project miso-lims by miso-lims.

the class HibernateContactDaoIT method testGetByEmail.

@Test
public void testGetByEmail() throws Exception {
    String email = "everyone@example.com";
    Contact contact = getTestSubject().getByEmail(email);
    assertNotNull(contact);
    assertEquals(email, contact.getEmail());
}
Also used : Contact(uk.ac.bbsrc.tgac.miso.core.data.impl.Contact) AbstractHibernateSaveDaoTest(uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest) Test(org.junit.Test)

Aggregations

Contact (uk.ac.bbsrc.tgac.miso.core.data.impl.Contact)5 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)2 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)2 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)2 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)2 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)2 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)2 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)2 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)2 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)2 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)2 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)2 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)2 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)2 Test (org.junit.Test)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1 AbstractHibernateSaveDaoTest (uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest)1 Project (uk.ac.bbsrc.tgac.miso.core.data.Project)1 SampleNumberPerProject (uk.ac.bbsrc.tgac.miso.core.data.SampleNumberPerProject)1