use of org.n52.shetland.inspire.InspireDateOfPublication in project arctic-sea by 52North.
the class InspireEncoderTest method getFullInspireExtendedCapabilities.
private FullInspireExtendedCapabilities getFullInspireExtendedCapabilities() {
InspireResourceLocator resourceLocator = new InspireResourceLocator("http://full.test.org/sos");
resourceLocator.addMediaType(MediaTypes.APPLICATION_SOAP_XML);
// -------------------
InspireTemporalReference temporalReference = new InspireTemporalReference();
temporalReference.setDateOfCreation(new InspireDateOfCreation(new DateTime()));
temporalReference.setDateOfLastRevision(new InspireDateOfLastRevision(new DateTime()));
temporalReference.addDateOfPublication(new InspireDateOfPublication(new DateTime()));
temporalReference.addTemporalExtent(new TimeInstant(new DateTime()));
temporalReference.addTemporalExtent(new TimePeriod(new DateTime(), new DateTime().plus(3456)));
// -------------------
InspireConformityCitation inspireConformityCitation = new InspireConformityCitation("Test", new InspireDateOfCreation(new DateTime()));
InspireConformity conformity = new InspireConformity(inspireConformityCitation, InspireDegreeOfConformity.notEvaluated);
// -------------------
InspireMetadataPointOfContact inspireMetadataPointOfContact = new InspireMetadataPointOfContact("test", "test@test.te");
// -------------------
InspireOriginatingControlledVocabulary inspireOriginatingControlledVocabulary = new InspireOriginatingControlledVocabulary("Test", new InspireDateOfCreation(new DateTime()));
InspireMandatoryKeyword inspireMandatoryKeyword = new InspireMandatoryKeyword(InspireMandatoryKeywordValue.humanServiceEditor, inspireOriginatingControlledVocabulary);
// --------------------
InspireSupportedLanguages inspireSupportedLanguages = new InspireSupportedLanguages(InspireLanguageISO6392B.ENG);
// --------------------
InspireLanguageISO6392B responseLanguage = InspireLanguageISO6392B.ENG;
// --------------------
InspireUniqueResourceIdentifier iuri = new InspireUniqueResourceIdentifier("test");
iuri.setNamespace("http://test.org");
// --------------------
FullInspireExtendedCapabilities inspireExtendedCapabilities = new FullInspireExtendedCapabilities(resourceLocator, inspireSupportedLanguages, responseLanguage, iuri, new InspireSupportedCRS("4326"));
inspireExtendedCapabilities.setResourceType(InspireServiceSpatialDataResourceType.service);
inspireExtendedCapabilities.addKeyword(new InspireKeyword("test"));
inspireExtendedCapabilities.addMandatoryKeyword(inspireMandatoryKeyword);
// -------------------
inspireExtendedCapabilities.setMetadataDate(new TimeInstant(new DateTime()));
// -------------------
inspireExtendedCapabilities.addMetadataPointOfContact(inspireMetadataPointOfContact);
inspireExtendedCapabilities.addConformity(conformity);
inspireExtendedCapabilities.addTemporalReference(temporalReference);
return inspireExtendedCapabilities;
}
use of org.n52.shetland.inspire.InspireDateOfPublication in project arctic-sea by 52North.
the class InspireXmlStreamWriter method writeTemporalReference.
/**
* Write {@link InspireTemporalReference} to stream
*
* @param temporalReference
* {@link InspireTemporalReference} to write to stream
* @throws XMLStreamException
* If an error occurs when writing the object to stream
*/
private void writeTemporalReference(InspireTemporalReference temporalReference) throws XMLStreamException {
if (!temporalReference.isSetDateOfCreation() && !temporalReference.isSetDateOfLastRevision() && !temporalReference.isSetDatesOfPublication() && !temporalReference.isSetTemporalExtents()) {
empty(QN_TEMPORAL_REFERENCE);
} else {
start(QN_TEMPORAL_REFERENCE);
if (temporalReference.isSetDateOfCreation()) {
writeDateOfCreation(temporalReference.getDateOfCreation());
}
if (temporalReference.isSetDateOfLastRevision()) {
writeDateOfLastRevision(temporalReference.getDateOfLastRevision());
}
if (temporalReference.isSetDatesOfPublication()) {
for (InspireDateOfPublication dateOfPublication : temporalReference.getDatesOfPublication()) {
writeDateOfPublication(dateOfPublication);
}
}
if (temporalReference.isSetTemporalExtents()) {
for (Time temporalExtent : temporalReference.getTemporalExtents()) {
writeTemporalExtent(temporalExtent);
}
}
end(QN_TEMPORAL_REFERENCE);
}
}
Aggregations