use of un.unece.uncefact.data.standard.unqualifieddatatype._100.DateTimeType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapOccurrenceDateTime.
private void mapOccurrenceDateTime(FishingActivity target, Date source) {
if (ObjectUtils.allNotNull(target, source)) {
DateTimeType dateTimeType = new DateTimeType();
dateTimeType.setDateTime(DateUtils.dateToXmlGregorian(source));
target.setOccurrenceDateTime(dateTimeType);
}
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.DateTimeType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getDelimitedPeriod.
public static DelimitedPeriod getDelimitedPeriod() {
DateTimeType startDate = getDateTimeType("2011-07-01 11:15:00");
DateTimeType endDate = getDateTimeType("2016-07-01 11:15:00");
MeasureType measureType = getMeasureType(500, "C62", "4rhfy5-fhtydr-tyfr85-ghtyd54");
DelimitedPeriod delimitedPeriod = new DelimitedPeriod(startDate, endDate, measureType);
return delimitedPeriod;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.DateTimeType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getDateTimeType.
private static DateTimeType getDateTimeType(String value) {
try {
DateTimeType dateTimeType = new DateTimeType();
DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
GregorianCalendar cal = new GregorianCalendar();
cal.setTime(df.parse(value));
XMLGregorianCalendar xmlDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND), DatatypeConstants.FIELD_UNDEFINED, cal.getTimeZone().LONG).normalize();
dateTimeType.setDateTime(xmlDate);
return dateTimeType;
} catch (Exception e) {
return null;
}
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.DateTimeType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getGearCharacteristics.
public static GearCharacteristic getGearCharacteristics() {
CodeType typeCode = getCodeType("Code 1", "57t3yf-ght43yrf-ght56yru-ght7565h");
List<TextType> descriptions = Arrays.asList(getTextType("This is sample text"));
MeasureType valueMeasure = getMeasureType(123, "C62", "57t3yf-ght43yrf-ght56yru-ght7565h");
DateTimeType valueDateTime = getDateTimeType("2016-07-01 11:15:00");
IndicatorType valueIndicator = getIndicatorType(true, "Test value", "Test format");
CodeType valueCode = getCodeType("Code type 1", "4fhry5-thfyr85-67thf-5htr84");
TextType value = getTextType("This is sample Text");
QuantityType valueQuantity = getQuantityType(123);
List<FLUXLocation> specifiedFluxLocations = Arrays.asList(getFluxLocation());
GearCharacteristic gearCharacteristic = new GearCharacteristic(typeCode, descriptions, valueMeasure, valueDateTime, valueIndicator, valueCode, value, valueQuantity, specifiedFluxLocations);
return gearCharacteristic;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.DateTimeType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getFaReportDocument.
public static FAReportDocument getFaReportDocument() {
CodeType typeCode = getCodeType("DECLARATION", "FLUX_FA_REPORT_TYPE");
CodeType fmcMarkerCode = getCodeType("Fmz marker 1", "h49rh-fhrus33-fj84hjs82-4h84hw82");
List<IDType> relatedReportIDs = Arrays.asList(getIdType("ID 1", "47rfh-5hry4-thfur75-4hf743"));
DateTimeType acceptanceDateTime = getDateTimeType("2016-07-01 11:15:00");
FLUXReportDocument relatedFLUXReportDocument = getFluxReportDocument();
List<FishingActivity> specifiedFishingActivities = Arrays.asList(getFishingActivity());
VesselTransportMeans specifiedVesselTransportMeans = getVesselTransportMeans();
FAReportDocument faReportDocument = new FAReportDocument(typeCode, fmcMarkerCode, relatedReportIDs, acceptanceDateTime, relatedFLUXReportDocument, specifiedFishingActivities, specifiedVesselTransportMeans);
return faReportDocument;
}
Aggregations