Search in sources :

Example 11 with INikitaEntity

use of nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity in project nikita-noark5-core by HiOA-ABI.

the class RecordHateoasSerializer method serializeNoarkEntity.

@Override
public void serializeNoarkEntity(INikitaEntity noarkSystemIdEntity, HateoasNoarkObject recordHateoas, JsonGenerator jgen) throws IOException {
    Record record = (Record) noarkSystemIdEntity;
    jgen.writeStartObject();
    CommonUtils.Hateoas.Serialize.printSystemIdEntity(jgen, record);
    CommonUtils.Hateoas.Serialize.printCreateEntity(jgen, record);
    if (record.getArchivedDate() != null) {
        jgen.writeStringField(RECORD_ARCHIVED_DATE, Serialize.formatDateTime(record.getArchivedDate()));
    }
    if (record.getArchivedBy() != null) {
        jgen.writeStringField(RECORD_ARCHIVED_BY, record.getArchivedBy());
    }
    CommonUtils.Hateoas.Serialize.printDisposal(jgen, record);
    CommonUtils.Hateoas.Serialize.printScreening(jgen, record);
    CommonUtils.Hateoas.Serialize.printClassified(jgen, record);
    CommonUtils.Hateoas.Serialize.printHateoasLinks(jgen, recordHateoas.getLinks(record));
    jgen.writeEndObject();
}
Also used : Record(nikita.model.noark5.v4.Record)

Example 12 with INikitaEntity

use of nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity in project nikita-noark5-core by HiOA-ABI.

the class SeriesHateoasSerializer method serializeNoarkEntity.

@Override
public void serializeNoarkEntity(INikitaEntity noarkSystemIdEntity, HateoasNoarkObject seriesHateoas, JsonGenerator jgen) throws IOException {
    Series series = (Series) noarkSystemIdEntity;
    jgen.writeStartObject();
    CommonUtils.Hateoas.Serialize.printSystemIdEntity(jgen, series);
    CommonUtils.Hateoas.Serialize.printTitleAndDescription(jgen, series);
    if (series.getSeriesStatus() != null) {
        jgen.writeStringField(SERIES_STATUS, series.getSeriesStatus());
    }
    CommonUtils.Hateoas.Serialize.printDocumentMedium(jgen, series);
    CommonUtils.Hateoas.Serialize.printStorageLocation(jgen, series);
    CommonUtils.Hateoas.Serialize.printCreateEntity(jgen, series);
    CommonUtils.Hateoas.Serialize.printFinaliseEntity(jgen, series);
    if (series.getSeriesStartDate() != null) {
        jgen.writeStringField(SERIES_START_DATE, Serialize.formatDate(series.getSeriesStartDate()));
    }
    if (series.getSeriesEndDate() != null) {
        jgen.writeStringField(SERIES_END_DATE, Serialize.formatDate(series.getSeriesEndDate()));
    }
    if (series.getReferencePrecursor() != null && series.getReferencePrecursor().getSystemId() != null) {
        jgen.writeStringField(SERIES_PRECURSOR, series.getReferencePrecursor().getSystemId());
    }
    if (series.getReferenceSuccessor() != null && series.getReferenceSuccessor().getSystemId() != null) {
        jgen.writeStringField(SERIES_SUCCESSOR, series.getReferenceSuccessor().getSystemId());
    }
    CommonUtils.Hateoas.Serialize.printDisposal(jgen, series);
    CommonUtils.Hateoas.Serialize.printDisposalUndertaken(jgen, series);
    CommonUtils.Hateoas.Serialize.printDeletion(jgen, series);
    CommonUtils.Hateoas.Serialize.printScreening(jgen, series);
    CommonUtils.Hateoas.Serialize.printClassified(jgen, series);
    CommonUtils.Hateoas.Serialize.printHateoasLinks(jgen, seriesHateoas.getLinks(series));
    jgen.writeEndObject();
}
Also used : Series(nikita.model.noark5.v4.Series)

Example 13 with INikitaEntity

use of nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity in project nikita-noark5-core by HiOA-ABI.

the class UserHateoasSerializer method serializeNoarkEntity.

