use of un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getStructuredAddress.
public static StructuredAddress getStructuredAddress() {
IDType id = getIdType("ID type 1", "5ryit6-5tj47e-45jfyr-4tu57fg");
CodeType postcodeCode = getCodeType("Post code 1", "5ryit6-5tj47e-45jfyr-4tu57fg-rt54tgr");
TextType buildingName = getTextType("Test Building");
TextType streetName = getTextType("Test Street");
TextType cityName = getTextType("Test City");
IDType countryID = getIdType("Test Country", "ryfht53-fht5-6htfur-57thft");
TextType citySubDivisionName = getTextType("Test city subdivision");
TextType countryName = getTextType("Test Country");
TextType countrySubDivisionName = getTextType("Test country subdivision");
TextType blockName = getTextType("Test Block");
TextType plotIdentification = getTextType("123");
TextType postOfficeBox = getTextType("548675");
TextType buildingNumber = getTextType("12345");
TextType staircaseNumber = getTextType("3456");
TextType floorIdentification = getTextType("8888");
TextType roomIdentification = getTextType("555");
TextType postalArea = getTextType("123");
// StructuredAddress structuredAddress = new StructuredAddress();
StructuredAddress structuredAddress = new StructuredAddress(id, postcodeCode, buildingName, streetName, cityName, countryID, citySubDivisionName, countryName, countrySubDivisionName, blockName, plotIdentification, postOfficeBox, buildingNumber, staircaseNumber, floorIdentification, roomIdentification, postalArea);
/* StructuredAddress structuredAddress = new StructuredAddress(id, postcodeCode, buildingName, streetName,
cityName, countryID, citySubDivisionName, countryName, countrySubDivisionName, blockName, plotIdentification,
postOfficeBox, buildingNumber, staircaseNumber, floorIdentification, roomIdentification);*/
return structuredAddress;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getContactPerson.
public static ContactPerson getContactPerson() {
TextType title = getTextType("MR");
TextType givenName = getTextType("Test Name");
TextType middleName = getTextType("Test Middle Name");
TextType familyNamePrefix = getTextType("Test Prefix");
TextType familyName = getTextType("Test Family Name");
TextType nameSuffix = getTextType("Test Suffix");
CodeType genderCode = getCodeType("Gender", "4ryf65-fhtfyd-thfey45-tu5r7ght");
TextType alias = getTextType("Test Alias");
// ContactPerson contactPerson = new ContactPerson();
ContactPerson contactPerson = new ContactPerson(title, givenName, middleName, familyNamePrefix, familyName, nameSuffix, genderCode, alias, null, null, null, null, null, null, null);
return contactPerson;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType 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;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType 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());
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType in project arctic-sea by 52North.
the class SweCommonDecoderV20 method parseAbstractDataComponent.
private SweAbstractDataComponent parseAbstractDataComponent(AbstractDataComponentType abstractDataComponent) throws DecodingException {
SweAbstractDataComponent sosAbstractDataComponent = null;
if (abstractDataComponent instanceof BooleanType) {
sosAbstractDataComponent = parseBoolean((BooleanType) abstractDataComponent);
} else if (abstractDataComponent instanceof CategoryType) {
sosAbstractDataComponent = parseCategory((CategoryType) abstractDataComponent);
} else if (abstractDataComponent instanceof CountRangeType) {
sosAbstractDataComponent = parseCountRange((CountRangeType) abstractDataComponent);
} else if (abstractDataComponent instanceof CountType) {
sosAbstractDataComponent = parseCount((CountType) abstractDataComponent);
} else if (abstractDataComponent instanceof QuantityType) {
sosAbstractDataComponent = parseQuantity((QuantityType) abstractDataComponent);
} else if (abstractDataComponent instanceof QuantityRangeType) {
sosAbstractDataComponent = parseQuantityRange((QuantityRangeType) abstractDataComponent);
} else if (abstractDataComponent instanceof TextType) {
sosAbstractDataComponent = parseText((TextType) abstractDataComponent);
} else if (abstractDataComponent instanceof TimeType) {
sosAbstractDataComponent = parseTime((TimeType) abstractDataComponent);
} else if (abstractDataComponent instanceof TimeRangeType) {
sosAbstractDataComponent = parseTimeRange((TimeRangeType) abstractDataComponent);
} else if (abstractDataComponent instanceof VectorType) {
sosAbstractDataComponent = parseVector((VectorType) abstractDataComponent);
} else if (abstractDataComponent instanceof DataRecordType) {
SweDataRecord sosDataRecord = parseDataRecord((DataRecordType) abstractDataComponent);
DataRecordDocument dataRecordDoc = DataRecordDocument.Factory.newInstance(getXmlOptions());
dataRecordDoc.setDataRecord((DataRecordType) abstractDataComponent);
sosDataRecord.setXml(dataRecordDoc.xmlText(getXmlOptions()));
sosAbstractDataComponent = sosDataRecord;
} else if (abstractDataComponent instanceof DataArrayType) {
SweDataArray sosDataArray = parseDataArray((DataArrayType) abstractDataComponent);
DataArrayDocument dataArrayDoc = DataArrayDocument.Factory.newInstance(getXmlOptions());
dataArrayDoc.setDataArray1((DataArrayType) abstractDataComponent);
sosDataArray.setXml(dataArrayDoc.xmlText(getXmlOptions()));
sosAbstractDataComponent = sosDataArray;
} else if (abstractDataComponent == null) {
LOGGER.debug("abstractDataComponent is null");
} else {
throw new UnsupportedDecoderXmlInputException(this, abstractDataComponent);
}
if (sosAbstractDataComponent != null) {
if (abstractDataComponent.isSetDefinition()) {
sosAbstractDataComponent.setDefinition(abstractDataComponent.getDefinition());
}
if (abstractDataComponent.isSetDescription()) {
sosAbstractDataComponent.setDescription(abstractDataComponent.getDescription());
}
if (abstractDataComponent.isSetIdentifier()) {
sosAbstractDataComponent.setIdentifier(abstractDataComponent.getIdentifier());
}
if (abstractDataComponent.isSetLabel()) {
sosAbstractDataComponent.setLabel(abstractDataComponent.getLabel());
}
}
return sosAbstractDataComponent;
}
Aggregations