Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] Add UpdateResultTemplate operation #537

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions RELEASE-NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ RELEASE NOTES
==================================

--- New features ---

* Issue #532: Add UpdateResultTemplate operation
* https://github.com/52North/SOS/pull/537

* Issue #530: Add DeleteResultTemplate operation
* https://github.com/52North/SOS/pull/536


--- Changes ---
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2017 52north.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.n52.sos.event.events;

import org.n52.sos.request.UpdateResultTemplateRequest;
import org.n52.sos.response.UpdateResultTemplateResponse;

/**
* @author <a href="mailto:[email protected]">Eike Hinderk
* J&uuml;rrens</a>
*
* @since 4.4.0
*/
public class ResultTemplateUpdate extends SosModificationEvent<UpdateResultTemplateRequest, UpdateResultTemplateResponse> {

public ResultTemplateUpdate(UpdateResultTemplateRequest request, UpdateResultTemplateResponse response) {
super(request, response);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
package org.n52.sos.ogc.sos;

import com.google.common.base.Strings;
import java.util.Map;

import org.apache.xmlbeans.XmlException;
Expand All @@ -40,7 +41,6 @@
import org.n52.sos.ogc.swe.encoding.SweAbstractEncoding;
import org.n52.sos.util.CodingHelper;
import org.n52.sos.util.SosHelper;
import org.n52.sos.util.StringHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -144,11 +144,11 @@ public int hashCode() {
}

public boolean isEmpty() {
return StringHelper.isNotEmpty(xml);
return Strings.isNullOrEmpty(xml);
}

public boolean isSetXml() {
return StringHelper.isNotEmpty(this.xml);
return !isEmpty();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
package org.n52.sos.ogc.sos;

import com.google.common.base.Strings;
import java.util.Map;

import org.apache.xmlbeans.XmlException;
Expand All @@ -40,7 +41,6 @@
import org.n52.sos.ogc.swe.SweConstants;
import org.n52.sos.util.CodingHelper;
import org.n52.sos.util.SosHelper;
import org.n52.sos.util.StringHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -141,10 +141,10 @@ public int hashCode() {
}

public boolean isEmpty() {
return StringHelper.isNotEmpty(xml);
return Strings.isNullOrEmpty(xml);
}

public boolean isSetXml() {
return StringHelper.isNotEmpty(xml);
return !isEmpty();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
* Copyright (C) 2017 52north.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.n52.sos.request;

import com.google.common.base.Strings;
import org.n52.sos.ogc.ows.OwsExceptionReport;
import org.n52.sos.ogc.sos.SosResultEncoding;
import org.n52.sos.ogc.sos.SosResultStructure;
import org.n52.sos.response.UpdateResultTemplateResponse;

/**
* @author <a href="mailto:[email protected]">Eike Hinderk
* J&uuml;rrens</a>
*
* @since 4.4.0
*/
public class UpdateResultTemplateRequest extends AbstractServiceRequest<UpdateResultTemplateResponse>{

private String resultTemplate;
private SosResultStructure resultStructure;
private SosResultEncoding resultEncoding;

@Override
public UpdateResultTemplateResponse getResponse() throws OwsExceptionReport {
return (UpdateResultTemplateResponse) new UpdateResultTemplateResponse().set(this);
}

@Override
public String getOperationName() {
return "UpdateResultTemplate";
}

public boolean isSetResultTemplate() {
return !Strings.isNullOrEmpty(resultTemplate);
}

public void setResultTemplate(String resultTemplate) {
this.resultTemplate = resultTemplate;
}

public String getResultTemplate() {
if (isSetResultTemplate()) {
return resultTemplate;
} else {
return "";
}
}

public boolean isSetResultEncoding() {
return !resultEncoding.isEmpty();
}

public void setResultEncoding(SosResultEncoding resultEncoding) {
this.resultEncoding = resultEncoding;
}

public SosResultEncoding getResultEncoding() {
if (isSetResultEncoding()) {
return resultEncoding;
} else {
return new SosResultEncoding();
}
}

public boolean isSetResultStructure() {
return !resultStructure.isEmpty();
}

public void setResultStructure(SosResultStructure resultStructure) {
this.resultStructure = resultStructure;
}

public SosResultStructure getResultStructure() {
if (isSetResultStructure()) {
return resultStructure;
} else {
return new SosResultStructure();
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (C) 2017 52north.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.n52.sos.response;

import com.google.common.base.Strings;

/**
* @author <a href="mailto:[email protected]">Eike Hinderk
* J&uuml;rrens</a>
*
* @since 4.4.0
*/
public class UpdateResultTemplateResponse extends AbstractServiceResponse {

private String updatedResultTemplate;

@Override
public String getOperationName() {
return "UpdateResultTemplate";
}

public UpdateResultTemplateResponse setUpdatedResultTemplate(String updatedResultTemplate) {
this.updatedResultTemplate = updatedResultTemplate;
return this;
}

public boolean isSetResultTemplate() {
return !Strings.isNullOrEmpty(updatedResultTemplate);
}

public String getResultTemplate() {
if (isSetResultTemplate()) {
return updatedResultTemplate;
} else {
return "";
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@
*/
package org.n52.sos.cache.ctrl;

import com.google.common.collect.Sets;
import java.util.Collections;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.n52.sos.cache.ContentCacheUpdate;
import org.n52.sos.cache.ctrl.action.FeatureInsertionUpdate;
import org.n52.sos.cache.ctrl.action.ObservationInsertionUpdate;
Expand All @@ -51,8 +48,8 @@
import org.n52.sos.event.events.SensorInsertion;
import org.n52.sos.ogc.ows.OwsExceptionReport;
import org.n52.sos.service.Configurator;

import com.google.common.collect.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @author Christian Autermann <[email protected]>
Expand Down
Binary file added docker/configuration.db
Binary file not shown.
28 changes: 28 additions & 0 deletions docker/datasource.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#Mon May 08 14:30:02 GMT 2017
hibernate.connection.password=postgres
hibernate.c3p0.acquire_increment=1
hibernate.connection.autoReconnect=true
hibernate.c3p0.idle_test_period=30
hibernate.connection.autoReconnectForPools=true
hibernate.c3p0.max_statements=0
hibernate.jdbc.batch_size=20
hibernate.c3p0.timeout=0
hibernate.c3p0.contextClassLoaderSource=library
hibernate.c3p0.privilegeSpawnedThreads=true
hibernate.datasource.timeStringZ=false
hibernate.datasource.timezone=UTC
hibernate.c3p0.min_size=10
hibernate.default_schema=public
PROVIDED_JDBC=false
sos.feature.concept=DEFAULT_FEATURE_CONCEPT
hibernate.connection.username=postgres
hibernate.c3p0.preferredTestQuery=SELECT 1
HIBERNATE_DIRECTORY=/mapping/core;/mapping/parameter/feature;/mapping/series/observation;/mapping/parameter/observation;/mapping/transactional;/mapping/extension/readonly
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.c3p0.max_size=30
org.n52.sos.ds.Datasource=org.n52.sos.ds.datasource.PostgresDatasource
hibernate.connection.provider_class=org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider
hibernate.dialect=org.hibernate.spatial.dialect.postgis.PostgisDialectSpatialIndex
hibernate.connection.url=jdbc\:postgresql\://db\:5432/sos
sos.database.concept=SERIES_CONCEPT
hibernate.connection.testOnBorrow=true
2 changes: 2 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ services:
- "../webapp-bundle/target/52n-sos-webapp.war:/usr/local/tomcat/webapps/52n-sos-webapp.war"
- "../webapp-bundle/target/52n-sos-webapp:/usr/local/tomcat/webapps/52n-sos-webapp"
- "./tomcat-index.html:/usr/local/tomcat/webapps/ROOT/index.html"
- "./configuration.db:/usr/local/tomcat/webapps/52n-sos-webapp/configuration.db"
- "./datasource.properties:/usr/local/tomcat/webapps/52n-sos-webapp/WEB-INF/datasource.properties"
depends_on:
- db
environment:
Expand Down
1 change: 1 addition & 0 deletions extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
<module>inspire</module>
<module>related-offering</module>
<module>ifoi</module>
<module>urt</module>
</modules>
</project>
47 changes: 47 additions & 0 deletions extensions/urt/coding/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.n52.sensorweb.sos</groupId>
<version>4.4.0-SNAPSHOT</version>
<artifactId>urt</artifactId>
</parent>
<artifactId>urt-coding</artifactId>
<name>52°North Svalbard - Extension UpdateResultTemplate coding</name>
<description>52°North Svalbard UpdateResultTemplate coding module</description>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>urt-operation</artifactId>
</dependency>
<dependency>
<groupId>org.n52.sensorweb</groupId>
<artifactId>52n-xml-urt-v100</artifactId>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api</artifactId>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
</dependencies>
</project>
Loading