Search in sources :

Example 1 with FLUXParty

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

the class FaQueryFactory method createFaQueryForTrip.

public static FAQuery createFaQueryForTrip(String tripId, String sendTo, boolean consolidated) {
    FAQuery faq = new FAQuery();
    faq.setID(new IDType(UUID.randomUUID().toString(), "UUID", null, null, null, null, null, null));
    faq.setTypeCode(new CodeType("TRIP", "FA_QUERY_TYPE", null, null, null, null, null, null, null, null));
    try {
        final XMLGregorianCalendar currentDate = DateUtils.getCurrentDate();
        faq.setSubmittedDateTime(new DateTimeType(currentDate, null));
    } catch (DatatypeConfigurationException e) {
        log.error("[ERROR] Error while trying to create XMLGregorianCalendar () DateUtils.getCurrentDate()! Going to retry", e);
        return null;
    }
    faq.setSubmitterFLUXParty(new FLUXParty(Collections.singletonList(new IDType(sendTo, "FLUX_GP_PARTY", null, null, null, null, null, null)), null));
    faq.setSimpleFAQueryParameters(Arrays.asList(new FAQueryParameter(new CodeType("TRIPID", "FA_QUERY_PARAMETER", null, null, null, null, null, null, null, null), null, null, new IDType(tripId, "EU_TRIP_ID", null, null, null, null, null, null)), new FAQueryParameter(new CodeType("CONSOLIDATED", "FA_QUERY_PARAMETER", null, null, null, null, null, null, null, null), new CodeType(consolidated ? "Y" : "N", "BOOLEAN_VALUE", null, null, null, null, null, null, null, null), null, null)));
    return faq;
}
Also used : FAQueryParameter(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQueryParameter) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) DatatypeConfigurationException(javax.xml.datatype.DatatypeConfigurationException) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) FAQuery(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQuery) 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)

Example 2 with FLUXParty

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

the class FluxPartyMapper method mapToFluxParty.

public FLUXParty mapToFluxParty(FluxPartyEntity fluxParty) {
    if (fluxParty == null) {
        return null;
    }
    String fluxPartyName = fluxParty.getFluxPartyName();
    String nameLanguageId = fluxParty.getNameLanguageId();
    FLUXParty party = new FLUXParty();
    mapNamesAndLanguageId(party, fluxPartyName, nameLanguageId);
    mapFluxPartyIdentifiers(party, fluxParty.getFluxPartyIdentifiers());
    return party;
}
Also used : FLUXParty(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty)

Example 3 with FLUXParty

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

the class ActivityToSubscriptionMapperTest method before.

