Search in sources :

Example 6 with CodeType

use of org.geosdi.geoplatform.xml.ows.v110.CodeType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapRoles.

private void mapRoles(ContactParty target, Set<ContactPartyRoleEntity> contactPartyRoleEntities) {
    List<CodeType> codeTypeList = new ArrayList<>();
    if (CollectionUtils.isNotEmpty(contactPartyRoleEntities)) {
        for (ContactPartyRoleEntity source : contactPartyRoleEntities) {
            CodeType codeType = new CodeType();
            codeType.setValue(source.getRoleCode());
            codeType.setListID(source.getRoleCodeListId());
            codeTypeList.add(codeType);
        }
    }
    target.setRoleCodes(codeTypeList);
}
Also used : ArrayList(java.util.ArrayList) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) ContactPartyRoleEntity(eu.europa.ec.fisheries.ers.fa.entities.ContactPartyRoleEntity)

Example 7 with CodeType

use of org.geosdi.geoplatform.xml.ows.v110.CodeType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapPurposeCode.

private void mapPurposeCode(FishingActivity target, FishingActivityEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        CodeType codeType = new CodeType();
        codeType.setValue(source.getTypeCode());
        codeType.setListID(source.getTypeCodeListid());
        target.setTypeCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 8 with CodeType

use of org.geosdi.geoplatform.xml.ows.v110.CodeType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapFMCMarkerCode.

private void mapFMCMarkerCode(FAReportDocument target, String fmcMarkerValue, String fmcMarkerListId) {
    if (ObjectUtils.allNotNull(target) && (StringUtils.isNotEmpty(fmcMarkerValue) || StringUtils.isNotEmpty(fmcMarkerListId))) {
        CodeType codeType = new CodeType();
        if (StringUtils.isNotEmpty(fmcMarkerValue)) {
            codeType.setValue(fmcMarkerValue);
        }
        if (StringUtils.isNotEmpty(fmcMarkerListId)) {
            codeType.setListID(fmcMarkerListId);
        }
        target.setFMCMarkerCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 9 with CodeType

use of org.geosdi.geoplatform.xml.ows.v110.CodeType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapValueCode.

private void mapValueCode(FLUXCharacteristic target, FluxCharacteristicEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        if (source.getValueCode() != null) {
            CodeType codeType = new CodeType();
            codeType.setValue(source.getValueCode());
            target.setTypeCode(codeType);
        }
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 10 with CodeType

use of org.geosdi.geoplatform.xml.ows.v110.CodeType 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)

Aggregations

CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)46 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)15 ArrayList (java.util.ArrayList)13 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)10 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)9 BigDecimal (java.math.BigDecimal)7 CGlobal (com.helger.commons.CGlobal)6 ValueEnforcer (com.helger.commons.ValueEnforcer)6 CollectionHelper (com.helger.commons.collection.CollectionHelper)6 EqualsHelper (com.helger.commons.equals.EqualsHelper)6 ErrorList (com.helger.commons.error.list.ErrorList)6 IErrorList (com.helger.commons.error.list.IErrorList)6 MathHelper (com.helger.commons.math.MathHelper)6 ETriState (com.helger.commons.state.ETriState)6 StringHelper (com.helger.commons.string.StringHelper)6 Serializable (java.io.Serializable)6 LocalDate (java.time.LocalDate)6 Consumer (java.util.function.Consumer)6 Nonnull (javax.annotation.Nonnull)6 Nullable (javax.annotation.Nullable)6