Search in sources :

Example 1 with Url

use of com.a9.opensearch.Url in project ARLAS-server by gisaia.

the class OpenSearchHandler method getOpenSearchDescription.

public OpenSearchDescription getOpenSearchDescription(String serverUrl) {
    ObjectFactory objectFactory = new ObjectFactory();
    OpenSearchDescription description = objectFactory.createOpenSearchDescription();
    description.getOtherAttributes().put(new QName("http://a9.com/-/opensearch/extensions/geo/1.0/", "opensearchgeo"), "opensearchgeo");
    description.setDescription(cswHandler.cswConfiguration.openSearchDescription);
    description.setShortName(cswHandler.cswConfiguration.openSearchShortName);
    Url urlXMLBox = new Url();
    urlXMLBox.setTemplate(serverUrl + "ogc/csw/?" + "request=GetRecords&service=CSW" + "&version=3.0.0&q={searchTerms?}" + "&startPosition={startIndex?}" + "&maxRecords={count?}" + "&bbox={ns3:box?}" + "&elementSetName=full&outputschema=http://www.opengis.net/cat/csw/3.0" + "&outputFormat=application/xml");
    urlXMLBox.setType(MediaType.APPLICATION_XML);
    Url urlATOMBox = new Url();
    urlATOMBox.setTemplate(serverUrl + "ogc/csw/?" + "request=GetRecords&service=CSW" + "&version=3.0.0&q={searchTerms?}" + "&startPosition={startIndex?}" + "&maxRecords={count?}" + "&bbox={ns3:box?}" + "&elementSetName=full" + "&outputFormat=application/atom%2Bxml");
    urlATOMBox.setType(MediaType.APPLICATION_ATOM_XML);
    Url urlXMLId = new Url();
    urlXMLId.setTemplate(serverUrl + "ogc/csw/?" + "request=GetRecords&service=CSW" + "&version=3.0.0" + "&startPosition={startIndex?}" + "&maxRecords={count?}" + "&recordIds={ns3:uid?}" + "&elementSetName=full&outputschema=http://www.opengis.net/cat/csw/3.0" + "&outputFormat=application/xml");
    urlXMLId.setType(MediaType.APPLICATION_XML);
    Url urlATOMId = new Url();
    urlATOMId.setTemplate(serverUrl + "ogc/csw/?" + "request=GetRecords&service=CSW" + "&version=3.0.0" + "&startPosition={startIndex?}" + "&maxRecords={count?}" + "&recordIds={ns3:uid?}" + "&elementSetName=full" + "&outputFormat=application/atom%2Bxml");
    urlATOMId.setType(MediaType.APPLICATION_ATOM_XML);
    description.getUrl().add(urlXMLBox);
    description.getUrl().add(urlXMLId);
    description.getUrl().add(urlATOMBox);
    description.getUrl().add(urlATOMId);
    return description;
}
Also used : ObjectFactory(com.a9.opensearch.ObjectFactory) QName(javax.xml.namespace.QName) Url(com.a9.opensearch.Url) OpenSearchDescription(com.a9.opensearch.OpenSearchDescription)

Aggregations

ObjectFactory (com.a9.opensearch.ObjectFactory)1 OpenSearchDescription (com.a9.opensearch.OpenSearchDescription)1 Url (com.a9.opensearch.Url)1 QName (javax.xml.namespace.QName)1