Search in sources :

Example 6 with Role

use of org.n52.shetland.iso.gco.Role in project arctic-sea by 52North.

the class AbstractCapabilitiesBaseTypeDecoder method parseResponsibleParty.

private OwsResponsibleParty parseResponsibleParty(ResponsiblePartySubsetType responsibleParty) {
    if (responsibleParty == null) {
        return null;
    }
    String positionName = responsibleParty.getPositionName();
    String individualName = responsibleParty.getIndividualName();
    String organisationName = null;
    OwsContact contactInfo = parseContact(responsibleParty.getContactInfo());
    OwsCode role = parseCode(responsibleParty.getRole());
    return new OwsResponsibleParty(individualName, organisationName, positionName, contactInfo, role);
}
Also used : OwsResponsibleParty(org.n52.shetland.ogc.ows.OwsResponsibleParty) OwsContact(org.n52.shetland.ogc.ows.OwsContact) OwsCode(org.n52.shetland.ogc.ows.OwsCode) LocalizedString(org.n52.janmayen.i18n.LocalizedString) MultilingualString(org.n52.janmayen.i18n.MultilingualString) OwsLanguageString(org.n52.shetland.ogc.ows.OwsLanguageString)

Example 7 with Role

use of org.n52.shetland.iso.gco.Role in project arctic-sea by 52North.

the class RelatedOfferingTypeDecoder method parseRelatedOffering.

private OfferingContext parseRelatedOffering(RelatedOffering relatedOffering) throws DecodingException {
    ReferenceType role = decodeXmlElement(relatedOffering.getOfferingContext().getRole());
    ReferenceType relOff = decodeXmlElement(relatedOffering.getOfferingContext().getRelatedOffering());
    return new OfferingContext(role, relOff);
}
Also used : ReferenceType(org.n52.shetland.ogc.gml.ReferenceType) OfferingContext(org.n52.shetland.ogc.sos.ro.OfferingContext)

Example 8 with Role

use of org.n52.shetland.iso.gco.Role in project arctic-sea by 52North.

the class SamplingFeatureComplexTest method should_set_role_correct.

@Test
public void should_set_role_correct() {
    final String role = "test-role";
    final SamplingFeatureComplex sfc = new SamplingFeatureComplex(role, new SamplingFeature(new CodeWithAuthority("test-feature")));
    assertThat(sfc.getRelatedSamplingFeatureRole(), is(role));
}
Also used : SamplingFeatureComplex(org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeatureComplex) SamplingFeature(org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature) CodeWithAuthority(org.n52.shetland.ogc.gml.CodeWithAuthority) Test(org.junit.Test)

Example 9 with Role

use of org.n52.shetland.iso.gco.Role in project arctic-sea by 52North.

the class SamplingFeatureTest method isSetRelatedSamplingFeatures_should_return_false_if_not_set.

@Test
public final void isSetRelatedSamplingFeatures_should_return_false_if_not_set() {
    final SamplingFeature feature = new SamplingFeature(null);
    assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
    feature.addRelatedSamplingFeature(new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature"))));
    assertThat(feature.isSetRelatedSamplingFeatures(), is(TRUE));
    feature.setRelatedSamplingFeatures(null);
    assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
    feature.setRelatedSamplingFeatures(Lists.<SamplingFeatureComplex>newArrayList());
    assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
}
Also used : SamplingFeatureComplex(org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeatureComplex) SamplingFeature(org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature) CodeWithAuthority(org.n52.shetland.ogc.gml.CodeWithAuthority) Test(org.junit.Test)

Example 10 with Role

use of org.n52.shetland.iso.gco.Role in project arctic-sea by 52North.

the class SamplingFeatureTest method setRelatedSamplingFeatures_should_set_all_elements_and_reset_if_set_before.

@Test
public final void setRelatedSamplingFeatures_should_set_all_elements_and_reset_if_set_before() {
    final SamplingFeature feature = new SamplingFeature(null);
    final SamplingFeatureComplex relatedSamplingFeature = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature")));
    final SamplingFeatureComplex relatedSamplingFeature2 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-2")));
    List<SamplingFeatureComplex> list = Lists.newArrayList(relatedSamplingFeature, relatedSamplingFeature2);
    feature.setRelatedSamplingFeatures(list);
    validate(feature, relatedSamplingFeature, relatedSamplingFeature2);
    final SamplingFeatureComplex relatedSamplingFeature3 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-3")));
    final SamplingFeatureComplex relatedSamplingFeature4 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-4")));
    list = Lists.newArrayList(relatedSamplingFeature3, relatedSamplingFeature4);
    feature.setRelatedSamplingFeatures(list);
    validate(feature, relatedSamplingFeature3, relatedSamplingFeature4);
}
Also used : SamplingFeatureComplex(org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeatureComplex) SamplingFeature(org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature) CodeWithAuthority(org.n52.shetland.ogc.gml.CodeWithAuthority) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 CodeWithAuthority (org.n52.shetland.ogc.gml.CodeWithAuthority)6 SamplingFeature (org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)6 SamplingFeatureComplex (org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeatureComplex)6 LocalizedString (org.n52.janmayen.i18n.LocalizedString)4 MultilingualString (org.n52.janmayen.i18n.MultilingualString)4 OwsLanguageString (org.n52.shetland.ogc.ows.OwsLanguageString)4 Strings (com.google.common.base.Strings)3 URI (java.net.URI)3 XmlObject (org.apache.xmlbeans.XmlObject)3 Actuate (org.n52.shetland.w3c.xlink.Actuate)3 Show (org.n52.shetland.w3c.xlink.Show)3 OwsCode (org.n52.shetland.ogc.ows.OwsCode)2 OwsContact (org.n52.shetland.ogc.ows.OwsContact)2 OwsOnlineResource (org.n52.shetland.ogc.ows.OwsOnlineResource)2 OwsResponsibleParty (org.n52.shetland.ogc.ows.OwsResponsibleParty)2 ReferenceType (org.n52.shetland.ogc.gml.ReferenceType)1 OwsAddress (org.n52.shetland.ogc.ows.OwsAddress)1 OwsDomain (org.n52.shetland.ogc.ows.OwsDomain)1 OwsMetadata (org.n52.shetland.ogc.ows.OwsMetadata)1