Search in sources :

Example 31 with CodeType

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

the class MapperUtil method getSizeDistribution.

public static SizeDistribution getSizeDistribution() {
    CodeType categoryCode = getCodeType("S6", "FA_BFT_SIZE_CATEGORY");
    List<CodeType> classCodes = Arrays.asList(getCodeType("LSC", "FISH_SIZE_CLASS"));
    SizeDistribution sizeDistribution = new SizeDistribution(categoryCode, classCodes);
    return sizeDistribution;
}
Also used : SizeDistribution(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SizeDistribution) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 32 with CodeType

use of org.geotoolkit.ows.xml.v110.CodeType in project sldeditor by robward-scisys.

the class SelectedProcessFunctionTest method testSetSelectedCustomFunction.

/**
 * Test method for {@link
 * com.sldeditor.rendertransformation.SelectedProcessFunction#setSelectedCustomFunction(net.opengis.wps10.ProcessDescriptionType)}.
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testSetSelectedCustomFunction() {
    ProcessDescriptionType process = Wps10FactoryImpl.init().createProcessDescriptionType();
    CodeType codeType = Ows11FactoryImpl.init().createCodeType();
    String expectedFunctionName = "JTS:area";
    codeType.setValue(expectedFunctionName);
    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));
    LiteralInputType literal = Wps10FactoryImpl.init().createLiteralInputType();
    DomainMetadataType domainType = Ows11FactoryImpl.init().createDomainMetadataType();
    domainType.setValue("xs:int");
    literal.setDefaultValue("1234");
    literal.setDataType(domainType);
    inputDescription.setLiteralData(literal);
    DataInputsType dataInputs = Wps10FactoryImpl.init().createDataInputsType();
    EList dataInputList = dataInputs.getInput();
    dataInputList.add(inputDescription);
    process.setDataInputs(dataInputs);
    LanguageStringType title = Ows11FactoryImpl.init().createLanguageStringType();
    title.setValue(expectedFunctionName);
    process.setTitle(title);
    SelectedProcessFunction obj = new SelectedProcessFunction();
    obj.setSelectedCustomFunction(process);
    assertFalse(obj.isBuiltInSelected());
    assertTrue(obj.getFunctionName().getLocalPart().compareTo(expectedFunctionName) == 0);
    assertEquals(1, obj.getRowCount());
    assertFalse(obj.extractParameters().isEmpty());
    obj.setSelectedCustomFunction(null);
    assertFalse(obj.isBuiltInSelected());
    assertNull(obj.getFunctionName());
    assertEquals(0, obj.getRowCount());
    assertTrue(obj.extractParameters().isEmpty());
}
Also used : DomainMetadataType(net.opengis.ows11.DomainMetadataType) SelectedProcessFunction(com.sldeditor.rendertransformation.SelectedProcessFunction) InputDescriptionType(net.opengis.wps10.InputDescriptionType) EList(org.eclipse.emf.common.util.EList) LanguageStringType(net.opengis.ows11.LanguageStringType) ProcessDescriptionType(net.opengis.wps10.ProcessDescriptionType) DataInputsType(net.opengis.wps10.DataInputsType) CodeType(net.opengis.ows11.CodeType) LiteralInputType(net.opengis.wps10.LiteralInputType) Test(org.junit.jupiter.api.Test)

Example 33 with CodeType

use of org.geotoolkit.ows.xml.v110.CodeType in project UVMS-Docker by UnionVMS.

the class FluxMessageReceiverBeanIT method postRequestTypeRequestSuccessTest.

/**
 * Post request type request success test.
 *
 * @throws Exception the exception
 */