@Override
public void serializeNoarkEntity(INikitaEntity noarkSystemIdEntity, HateoasNoarkObject fondsHateoas, JsonGenerator jgen) throws IOException {
    Fonds fonds = (Fonds) noarkSystemIdEntity;
    jgen.writeStartObject();
    CommonUtils.Hateoas.Serialize.printSystemIdEntity(jgen, fonds);
    CommonUtils.Hateoas.Serialize.printTitleAndDescription(jgen, fonds);
    if (fonds.getFondsStatus() != null) {
        jgen.writeStringField(FONDS_STATUS, fonds.getFondsStatus());
    }
    CommonUtils.Hateoas.Serialize.printDocumentMedium(jgen, fonds);
    CommonUtils.Hateoas.Serialize.printStorageLocation(jgen, fonds);
    CommonUtils.Hateoas.Serialize.printCreateEntity(jgen, fonds);
    CommonUtils.Hateoas.Serialize.printFinaliseEntity(jgen, fonds);
    CommonUtils.Hateoas.Serialize.printFondsCreators(jgen, fonds);
    CommonUtils.Hateoas.Serialize.printHateoasLinks(jgen, fondsHateoas.getLinks(fonds));
    jgen.writeEndObject();
}
Also used : Fonds(nikita.model.noark5.v4.Fonds)

Example 14 with INikitaEntity

use of nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity in project nikita-noark5-core by HiOA-ABI.

the class CaseFileHateoasSerializer method serializeNoarkEntity.

@Override
public void serializeNoarkEntity(INikitaEntity noarkSystemIdEntity, HateoasNoarkObject caseFileHateoas, JsonGenerator jgen) throws IOException {
    CaseFile caseFile = (CaseFile) noarkSystemIdEntity;
    jgen.writeStartObject();
    if (caseFile.getSystemId() != null) {
        jgen.writeStringField(SYSTEM_ID, caseFile.getSystemId());
    }
    if (caseFile.getFileId() != null) {
        jgen.writeStringField(FILE_ID, caseFile.getFileId());
    }
    if (caseFile.getTitle() != null) {
        jgen.writeStringField(TITLE, caseFile.getTitle());
    }
    if (caseFile.getOfficialTitle() != null) {
        jgen.writeStringField(FILE_PUBLIC_TITLE, caseFile.getOfficialTitle());
    }
    if (caseFile.getDescription() != null) {
        jgen.writeStringField(DESCRIPTION, caseFile.getDescription());
    }
    CommonUtils.Hateoas.Serialize.printKeyword(jgen, caseFile);
    if (caseFile.getDocumentMedium() != null) {
        jgen.writeStringField(DOCUMENT_MEDIUM, caseFile.getDocumentMedium());
    }
    CommonUtils.Hateoas.Serialize.printStorageLocation(jgen, caseFile);
    if (caseFile.getCreatedDate() != null) {
        jgen.writeStringField(CREATED_DATE, Serialize.formatDateTime(caseFile.getCreatedDate()));
    }
    if (caseFile.getCreatedBy() != null) {
        jgen.writeStringField(CREATED_BY, caseFile.getCreatedBy());
    }
    if (caseFile.getFinalisedDate() != null) {
        jgen.writeStringField(FINALISED_DATE, Serialize.formatDateTime(caseFile.getFinalisedDate()));
    }
    if (caseFile.getFinalisedBy() != null) {
        jgen.writeStringField(FINALISED_BY, caseFile.getFinalisedBy());
    }
    if (caseFile.getReferenceSeries() != null && caseFile.getReferenceSeries().getSystemId() != null) {
        jgen.writeStringField(REFERENCE_SERIES, caseFile.getReferenceSeries().getSystemId());
    }
    if (caseFile.getCaseYear() != null) {
        jgen.writeNumberField(CASE_YEAR, caseFile.getCaseYear().intValue());
    }
    if (caseFile.getCaseSequenceNumber() != null) {
        jgen.writeNumberField(CASE_SEQUENCE_NUMBER, caseFile.getCaseSequenceNumber().intValue());
    }
    if (caseFile.getCaseDate() != null) {
        jgen.writeStringField(CASE_DATE, Serialize.formatDate(caseFile.getCaseDate()));
    }
    if (caseFile.getAdministrativeUnit() != null) {
        jgen.writeStringField(ADMINISTRATIVE_UNIT, caseFile.getAdministrativeUnit());
    }
    if (caseFile.getCaseResponsible() != null) {
        jgen.writeStringField(CASE_RESPONSIBLE, caseFile.getCaseResponsible());
    }
    if (caseFile.getRecordsManagementUnit() != null) {
        jgen.writeStringField(CASE_RECORDS_MANAGEMENT_UNIT, caseFile.getRecordsManagementUnit());
    }
    if (caseFile.getCaseStatus() != null) {
        jgen.writeStringField(CASE_STATUS, caseFile.getCaseStatus());
    }
    if (caseFile.getLoanedDate() != null) {
        jgen.writeStringField(CASE_LOANED_DATE, Serialize.formatDate(caseFile.getLoanedDate()));
    }
    if (caseFile.getLoanedTo() != null) {
        jgen.writeStringField(CASE_LOANED_TO, caseFile.getLoanedTo());
    }
    // TODO: Implement M209 referanseSekundaerKlassifikasjon
    //CommonCommonUtils.Hateoas.Serialize.printSecondaryClassification(jgen, caseFile);
    CommonUtils.Hateoas.Serialize.printCaseParty(jgen, caseFile);
    //CommonUtils.Hateoas.Serialize.printPrecedence(jgen, caseFile);
    CommonUtils.Hateoas.Serialize.printHateoasLinks(jgen, caseFileHateoas.getLinks(caseFile));
    jgen.writeEndObject();
}
Also used : CaseFile(nikita.model.noark5.v4.casehandling.CaseFile)