@Before
@SneakyThrows
public void before() {
    IDType idType = new IDType();
    idType.setSchemeID("FLUX_GP_PARTY");
    idType.setValue("BEL");
    FLUXParty fluxParty = new FLUXParty();
    fluxParty.setIDS(Collections.singletonList(idType));
    DelimitedPeriod delimitedPeriod = new DelimitedPeriod();
    DateTimeType startDateTime = new DateTimeType();
    GregorianCalendar cal = new GregorianCalendar();
    DateTime dateTime = DateUtils.XML_FORMATTER.parseDateTime("2016-07-01T02:00:00.000+02:00");
    cal.setTime(dateTime.toDate());
    XMLGregorianCalendar xmlDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
    startDateTime.setDateTime(xmlDate);
    delimitedPeriod.setStartDateTime(startDateTime);
    DateTimeType endDateTime = new DateTimeType();
    GregorianCalendar cal2 = new GregorianCalendar();
    DateTime dateTime2 = DateUtils.XML_FORMATTER.parseDateTime("2017-07-01T02:00:00.000+02:00");
    cal2.setTime(dateTime2.toDate());
    XMLGregorianCalendar xmlDate2 = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal2);
    endDateTime.setDateTime(xmlDate2);
    delimitedPeriod.setEndDateTime(endDateTime);
    FAQueryParameter faQueryParameter = new FAQueryParameter();
    CodeType codeType = new CodeType();
    codeType.setValue(SubCriteriaType.VESSELID.value());
    faQueryParameter.setTypeCode(codeType);
    IDType idType0 = new IDType();
    idType0.setValue("PD2438");
    idType0.setSchemeID("IRCS");
    faQueryParameter.setValueID(idType0);
    FAQueryParameter faQueryParameter2 = new FAQueryParameter();
    CodeType codeType2 = new CodeType();
    codeType2.setValue(SubCriteriaType.VESSELID.value());
    faQueryParameter2.setTypeCode(codeType2);
    IDType idType2 = new IDType();
    idType2.setValue("SVN123456789");
    idType2.setSchemeID("CFR");
    faQueryParameter2.setValueID(idType2);
    FAQueryParameter faQueryParameter3 = new FAQueryParameter();
    CodeType codeType3 = new CodeType();
    codeType3.setValue(SubCriteriaType.TRIPID.value());
    faQueryParameter3.setTypeCode(codeType3);
    IDType idType3 = new IDType();
    idType3.setValue("FRA-TRP-2016122102030");
    idType3.setSchemeID("EU_TRIP_ID");
    faQueryParameter3.setValueID(idType3);
    FAQueryParameter faQueryParameter4 = new FAQueryParameter();
    CodeType codeType4 = new CodeType();
    codeType4.setValue("CONSOLIDATED");
    CodeType valueCode = new CodeType();
    valueCode.setListID("BOOLEAN_VALUE");
    valueCode.setValue("Y");
    faQueryParameter4.setTypeCode(codeType4);
    faQueryParameter4.setValueCode(valueCode);
    List<FAQueryParameter> faQueryParameters = new ArrayList<>();
    faQueryParameters.add(faQueryParameter);
    faQueryParameters.add(faQueryParameter2);
    faQueryParameters.add(faQueryParameter3);
    faQueryParameters.add(faQueryParameter4);
    FAQuery faQuery = new FAQuery();
    faQuery.setSpecifiedDelimitedPeriod(delimitedPeriod);
    faQuery.setSimpleFAQueryParameters(faQueryParameters);
    faQuery.setSubmitterFLUXParty(fluxParty);
    fluxfaQueryMessage.setFAQuery(faQuery);
}
Also used : FAQueryParameter(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQueryParameter) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) DelimitedPeriod(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod) FAQuery(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQuery) GregorianCalendar(java.util.GregorianCalendar) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) ArrayList(java.util.ArrayList) 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) DateTime(org.joda.time.DateTime) Before(org.junit.Before) SneakyThrows(lombok.SneakyThrows)

Example 4 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() {
    new FLUXReportDocument();
    List<IDType> ids = Arrays.asList(getIdType("FLUX_REPORT_ID_1", "FLUX_SCHEME_ID1"));
    IDType referenceId = getIdType("REF_ID 1", "47rfh-5hry4-thfur75-4hf743");
    DateTimeType creationDateTime = getDateTimeType("2016-07-01 11:15:00");
    CodeType purposeCode = getCodeType("9", "FLUX_GP_PURPOSE");
    CodeType typeCode = getCodeType("type Code1", "fhr574fh-thrud754-kgitjf754-gjtufe89");
    List<IDType> ownerFluxPartyId = Arrays.asList(getIdType("Owner_flux_party_id_1", "flux_Party_scheme_id"));
    List<TextType> names = Arrays.asList(getTextType("fluxPartyOwnerName 1"));
    FLUXParty fluxParty = new FLUXParty(ownerFluxPartyId, names);
    FLUXReportDocument fluxReportDocument = new FLUXReportDocument(ids, referenceId, creationDateTime, purposeCode, getTextType("Purpose"), typeCode, fluxParty);
    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)

Example 5 with FLUXParty

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

the class ActivityToSubscriptionMapper 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)

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