Search in sources :

Example 51 with CodeType

use of un.unece.uncefact.data.standard.unqualifieddatatype._18.CodeType in project UVMS-ActivityModule-APP by UnionVMS.

the class BaseMapper method mapToSizeDistributionClassCodes.

public static Set<SizeDistributionClassCodeEntity> mapToSizeDistributionClassCodes(List<CodeType> codeTypes, SizeDistributionEntity sizeDistributionEntity) {
    if (codeTypes == null || codeTypes.isEmpty()) {
        Collections.emptySet();
    }
    Set<SizeDistributionClassCodeEntity> classCodes = new HashSet<>();
    for (CodeType codeType : codeTypes) {
        SizeDistributionClassCodeEntity entity = SizeDistributionMapper.INSTANCE.mapToSizeDistributionClassCodeEntity(codeType);
        entity.setSizeDistribution(sizeDistributionEntity);
        classCodes.add(entity);
    }
    return classCodes;
}
Also used : SizeDistributionClassCodeEntity(eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionClassCodeEntity) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) Sets.newHashSet(com.google.common.collect.Sets.newHashSet) HashSet(java.util.HashSet)

Example 52 with CodeType

use of un.unece.uncefact.data.standard.unqualifieddatatype._18.CodeType in project UVMS-ActivityModule-APP by UnionVMS.

the class VesselStorageCharacteristicsMapper method mapToVesselStorageCharCodes.

protected Set<VesselStorageCharCodeEntity> mapToVesselStorageCharCodes(List<CodeType> codeTypes, VesselStorageCharacteristicsEntity vesselStorageChar) {
    if (codeTypes == null || codeTypes.isEmpty()) {
        return Collections.emptySet();
    }
    Set<VesselStorageCharCodeEntity> vesselStorageCharCodes = new HashSet<>();
    for (CodeType codeType : codeTypes) {
        VesselStorageCharCodeEntity vesselStorageCharCode = VesselStorageCharacteristicsMapper.INSTANCE.mapToVesselStorageCharCodeEntity(codeType);
        vesselStorageCharCode.setVesselStorageCharacteristics(vesselStorageChar);
        vesselStorageCharCodes.add(vesselStorageCharCode);
    }
    return vesselStorageCharCodes;
}
Also used : VesselStorageCharCodeEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharCodeEntity) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) HashSet(java.util.HashSet)

Example 53 with CodeType

use of un.unece.uncefact.data.standard.unqualifieddatatype._18.CodeType in project sldeditor by robward-scisys.

the class CustomProcessFunctionTest method createProcessDescriptionBBox.