Example 15 with INikitaEntity

use of nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity in project nikita-noark5-core by HiOA-ABI.

the class CorrespondencePartInternalHateoasSerializer method serializeNoarkEntity.

@Override
public void serializeNoarkEntity(INikitaEntity noarkSystemIdEntity, HateoasNoarkObject correspondencePartHateoas, JsonGenerator jgen) throws IOException {
    CorrespondencePartInternal correspondencePart = (CorrespondencePartInternal) noarkSystemIdEntity;
    jgen.writeStartObject();
    CommonUtils.Hateoas.Serialize.printCorrespondencePartInternal(jgen, correspondencePart);
    CommonUtils.Hateoas.Serialize.printHateoasLinks(jgen, correspondencePartHateoas.getLinks(correspondencePart));
    jgen.writeEndObject();
}
Also used : CorrespondencePartInternal(nikita.model.noark5.v4.casehandling.secondary.CorrespondencePartInternal)

Aggregations

INikitaEntity (nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity)80 Authorisation (nikita.webapp.security.Authorisation)78 List (java.util.List)77 MetadataHateoas (nikita.common.model.noark5.v4.hateoas.metadata.MetadataHateoas)54 Counted (com.codahale.metrics.annotation.Counted)40 ApiOperation (io.swagger.annotations.ApiOperation)34 ApiResponses (io.swagger.annotations.ApiResponses)34 ArrayList (java.util.ArrayList)20 INikitaEntity (nikita.model.noark5.v4.interfaces.entities.INikitaEntity)19 Timed (com.codahale.metrics.annotation.Timed)16 Authorisation (no.arkivlab.hioa.nikita.webapp.security.Authorisation)16 Fonds (nikita.common.model.noark5.v4.Fonds)6 NoarkEntityNotFoundException (nikita.common.util.exceptions.NoarkEntityNotFoundException)5 CaseFileHateoas (nikita.common.model.noark5.v4.hateoas.casehandling.CaseFileHateoas)4 DocumentDescription (nikita.common.model.noark5.v4.DocumentDescription)3 Record (nikita.common.model.noark5.v4.Record)3 Fonds (nikita.model.noark5.v4.Fonds)3 FondsCreator (nikita.common.model.noark5.v4.FondsCreator)2 CaseFile (nikita.common.model.noark5.v4.casehandling.CaseFile)2 DocumentObjectHateoas (nikita.common.model.noark5.v4.hateoas.DocumentObjectHateoas)2