Search in sources :

Example 6 with DataArrayDocument

use of net.opengis.swe.x20.DataArrayDocument in project arctic-sea by 52North.

the class SensorMLEncoderv101 method addIoComponentPropertyType.

/**
 * Adds a SOS SWE simple type to a XML SML IO component.
 *
 * @param ioComponentPropertyType
 *            SML IO component
 * @param sosSMLIO
 *            SOS SWE simple type.
 *
 * @throws EncodingException
 *             if the encoding fails
 */
private void addIoComponentPropertyType(IoComponentPropertyType ioComponentPropertyType, SmlIo sosSMLIO) throws EncodingException {
    ioComponentPropertyType.setName(sosSMLIO.getIoName());
    if (sosSMLIO.isSetHref()) {
        ioComponentPropertyType.setHref(sosSMLIO.getTitle());
        if (sosSMLIO.isSetTitle()) {
            ioComponentPropertyType.setTitle(sosSMLIO.getTitle());
        }
    } else {
        XmlObject encodeObjectToXml;
        XmlObject xml = encodeObjectToXml(SweConstants.NS_SWE_101, sosSMLIO.getIoValue());
        if (xml instanceof DataArrayDocument) {
            encodeObjectToXml = ((DataArrayDocument) xml).getDataArray1();
        } else {
            encodeObjectToXml = xml;
        }
        sosSMLIO.getIoValue().accept(new SweDataComponentAdder(ioComponentPropertyType)).map(h -> (AbstractDataComponentType) h.set(encodeObjectToXml)).ifPresent(h -> sosSMLIO.getIoValue().accept(new SweDataComponentSubstituter(h)));
    }
}
Also used : PositionType(net.opengis.swe.x101.PositionType) SosConstants(org.n52.shetland.ogc.sos.SosConstants) Contact(net.opengis.sensorML.x101.ContactDocument.Contact) Time(org.n52.shetland.ogc.gml.time.Time) PointType(net.opengis.gml.PointType) Phone(net.opengis.sensorML.x101.ContactInfoDocument.ContactInfo.Phone) ComponentList(net.opengis.sensorML.x101.ComponentsDocument.Components.ComponentList) SmlLocation(org.n52.shetland.ogc.sensorML.elements.SmlLocation) SweAggregateType(org.n52.shetland.ogc.swe.SweConstants.SweAggregateType) TimeInstant(org.n52.shetland.ogc.gml.time.TimeInstant) ProcessMethod(org.n52.shetland.ogc.sensorML.ProcessMethod) Map(java.util.Map) DataArrayDocument(net.opengis.swe.x101.DataArrayDocument) SchemaType(org.apache.xmlbeans.SchemaType) CodeType(org.n52.shetland.ogc.gml.CodeType) SweDataRecord(org.n52.shetland.ogc.swe.SweDataRecord) VectorType(net.opengis.swe.x101.VectorType) SensorML(org.n52.shetland.ogc.sensorML.SensorML) EncodingException(org.n52.svalbard.encode.exception.EncodingException) IoComponentPropertyType(net.opengis.sensorML.x101.IoComponentPropertyType) Set(java.util.Set) SmlPerson(org.n52.shetland.ogc.sensorML.SmlPerson) Connections(net.opengis.sensorML.x101.ConnectionsDocument.Connections) Inputs(net.opengis.sensorML.x101.InputsDocument.Inputs) SchemaLocation(org.n52.shetland.w3c.SchemaLocation) SmlDocumentation(org.n52.shetland.ogc.sensorML.elements.SmlDocumentation) AnyScalarPropertyType(net.opengis.swe.x101.AnyScalarPropertyType) SmlClassifier(org.n52.shetland.ogc.sensorML.elements.SmlClassifier) AbstractProcessType(net.opengis.sensorML.x101.AbstractProcessType) QName(javax.xml.namespace.QName) ProcessMethodType(net.opengis.sensorML.x101.ProcessMethodType) Joiner(com.google.common.base.Joiner) ProcessModel(org.n52.shetland.ogc.sensorML.ProcessModel) ContactList(net.opengis.sensorML.x101.ContactListDocument.ContactList) SmlPosition(org.n52.shetland.ogc.sensorML.elements.SmlPosition) SweQuantity(org.n52.shetland.ogc.swe.simpleType.SweQuantity) SmlLocation2(net.opengis.sensorML.x101.SmlLocation.SmlLocation2) SweQuantityRange(org.n52.shetland.ogc.swe.simpleType.SweQuantityRange) XmlCursor(org.apache.xmlbeans.XmlCursor) ContactInfo(net.opengis.sensorML.x101.ContactInfoDocument.ContactInfo) XmlHelper(org.n52.svalbard.util.XmlHelper) MediaType(org.n52.janmayen.http.MediaType) ResponsibleParty(net.opengis.sensorML.x101.ResponsiblePartyDocument.ResponsibleParty) Components(net.opengis.sensorML.x101.ComponentsDocument.Components) Lists(com.google.common.collect.Lists) ComponentType(net.opengis.sensorML.x101.ComponentType) ConnectionList(net.opengis.sensorML.x101.ConnectionsDocument.Connections.ConnectionList) SweCount(org.n52.shetland.ogc.swe.simpleType.SweCount) Capabilities(net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities) Link(net.opengis.sensorML.x101.LinkDocument.Link) Sos2Constants(org.n52.shetland.ogc.sos.Sos2Constants) AbstractSmlDocumentation(org.n52.shetland.ogc.sensorML.elements.AbstractSmlDocumentation) AbstractProcess(org.n52.shetland.ogc.sensorML.AbstractProcess) SweCountRange(org.n52.shetland.ogc.swe.simpleType.SweCountRange) SmlConnection(org.n52.shetland.ogc.sensorML.elements.SmlConnection) ProcessModelType(net.opengis.sensorML.x101.ProcessModelType) SweText(org.n52.shetland.ogc.swe.simpleType.SweText) Member(net.opengis.sensorML.x101.SensorMLDocument.SensorML.Member) SweField(org.n52.shetland.ogc.swe.SweField) XmlException(org.apache.xmlbeans.XmlException) SweSimpleDataRecord(org.n52.shetland.ogc.swe.SweSimpleDataRecord) SweDataArray(org.n52.shetland.ogc.swe.SweDataArray) DataRecordType(net.opengis.swe.x101.DataRecordType) Address(net.opengis.sensorML.x101.ContactInfoDocument.ContactInfo.Address) SmlResponsibleParty(org.n52.shetland.ogc.sensorML.SmlResponsibleParty) SweTimeRange(org.n52.shetland.ogc.swe.simpleType.SweTimeRange) LoggerFactory(org.slf4j.LoggerFactory) Documentation(net.opengis.sensorML.x101.DocumentationDocument.Documentation) SmlContact(org.n52.shetland.ogc.sensorML.SmlContact) SweBoolean(org.n52.shetland.ogc.swe.simpleType.SweBoolean) ComponentDocument(net.opengis.sensorML.x101.ComponentDocument) MethodPropertyType(net.opengis.sensorML.x101.MethodPropertyType) SensorMLDocument(net.opengis.sensorML.x101.SensorMLDocument) SmlDocumentationList(org.n52.shetland.ogc.sensorML.elements.SmlDocumentationList) ProcedureDescriptionFormat(org.n52.shetland.ogc.sos.ProcedureDescriptionFormat) SweAbstractSimpleType(org.n52.shetland.ogc.swe.simpleType.SweAbstractSimpleType) SweCategory(org.n52.shetland.ogc.swe.simpleType.SweCategory) ImmutableSet(com.google.common.collect.ImmutableSet) AbstractVoidSweDataComponentVisitor(org.n52.shetland.ogc.swe.AbstractVoidSweDataComponentVisitor) SweCoordinate(org.n52.shetland.ogc.swe.SweCoordinate) ImmutableMap(com.google.common.collect.ImmutableMap) SmlComponent(org.n52.shetland.ogc.sensorML.elements.SmlComponent) OutputList(net.opengis.sensorML.x101.OutputsDocument.Outputs.OutputList) Classifier(net.opengis.sensorML.x101.ClassificationDocument.Classification.ClassifierList.Classifier) Classification(net.opengis.sensorML.x101.ClassificationDocument.Classification) Sets(com.google.common.collect.Sets) ClassifierList(net.opengis.sensorML.x101.ClassificationDocument.Classification.ClassifierList) System(org.n52.shetland.ogc.sensorML.System) Objects(java.util.Objects) List(java.util.List) Characteristics(net.opengis.sensorML.x101.CharacteristicsDocument.Characteristics) GmlConstants(org.n52.shetland.ogc.gml.GmlConstants) Identifier(net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList.Identifier) AbstractDataComponentType(net.opengis.swe.x101.AbstractDataComponentType) Outputs(net.opengis.sensorML.x101.OutputsDocument.Outputs) SmlCharacteristics(org.n52.shetland.ogc.sensorML.elements.SmlCharacteristics) CollectionHelper(org.n52.shetland.util.CollectionHelper) Person(net.opengis.sensorML.x101.PersonDocument.Person) SupportedType(org.n52.shetland.ogc.SupportedType) TimePeriod(org.n52.shetland.ogc.gml.time.TimePeriod) SmlLink(org.n52.shetland.ogc.sensorML.elements.SmlLink) Position(net.opengis.sensorML.x101.PositionDocument.Position) SystemDocument(net.opengis.sensorML.x101.SystemDocument) AbstractSensorML(org.n52.shetland.ogc.sensorML.AbstractSensorML) Document(net.opengis.sensorML.x101.DocumentDocument.Document) SmlContactList(org.n52.shetland.ogc.sensorML.SmlContactList) Component(net.opengis.sensorML.x101.ComponentsDocument.Components.ComponentList.Component) RulesDefinition(net.opengis.sensorML.x101.ProcessMethodType.Rules.RulesDefinition) SensorMLConstants(org.n52.shetland.ogc.sensorML.SensorMLConstants) SweTime(org.n52.shetland.ogc.swe.simpleType.SweTime) SmlIdentifier(org.n52.shetland.ogc.sensorML.elements.SmlIdentifier) SystemType(net.opengis.sensorML.x101.SystemType) DataArrayType(net.opengis.swe.x101.DataArrayType) SweConstants(org.n52.shetland.ogc.swe.SweConstants) UnsupportedEncoderInputException(org.n52.svalbard.encode.exception.UnsupportedEncoderInputException) XmlObject(org.apache.xmlbeans.XmlObject) ProcessModelDocument(net.opengis.sensorML.x101.ProcessModelDocument) SweAbstractDataComponent(org.n52.shetland.ogc.swe.SweAbstractDataComponent) SweObservableProperty(org.n52.shetland.ogc.swe.simpleType.SweObservableProperty) SmlCapabilities(org.n52.shetland.ogc.sensorML.elements.SmlCapabilities) IdentifierList(net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList) Logger(org.slf4j.Logger) SimpleDataRecordType(net.opengis.swe.x101.SimpleDataRecordType) AbstractOptionalSweDataComponentVisitor(org.n52.shetland.ogc.swe.AbstractOptionalSweDataComponentVisitor) DocumentList(net.opengis.sensorML.x101.DocumentListDocument.DocumentList) Identification(net.opengis.sensorML.x101.IdentificationDocument.Identification) SmlIo(org.n52.shetland.ogc.sensorML.elements.SmlIo) Term(net.opengis.sensorML.x101.TermDocument.Term) XmlOptions(org.apache.xmlbeans.XmlOptions) Sos1Constants(org.n52.shetland.ogc.sos.Sos1Constants) InputList(net.opengis.sensorML.x101.InputsDocument.Inputs.InputList) CodingHelper(org.n52.svalbard.util.CodingHelper) Collections(java.util.Collections) AbstractDataComponentType(net.opengis.swe.x101.AbstractDataComponentType) XmlObject(org.apache.xmlbeans.XmlObject) DataArrayDocument(net.opengis.swe.x101.DataArrayDocument)