@Test
@Ignore
public void postRequestTypeRequestSuccessTest() throws Exception {
    Asset testAsset = AssetTestHelper.createTestAsset();
    MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
    MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.setTime(new Date());
    BridgeConnectorPortType bridgeConnectorPortType = createBridgeConnector();
    RequestType requestType = new RequestType();
    FLUXVesselPositionMessage fLUXVesselPositionMessage = new FLUXVesselPositionMessage();
    VesselTransportMeansType vesselTransportMeansType = new VesselTransportMeansType();
    IDType cfrId = new IDType();
    cfrId.setSchemeID("CFR");
    cfrId.setValue(testAsset.getCfr());
    vesselTransportMeansType.getIDS().add(cfrId);
    IDType ircsId = new IDType();
    ircsId.setSchemeID("IRCS");
    ircsId.setValue(testAsset.getIrcs());
    vesselTransportMeansType.getIDS().add(ircsId);
    // IDType extMarkingId = new IDType();
    // extMarkingId.setSchemeID("EXT_MARKING");
    // extMarkingId.setValue(testAsset.getExternalMarking());
    // vesselTransportMeansType.getIDS().add(extMarkingId);
    VesselCountryType vesselCountry = new VesselCountryType();
    IDType countryId = new IDType();
    countryId.setValue("SWE");
    vesselCountry.setID(countryId);
    vesselTransportMeansType.setRegistrationVesselCountry(vesselCountry);
    VesselPositionEventType vesselPositionEventType = new VesselPositionEventType();
    MeasureType measureType = new MeasureType();
    measureType.setValue(new BigDecimal(282));
    vesselPositionEventType.setCourseValueMeasure(measureType);
    DateTimeType posDateTime = new DateTimeType();
    posDateTime.setDateTime(DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar));
    vesselPositionEventType.setObtainedOccurrenceDateTime(posDateTime);
    VesselGeographicalCoordinateType cordinates = new VesselGeographicalCoordinateType();
    MeasureType longitude = new MeasureType();
    longitude.setValue(new BigDecimal(21.5740000000));
    cordinates.setLongitudeMeasure(longitude);
    MeasureType latitude = new MeasureType();
    latitude.setValue(new BigDecimal(59.6480000000));
    cordinates.setLatitudeMeasure(latitude);
    vesselPositionEventType.setSpecifiedVesselGeographicalCoordinate(cordinates);
    MeasureType speedValue = new MeasureType();
    speedValue.setValue(new BigDecimal(7.5));
    vesselPositionEventType.setSpeedValueMeasure(speedValue);
    CodeType typeCodeValue = new CodeType();
    typeCodeValue.setValue("POS");
    vesselPositionEventType.setTypeCode(typeCodeValue);
    vesselTransportMeansType.getSpecifiedVesselPositionEvents().add(vesselPositionEventType);
    fLUXVesselPositionMessage.setVesselTransportMeans(vesselTransportMeansType);
    FLUXReportDocumentType fluxReportDocumentType = new FLUXReportDocumentType();
    DateTimeType dateTimeType = new DateTimeType();
    dateTimeType.setDateTime(DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar));
    fluxReportDocumentType.setCreationDateTime(dateTimeType);
    FLUXPartyType fLUXPartyType = new FLUXPartyType();
    fLUXPartyType.getIDS().add(countryId);
    fluxReportDocumentType.setOwnerFLUXParty(fLUXPartyType);
    TextType textType = new TextType();
    fluxReportDocumentType.setPurpose(textType);
    CodeType purposeCode = new CodeType();
    purposeCode.setValue("9");
    fluxReportDocumentType.setPurposeCode(purposeCode);
    IDType idType = new IDType();
    fluxReportDocumentType.setReferencedID(idType);
    CodeType typeCode = new CodeType();
    fluxReportDocumentType.setTypeCode(typeCode);
    fLUXVesselPositionMessage.setFLUXReportDocument(fluxReportDocumentType);
    requestType.setAny(createAnyElement(fLUXVesselPositionMessage));
    requestType.setAD("SWE");
    requestType.setAR(true);
    requestType.setDF("df");
    requestType.setON("on");
    requestType.setTO(1234);
    requestType.setTODT(DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar));
    ResponseType responseType = bridgeConnectorPortType.post(requestType);
    assertNotNull(responseType);
    assertEquals("OK", responseType.getStatus());
    Thread.sleep(7500);
    List<String> connectIds = new ArrayList<>();
    connectIds.add(testAsset.getEventHistory().getEventId());
    final HttpResponse response = Request.Post(getBaseUrl() + "movement/rest/movement/latest").setHeader("Content-Type", "application/json").setHeader("Authorization", getValidJwtToken()).bodyByteArray(writeValueAsString(connectIds).getBytes()).execute().returnResponse();
    List dataList = checkSuccessResponseReturnType(response, List.class);
    assertEquals("Expect one position in movement db", 1, dataList.size());
}
Also used : ArrayList(java.util.ArrayList) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType) FLUXReportDocumentType(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._18.FLUXReportDocumentType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._18.IDType) BridgeConnectorPortType(xeu.bridge_connector.wsdl.v1.BridgeConnectorPortType) Asset(eu.europa.ec.fisheries.wsdl.asset.types.Asset) ArrayList(java.util.ArrayList) List(java.util.List) MobileTerminalType(eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType) VesselCountryType(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._18.VesselCountryType) FLUXVesselPositionMessage(un.unece.uncefact.data.standard.fluxvesselpositionmessage._4.FLUXVesselPositionMessage) VesselGeographicalCoordinateType(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._18.VesselGeographicalCoordinateType) GregorianCalendar(java.util.GregorianCalendar) VesselPositionEventType(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._18.VesselPositionEventType) HttpResponse(org.apache.http.HttpResponse) VesselTransportMeansType(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._18.VesselTransportMeansType) FLUXPartyType(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._18.FLUXPartyType) Date(java.util.Date) BigDecimal(java.math.BigDecimal) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._18.TextType) ResponseType(xeu.bridge_connector.v1.ResponseType) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._18.DateTimeType) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._18.CodeType) RequestType(xeu.bridge_connector.v1.RequestType) Ignore(org.junit.Ignore) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)