/**
 * Test the process description bounding box values.
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void createProcessDescriptionBBox() {
    ProcessDescriptionType process = Wps10FactoryImpl.init().createProcessDescriptionType();
    CodeType codeType = Ows11FactoryImpl.init().createCodeType();
    codeType.setValue("JTS:area");
    process.setIdentifier(codeType);
    InputDescriptionType inputDescription = Wps10FactoryImpl.init().createInputDescriptionType();
    CodeType codeType2 = Ows11FactoryImpl.init().createCodeType();
    codeType2.setValue("dummyParameter");
    inputDescription.setIdentifier(codeType2);
    inputDescription.setMinOccurs(BigInteger.valueOf(1));
    inputDescription.setMaxOccurs(BigInteger.valueOf(1));
    DataInputsType dataInputs = Wps10FactoryImpl.init().createDataInputsType();
    EList dataInputList = dataInputs.getInput();
    dataInputList.add(inputDescription);
    process.setDataInputs(dataInputs);
    SupportedCRSsType crs = Wps10FactoryImpl.init().createSupportedCRSsType();
    inputDescription.setBoundingBoxData(crs);
    CustomProcessFunction obj = new CustomProcessFunction();
    List<ProcessFunctionParameterValue> valueList = obj.extractParameters(process);
    assertEquals(1, valueList.size());
    ProcessFunctionParameterValue value = valueList.get(0);
    assertEquals(1, value.getMinOccurences());
    assertEquals(1, value.getMaxOccurences());
    assertTrue(value.getDataType().compareTo("BBOX") == 0);
    SupportedComplexDataInputType complex = Wps10FactoryImpl.init().createSupportedComplexDataInputType();
    inputDescription.setComplexData(complex);
    inputDescription.setBoundingBoxData(null);
    valueList = obj.extractParameters(process);
    assertEquals(1, valueList.size());
    value = valueList.get(0);
    assertEquals(1, value.getMinOccurences());
    assertEquals(1, value.getMaxOccurences());
    assertTrue(value.getDataType().compareTo("Geometry") == 0);
}
Also used : InputDescriptionType(net.opengis.wps10.InputDescriptionType) EList(org.eclipse.emf.common.util.EList) SupportedCRSsType(net.opengis.wps10.SupportedCRSsType) ProcessDescriptionType(net.opengis.wps10.ProcessDescriptionType) DataInputsType(net.opengis.wps10.DataInputsType) ProcessFunctionParameterValue(com.sldeditor.rendertransformation.ProcessFunctionParameterValue) CustomProcessFunction(com.sldeditor.rendertransformation.CustomProcessFunction) CodeType(net.opengis.ows11.CodeType) SupportedComplexDataInputType(net.opengis.wps10.SupportedComplexDataInputType) Test(org.junit.jupiter.api.Test)

Example 54 with CodeType

use of un.unece.uncefact.data.standard.unqualifieddatatype._18.CodeType in project sldeditor by robward-scisys.

the class CustomProcessFunctionTest method createProcessDescription.

/**
 * Creates the process description.
 *
 * @param type the type
 * @param defaultValue the default value
 * @param minOccurs the min occurs
 * @param maxOccurs the max occurs
 * @return the process function parameter value
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
private ProcessFunctionParameterValue createProcessDescription(String type, String defaultValue, int minOccurs, int maxOccurs) {
    ProcessDescriptionType process = Wps10FactoryImpl.init().createProcessDescriptionType();
    CodeType codeType = Ows11FactoryImpl.init().createCodeType();
    codeType.setValue("JTS:area");
    process.setIdentifier(codeType);
    CodeType codeType2 = Ows11FactoryImpl.init().createCodeType();
    codeType2.setValue("dummyParameter");
    InputDescriptionType inputDescription = Wps10FactoryImpl.init().createInputDescriptionType();
    inputDescription.setIdentifier(codeType2);
    inputDescription.setMinOccurs(BigInteger.valueOf(minOccurs));
    inputDescription.setMaxOccurs(BigInteger.valueOf(maxOccurs));
    LiteralInputType literal = Wps10FactoryImpl.init().createLiteralInputType();
    DomainMetadataType domainType = Ows11FactoryImpl.init().createDomainMetadataType();
    domainType.setValue(type);
    literal.setDefaultValue(defaultValue);
    literal.setDataType(domainType);
    inputDescription.setLiteralData(literal);
    DataInputsType dataInputs = Wps10FactoryImpl.init().createDataInputsType();
    EList dataInputList = dataInputs.getInput();
    dataInputList.add(inputDescription);
    process.setDataInputs(dataInputs);
    CustomProcessFunction obj = new CustomProcessFunction();
    List<ProcessFunctionParameterValue> valueList = obj.extractParameters(process);
    assertEquals(1, valueList.size(), type);
    ProcessFunctionParameterValue value = valueList.get(0);
    assertEquals(minOccurs, value.getMinOccurences(), type);
    assertEquals(maxOccurs, value.getMaxOccurences(), type);
    return value;
}
Also used : DomainMetadataType(net.opengis.ows11.DomainMetadataType) InputDescriptionType(net.opengis.wps10.InputDescriptionType) EList(org.eclipse.emf.common.util.EList) ProcessDescriptionType(net.opengis.wps10.ProcessDescriptionType) DataInputsType(net.opengis.wps10.DataInputsType) ProcessFunctionParameterValue(com.sldeditor.rendertransformation.ProcessFunctionParameterValue) CustomProcessFunction(com.sldeditor.rendertransformation.CustomProcessFunction) CodeType(net.opengis.ows11.CodeType) LiteralInputType(net.opengis.wps10.LiteralInputType)

Example 55 with CodeType

use of un.unece.uncefact.data.standard.unqualifieddatatype._18.CodeType in project sldeditor by robward-scisys.

the class CustomProcessFunctionTest method createProcessDescriptionEnum.

/**
 * Test the process description enumeration values.
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void createProcessDescriptionEnum() {
    ProcessDescriptionType process = Wps10FactoryImpl.init().createProcessDescriptionType();
    CodeType codeType = Ows11FactoryImpl.init().createCodeType();
    codeType.setValue("JTS:area");
    process.setIdentifier(codeType);
    InputDescriptionType inputDescription = Wps10FactoryImpl.init().createInputDescriptionType();
    CodeType codeType2 = Ows11FactoryImpl.init().createCodeType();
    codeType2.setValue("dummyParameter");
    inputDescription.setIdentifier(codeType2);
    inputDescription.setMinOccurs(BigInteger.valueOf(1));
    inputDescription.setMaxOccurs(BigInteger.valueOf(1));
    AllowedValuesType allowedValues = Ows11FactoryImpl.init().createAllowedValuesType();
    EList allowedValueList = allowedValues.getValue();
    ValueType item1 = Ows11FactoryImpl.init().createValueType();
    item1.setValue("item 1");
    allowedValueList.add(item1);
    ValueType item2 = Ows11FactoryImpl.init().createValueType();
    item2.setValue("item 2");
    allowedValueList.add(item2);
    ValueType item3 = Ows11FactoryImpl.init().createValueType();
    item1.setValue("item 3");
    allowedValueList.add(item3);
    LiteralInputType literal = Wps10FactoryImpl.init().createLiteralInputType();
    literal.setAllowedValues(allowedValues);
    inputDescription.setLiteralData(literal);
    DataInputsType dataInputs = Wps10FactoryImpl.init().createDataInputsType();
    EList dataInputList = dataInputs.getInput();
    dataInputList.add(inputDescription);
    process.setDataInputs(dataInputs);
    CustomProcessFunction obj = new CustomProcessFunction();
    List<ProcessFunctionParameterValue> valueList = obj.extractParameters(process);
    assertEquals(1, valueList.size());
    ProcessFunctionParameterValue value = valueList.get(0);
    assertEquals(1, value.getMinOccurences());
    assertEquals(1, value.getMaxOccurences());
}
Also used : InputDescriptionType(net.opengis.wps10.InputDescriptionType) EList(org.eclipse.emf.common.util.EList) ValueType(net.opengis.ows11.ValueType) AllowedValuesType(net.opengis.ows11.AllowedValuesType) ProcessDescriptionType(net.opengis.wps10.ProcessDescriptionType) DataInputsType(net.opengis.wps10.DataInputsType) ProcessFunctionParameterValue(com.sldeditor.rendertransformation.ProcessFunctionParameterValue) CustomProcessFunction(com.sldeditor.rendertransformation.CustomProcessFunction) CodeType(net.opengis.ows11.CodeType) LiteralInputType(net.opengis.wps10.LiteralInputType) Test(org.junit.jupiter.api.Test)

Aggregations

CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)46 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)15 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)10 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)9 ArrayList (java.util.ArrayList)6 QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)6 HashSet (java.util.HashSet)5 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)5 FLUXParty (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty)5 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)5 CodeType (net.opengis.ows11.CodeType)4 DataInputsType (net.opengis.wps10.DataInputsType)4 InputDescriptionType (net.opengis.wps10.InputDescriptionType)4 ProcessDescriptionType (net.opengis.wps10.ProcessDescriptionType)4 EList (org.eclipse.emf.common.util.EList)4 FAQueryParameter (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQueryParameter)4 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)4 CustomProcessFunction (com.sldeditor.rendertransformation.CustomProcessFunction)3 ProcessFunctionParameterValue (com.sldeditor.rendertransformation.ProcessFunctionParameterValue)3 LiteralInputType (net.opengis.wps10.LiteralInputType)3