use of nikita.common.model.noark5.v4.casehandling.RegistryEntry in project nikita-noark5-core by HiOA-ABI.
the class RegistryEntryService method deleteEntity.
// All DELETE operations
@Override
public void deleteEntity(@NotNull String registryEntrySystemId) {
RegistryEntry registryEntry = getRegistryEntryOrThrow(registryEntrySystemId);
registryEntryRepository.delete(registryEntry);
}
use of nikita.common.model.noark5.v4.casehandling.RegistryEntry in project nikita-noark5-core by HiOA-ABI.
the class RegistryEntryService method createCorrespondencePartPersonAssociatedWithRegistryEntry.
@Override
public CorrespondencePartPerson createCorrespondencePartPersonAssociatedWithRegistryEntry(String systemID, CorrespondencePartPerson correspondencePart) {
RegistryEntry registryEntry = getRegistryEntryOrThrow(systemID);
associateCorrespondencePartTypeWithCorrespondencePart(correspondencePart);
ContactInformation contactInformation = correspondencePart.getContactInformation();
if (null != contactInformation) {
NoarkUtils.NoarkEntity.Create.setNikitaEntityValues(contactInformation);
NoarkUtils.NoarkEntity.Create.setSystemIdEntityValues(contactInformation);
}
SimpleAddress postalAddress = correspondencePart.getPostalAddress();
if (null != postalAddress) {
NoarkUtils.NoarkEntity.Create.setNikitaEntityValues(postalAddress);
NoarkUtils.NoarkEntity.Create.setSystemIdEntityValues(postalAddress);
}
SimpleAddress residingAddress = correspondencePart.getResidingAddress();
if (null != residingAddress) {
NoarkUtils.NoarkEntity.Create.setNikitaEntityValues(residingAddress);
NoarkUtils.NoarkEntity.Create.setSystemIdEntityValues(residingAddress);
}
NoarkUtils.NoarkEntity.Create.setNikitaEntityValues(correspondencePart);
NoarkUtils.NoarkEntity.Create.setSystemIdEntityValues(correspondencePart);
// bidirectional relationship @ManyToMany, set both sides of relationship
registryEntry.getReferenceCorrespondencePart().add(correspondencePart);
correspondencePart.getReferenceRegistryEntry().add(registryEntry);
return correspondencePartService.createNewCorrespondencePartPerson(correspondencePart);
}
use of nikita.common.model.noark5.v4.casehandling.RegistryEntry in project nikita-noark5-core by HiOA-ABI.
the class RegistryEntryService method handleUpdate.
// All UPDATE operations
@Override
public RegistryEntry handleUpdate(@NotNull String systemId, @NotNull Long version, @NotNull RegistryEntry incomingRegistryEntry) {
RegistryEntry existingRegistryEntry = getRegistryEntryOrThrow(systemId);
// Copy all the values you are allowed to copy ....
if (null != incomingRegistryEntry.getDescription()) {
existingRegistryEntry.setDescription(incomingRegistryEntry.getDescription());
}
if (null != incomingRegistryEntry.getTitle()) {
existingRegistryEntry.setTitle(incomingRegistryEntry.getTitle());
}
if (null != incomingRegistryEntry.getDocumentMedium()) {
existingRegistryEntry.setDocumentMedium(incomingRegistryEntry.getDocumentMedium());
}
if (null != incomingRegistryEntry.getDocumentDate()) {
existingRegistryEntry.setDocumentDate(incomingRegistryEntry.getDocumentDate());
}
if (null != incomingRegistryEntry.getDueDate()) {
existingRegistryEntry.setDueDate(incomingRegistryEntry.getDueDate());
}
if (null != incomingRegistryEntry.getFreedomAssessmentDate()) {
existingRegistryEntry.setFreedomAssessmentDate(incomingRegistryEntry.getFreedomAssessmentDate());
}
if (null != incomingRegistryEntry.getLoanedDate()) {
existingRegistryEntry.setLoanedDate(incomingRegistryEntry.getLoanedDate());
}
if (null != incomingRegistryEntry.getLoanedTo()) {
existingRegistryEntry.setLoanedTo(incomingRegistryEntry.getLoanedTo());
}
existingRegistryEntry.setVersion(version);
registryEntryRepository.save(existingRegistryEntry);
return existingRegistryEntry;
}
use of nikita.common.model.noark5.v4.casehandling.RegistryEntry in project nikita-noark5-core by HiOA-ABI.
the class RegistryEntryService method createCorrespondencePartUnitAssociatedWithRegistryEntry.
@Override
public CorrespondencePartUnit createCorrespondencePartUnitAssociatedWithRegistryEntry(String systemID, CorrespondencePartUnit correspondencePart) {
RegistryEntry registryEntry = getRegistryEntryOrThrow(systemID);
associateCorrespondencePartTypeWithCorrespondencePart(correspondencePart);
ContactInformation contactInformation = correspondencePart.getContactInformation();
if (null != contactInformation) {
NoarkUtils.NoarkEntity.Create.setNikitaEntityValues(contactInformation);
NoarkUtils.NoarkEntity.Create.setSystemIdEntityValues(contactInformation);
}
SimpleAddress postalAddress = correspondencePart.getPostalAddress();
if (null != postalAddress) {
NoarkUtils.NoarkEntity.Create.setNikitaEntityValues(postalAddress);
NoarkUtils.NoarkEntity.Create.setSystemIdEntityValues(postalAddress);
}
SimpleAddress businessAddress = correspondencePart.getBusinessAddress();
if (null != businessAddress) {
NoarkUtils.NoarkEntity.Create.setNikitaEntityValues(businessAddress);
NoarkUtils.NoarkEntity.Create.setSystemIdEntityValues(businessAddress);
}
NoarkUtils.NoarkEntity.Create.setNikitaEntityValues(correspondencePart);
NoarkUtils.NoarkEntity.Create.setSystemIdEntityValues(correspondencePart);
// bidirectional relationship @ManyToMany, set both sides of relationship
registryEntry.getReferenceCorrespondencePart().add(correspondencePart);
correspondencePart.getReferenceRegistryEntry().add(registryEntry);
return correspondencePartService.createNewCorrespondencePartUnit(correspondencePart);
}
use of nikita.common.model.noark5.v4.casehandling.RegistryEntry in project nikita-noark5-core by HiOA-ABI.
the class CaseFileImportService method createRegistryEntryAssociatedWithCaseFile.
@Override
public RegistryEntry createRegistryEntryAssociatedWithCaseFile(String fileSystemId, RegistryEntry registryEntry) {
RegistryEntry persistedRecord = null;
CaseFile file = caseFileRepository.findBySystemIdOrderBySystemId(fileSystemId);
if (file == null) {
String info = INFO_CANNOT_FIND_OBJECT + " CaseFile, using fileSystemId " + fileSystemId;
logger.info(info);
throw new NoarkEntityNotFoundException(info);
} else {
registryEntry.setReferenceFile(file);
persistedRecord = registryEntryImportService.save(registryEntry);
}
return persistedRecord;
}
Aggregations