Example 34 with CodeType

use of org.geotoolkit.ows.xml.v110.CodeType in project geo-platform by geosdi.

the class WPSDescribeProcessRequestV100 method createRequest.

/**
 * @return {@link DescribeProcess}
 * @throws Exception
 */
@Override
protected DescribeProcess createRequest() throws Exception {
    checkArgument(this.isSetProcessIdentifiers(), "The Parameter ProcessIdentifiers must not be null or Empty.");
    List<CodeType> processCodeTypes = this.processIdentifiers.stream().filter(value -> ((value != null) && !(value.trim().isEmpty()))).map(PROCESS_IDENTIFIER).collect(toList());
    checkArgument((processCodeTypes != null) && !(processCodeTypes.isEmpty()), "The Parameter ProcessCodeTypes must not be null or an Empty List.");
    DescribeProcess describeProcess = new DescribeProcess();
    describeProcess.setIdentifier(processCodeTypes);
    if (this.isLanguageSet())
        describeProcess.setLanguage(this.language);
    return describeProcess;
}
Also used : CodeType(org.geosdi.geoplatform.xml.ows.v110.CodeType) DescribeProcess(org.geosdi.geoplatform.xml.wps.v100.DescribeProcess)

Example 35 with CodeType

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

the class ActivityEntityToModelMapper method mapVesselStorageCharCodes.

private void mapVesselStorageCharCodes(VesselStorageCharacteristic target, Set<VesselStorageCharCodeEntity> vesselStorageCharCode) {
    if (CollectionUtils.isNotEmpty(vesselStorageCharCode) && target != null) {
        List<CodeType> codeTypeList = new ArrayList<>();
        for (VesselStorageCharCodeEntity source : vesselStorageCharCode) {
            CodeType codeType = new CodeType();
            codeType.setValue(source.getVesselTypeCode());
            codeType.setListID(source.getVesselTypeCodeListId());
            codeTypeList.add(codeType);
        }
        target.setTypeCodes(codeTypeList);
    }
}
Also used : VesselStorageCharCodeEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharCodeEntity) ArrayList(java.util.ArrayList) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

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