Search in sources :

Example 1 with OwsOnlineResource

use of org.n52.shetland.ogc.ows.OwsOnlineResource in project arctic-sea by 52North.

the class AbstractCapabilitiesBaseTypeDecoder method parseContact.

private OwsContact parseContact(ContactType contactInfo) {
    if (contactInfo == null) {
        return null;
    }
    OwsOnlineResource onlineResource = parseOnlineResource(contactInfo.getOnlineResource());
    String hoursOfService = contactInfo.getHoursOfService();
    String contactInstructions = contactInfo.getContactInstructions();
    OwsAddress address = parseAddress(contactInfo.getAddress());
    OwsPhone phone = parsePhone(contactInfo.getPhone());
    return new OwsContact(phone, address, onlineResource, hoursOfService, contactInstructions);
}
Also used : OwsOnlineResource(org.n52.shetland.ogc.ows.OwsOnlineResource) OwsContact(org.n52.shetland.ogc.ows.OwsContact) OwsAddress(org.n52.shetland.ogc.ows.OwsAddress) LocalizedString(org.n52.janmayen.i18n.LocalizedString) MultilingualString(org.n52.janmayen.i18n.MultilingualString) OwsLanguageString(org.n52.shetland.ogc.ows.OwsLanguageString) OwsPhone(org.n52.shetland.ogc.ows.OwsPhone)

Example 2 with OwsOnlineResource

use of org.n52.shetland.ogc.ows.OwsOnlineResource in project arctic-sea by 52North.

the class AbstractCapabilitiesBaseTypeDecoder method parseOnlineResource.

private OwsOnlineResource parseOnlineResource(OnlineResourceType onlineResource) {
    if (onlineResource == null) {
        return null;
    }
    URI href = Optional.ofNullable(onlineResource.getHref()).map(Strings::emptyToNull).map(URI::create).orElse(null);
    URI role = Optional.ofNullable(onlineResource.getRole()).map(Strings::emptyToNull).map(URI::create).orElse(null);
    URI arcrole = Optional.ofNullable(onlineResource.getArcrole()).map(Strings::emptyToNull).map(URI::create).orElse(null);
    Show show = Optional.ofNullable(onlineResource.getShow()).map(Object::toString).map(Show::valueOf).orElse(null);
    Actuate actuate = Optional.ofNullable(onlineResource.getActuate()).map(Object::toString).map(Actuate::valueOf).orElse(null);
    String title = onlineResource.getTitle();
    return new OwsOnlineResource(href, role, arcrole, title, show, actuate);
}
Also used : OwsOnlineResource(org.n52.shetland.ogc.ows.OwsOnlineResource) Actuate(org.n52.shetland.w3c.xlink.Actuate) Show(org.n52.shetland.w3c.xlink.Show) XmlObject(org.apache.xmlbeans.XmlObject) LocalizedString(org.n52.janmayen.i18n.LocalizedString) MultilingualString(org.n52.janmayen.i18n.MultilingualString) OwsLanguageString(org.n52.shetland.ogc.ows.OwsLanguageString) URI(java.net.URI) Strings(com.google.common.base.Strings)

Example 3 with OwsOnlineResource

use of org.n52.shetland.ogc.ows.OwsOnlineResource in project arctic-sea by 52North.

the class OwsServiceProviderFactory method create.

@Override
protected OwsServiceProvider create(Locale language) throws ConfigurationError {
    // TODO organisation name is missing
    String organisationName = null;
    OwsOnlineResource onlineResource = null;
    if (site != null) {
        onlineResource = new OwsOnlineResource(site);
    }
    OwsCode roleCode = null;
    if (role != null) {
        roleCode = new OwsCode(role, roleCodespace);
    }
    OwsOnlineResource providerSite = null;
    if (onlineResoureHref != null) {
        providerSite = new OwsOnlineResource(onlineResoureHref, onlineResoureTitle);
    }
    OwsAddress address = null;
    if (anyNonNull(deliveryPoint, city, administrativeArea, postalCode, country, electronicMailAddress)) {
        address = new OwsAddress(deliveryPoint, city, administrativeArea, postalCode, country, electronicMailAddress);
    }
    OwsPhone owsPhone = null;
    if (anyNonNull(phone, facsimile)) {
        owsPhone = new OwsPhone(phone, facsimile);
    }
    OwsContact contactInfo = null;
    if (anyNonNull(owsPhone, address, onlineResource, hoursOfService, contactInstructions)) {
        contactInfo = new OwsContact(owsPhone, address, onlineResource, hoursOfService, contactInstructions);
    }
    OwsResponsibleParty serviceContact = new OwsResponsibleParty(individualName, organisationName, positionName, contactInfo, roleCode);
    return new OwsServiceProvider(name, providerSite, serviceContact);
}
Also used : OwsOnlineResource(org.n52.shetland.ogc.ows.OwsOnlineResource) OwsResponsibleParty(org.n52.shetland.ogc.ows.OwsResponsibleParty) OwsContact(org.n52.shetland.ogc.ows.OwsContact) OwsServiceProvider(org.n52.shetland.ogc.ows.OwsServiceProvider) OwsCode(org.n52.shetland.ogc.ows.OwsCode) OwsAddress(org.n52.shetland.ogc.ows.OwsAddress) OwsPhone(org.n52.shetland.ogc.ows.OwsPhone)

Example 4 with OwsOnlineResource

use of org.n52.shetland.ogc.ows.OwsOnlineResource in project arctic-sea by 52North.

the class AbstractCapabilitiesBaseTypeDecoder method parseServiceProvider.

private OwsServiceProvider parseServiceProvider(ServiceProvider serviceProvider) {
    if (serviceProvider == null) {
        return null;
    }
    OwsOnlineResource providerSite = parseOnlineResource(serviceProvider.getProviderSite());
    OwsResponsibleParty serviceContact = parseResponsibleParty(serviceProvider.getServiceContact());
    String providerName = serviceProvider.getProviderName();
    return new OwsServiceProvider(providerName, providerSite, serviceContact);
}
Also used : OwsOnlineResource(org.n52.shetland.ogc.ows.OwsOnlineResource) OwsResponsibleParty(org.n52.shetland.ogc.ows.OwsResponsibleParty) OwsServiceProvider(org.n52.shetland.ogc.ows.OwsServiceProvider) LocalizedString(org.n52.janmayen.i18n.LocalizedString) MultilingualString(org.n52.janmayen.i18n.MultilingualString) OwsLanguageString(org.n52.shetland.ogc.ows.OwsLanguageString)

Aggregations

OwsOnlineResource (org.n52.shetland.ogc.ows.OwsOnlineResource)4 LocalizedString (org.n52.janmayen.i18n.LocalizedString)3 MultilingualString (org.n52.janmayen.i18n.MultilingualString)3 OwsLanguageString (org.n52.shetland.ogc.ows.OwsLanguageString)3 OwsAddress (org.n52.shetland.ogc.ows.OwsAddress)2 OwsContact (org.n52.shetland.ogc.ows.OwsContact)2 OwsPhone (org.n52.shetland.ogc.ows.OwsPhone)2 OwsResponsibleParty (org.n52.shetland.ogc.ows.OwsResponsibleParty)2 OwsServiceProvider (org.n52.shetland.ogc.ows.OwsServiceProvider)2 Strings (com.google.common.base.Strings)1 URI (java.net.URI)1 XmlObject (org.apache.xmlbeans.XmlObject)1 OwsCode (org.n52.shetland.ogc.ows.OwsCode)1 Actuate (org.n52.shetland.w3c.xlink.Actuate)1 Show (org.n52.shetland.w3c.xlink.Show)1