Search in sources :

Example 6 with FLUXParty

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapToFLUXFAReportMessage.

@SneakyThrows
public FLUXFAReportMessage mapToFLUXFAReportMessage(List<FaReportDocumentEntity> faReportMessageEntity) {
    FLUXFAReportMessage target = new FLUXFAReportMessage();
    FLUXReportDocument fluxReportDocument = new FLUXReportDocument();
    CodeType codeType = new CodeType();
    codeType.setValue("9");
    codeType.setListID("FLUX_GP_PURPOSE");
    fluxReportDocument.setPurposeCode(codeType);
    IDType idType = new IDType();
    idType.setSchemeID("UUID");
    idType.setValue(UUID.randomUUID().toString());
    fluxReportDocument.setIDS(Collections.singletonList(idType));
    DateTimeType dateTimeType = new DateTimeType();
    dateTimeType.setDateTime(DateUtils.getCurrentDate());
    fluxReportDocument.setCreationDateTime(dateTimeType);
    TextType textType = new TextType();
    textType.setValue("LOAD_REPORTS");
    fluxReportDocument.setPurpose(textType);
    FLUXParty party = new FLUXParty();
    IDType idType1 = new IDType();
    idType1.setSchemeID("FLUX_GP_PARTY");
    idType1.setValue("TODO_SET_NODE_ALIAS");
    party.setIDS(Collections.singletonList(idType1));
    fluxReportDocument.setOwnerFLUXParty(party);
    target.setFLUXReportDocument(fluxReportDocument);
    if (CollectionUtils.isNotEmpty(faReportMessageEntity)) {
        mapFAReportDocuments(target, faReportMessageEntity);
    }
    return target;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) FLUXFAReportMessage(un.unece.uncefact.data.standard.fluxfareportmessage._3.FLUXFAReportMessage) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FLUXParty(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType) SneakyThrows(lombok.SneakyThrows)

Example 7 with FLUXParty

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty in project UVMS-ActivityModule-APP by UnionVMS.

the class FluxPartyMapper method mapFluxPartyIdentifiers.

private void mapFluxPartyIdentifiers(FLUXParty target, Set<FluxPartyIdentifierEntity> fluxPartyIdentifierEntities) {
    if (CollectionUtils.isNotEmpty(fluxPartyIdentifierEntities)) {
        List<IDType> idTypeList = new ArrayList<>();
        for (FluxPartyIdentifierEntity source : fluxPartyIdentifierEntities) {
            IDType idType = new IDType();
            String fluxPartyIdentifierId = source.getFluxPartyIdentifierId();
            String fluxPartyIdentifierSchemeId = source.getFluxPartyIdentifierSchemeId();
            idType.setSchemeID(fluxPartyIdentifierSchemeId);
            idType.setValue(fluxPartyIdentifierId);
            idTypeList.add(idType);
        }
        target.setIDS(idTypeList);
    }
}
Also used : ArrayList(java.util.ArrayList) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FluxPartyIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxPartyIdentifierEntity)

Example 8 with FLUXParty

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty in project UVMS-ActivityModule-APP by UnionVMS.

the class FluxPartyMapper method mapNamesAndLanguageId.

private void mapNamesAndLanguageId(FLUXParty target, String fluxPartyName, String nameLanguageId) {
    if (ObjectUtils.allNotNull(target) && (StringUtils.isNotEmpty(fluxPartyName) || StringUtils.isNotEmpty(nameLanguageId))) {
        TextType textType = new TextType();
        if (StringUtils.isNotEmpty(fluxPartyName)) {
            textType.setValue(fluxPartyName);
        }
        if (StringUtils.isNotEmpty(nameLanguageId)) {
            textType.setLanguageID(fluxPartyName);
        }
        target.setNames(singletonList(textType));
    }
}
Also used : TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 9 with FLUXParty

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty in project UVMS-ActivityModule-APP by UnionVMS.

the class SubscriptionMapper method mapFluxPartyToSenderSubscriptionCriteria.

private static List<SubscriptionDataCriteria> mapFluxPartyToSenderSubscriptionCriteria(FLUXParty party) {
    List<SubscriptionDataCriteria> dataCriteriaList = new ArrayList<>();
    List<IDType> organisationIds = party.getIDS();
    for (IDType organisationId : organisationIds) {
        if ("FLUX_GP_PARTY".equals(organisationId.getSchemeID())) {
            String value = organisationId.getValue();
            dataCriteriaList.add(createCriteria(SENDER, ORGANISATION, SCHEME_ID, value));
        }
    }
    return dataCriteriaList;
}
Also used : ArrayList(java.util.ArrayList) SubscriptionDataCriteria(eu.europa.ec.fisheries.wsdl.subscription.module.SubscriptionDataCriteria) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)

Example 10 with FLUXParty

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getFluxReportDocument.

public static FLUXReportDocument getFluxReportDocument() {
    List<IDType> ids = Arrays.asList(getIdType("flux_report_doc_1", "fhty58-gh586t-5tjf8-t58rjewe"));
    IDType referencedID = getIdType("Ref ID 1", "fhty58-gh586t-5tjf8-t58rjewe");
    DateTimeType creationDateTime = getDateTimeType("2016-07-01 11:15:00");
    CodeType purposeCode = getCodeType("5", "FLUX_GP_PURPOSE");
    final TextType purpose = getTextType("Purpose Text");
    CodeType typeCode = getCodeType("FluxReportTypeCode", "fhty58-gh586t-5tjf8-t58rjewe");
    FLUXParty ownerFLUXParty = new FLUXParty(Arrays.asList(getIdType("Owner flux party id 1", "58fjrut-tjfuri-586jte-5jfur")), Arrays.asList(getTextType("This is sample text for owner flux party")));
    FLUXReportDocument fluxReportDocument = new FLUXReportDocument(ids, referencedID, creationDateTime, purposeCode, purpose, typeCode, ownerFLUXParty);
    return fluxReportDocument;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FLUXParty(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Aggregations

IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)8 FLUXParty (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty)6 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)5 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)5 ArrayList (java.util.ArrayList)4 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)4 FLUXReportDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument)3 SubscriptionDataCriteria (eu.europa.ec.fisheries.wsdl.subscription.module.SubscriptionDataCriteria)2 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2 SneakyThrows (lombok.SneakyThrows)2 FAQuery (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQuery)2 FAQueryParameter (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQueryParameter)2 FluxPartyIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxPartyIdentifierEntity)1 GregorianCalendar (java.util.GregorianCalendar)1 DatatypeConfigurationException (javax.xml.datatype.DatatypeConfigurationException)1 DateTime (org.joda.time.DateTime)1 Before (org.junit.Before)1 FLUXFAReportMessage (un.unece.uncefact.data.standard.fluxfareportmessage._3.FLUXFAReportMessage)1 DelimitedPeriod (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod)1