Aggregations

SweDataArray (org.n52.shetland.ogc.swe.SweDataArray)5 DataArrayDocument (net.opengis.swe.x101.DataArrayDocument)3 SweDataRecord (org.n52.shetland.ogc.swe.SweDataRecord)3 DataArrayType (net.opengis.swe.x101.DataArrayType)2 DataComponentPropertyType (net.opengis.swe.x101.DataComponentPropertyType)2 BooleanType (net.opengis.swe.x20.BooleanType)2 CategoryType (net.opengis.swe.x20.CategoryType)2 CountRangeType (net.opengis.swe.x20.CountRangeType)2 CountType (net.opengis.swe.x20.CountType)2 DataArrayDocument (net.opengis.swe.x20.DataArrayDocument)2 DataArrayType (net.opengis.swe.x20.DataArrayType)2 DataRecordDocument (net.opengis.swe.x20.DataRecordDocument)2 DataRecordType (net.opengis.swe.x20.DataRecordType)2 QuantityRangeType (net.opengis.swe.x20.QuantityRangeType)2 QuantityType (net.opengis.swe.x20.QuantityType)2 TextType (net.opengis.swe.x20.TextType)2 TimeRangeType (net.opengis.swe.x20.TimeRangeType)2 TimeType (net.opengis.swe.x20.TimeType)2 VectorType (net.opengis.swe.x20.VectorType)2 XmlException (org.apache.xmlbeans.XmlException)2