Skip to content

Commit

Permalink
Merge pull request #888 from CarstenHollmann/refactor/full-integrate-…
Browse files Browse the repository at this point in the history
…helgoland-api

Refactor for full integrate helgoland api
  • Loading branch information
CarstenHollmann authored Aug 13, 2020
2 parents 334879b + df58258 commit 6c393ce
Show file tree
Hide file tree
Showing 11 changed files with 203 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<bean class="org.n52.faroe.settings.UriSettingDefinition">
<property name="key" value="service.serviceURL" />
<property name="title" value="SOS URL" />
<property name="description" value="The endpoint URL of this sos which will be shown in the GetCapabilities response (e.g. &lt;code&gt;http://localhost:8080/52nSOS/sos&lt;/code&gt; or &lt;code&gt;http://localhost:8080/52nSOS/service&lt;/code&gt;). The path to a specific binding (like &lt;code&gt;/soap&lt;/code&gt;) will appended to this URL. For detailed information, please read the &lt;a href=&quot;https://wiki.52north.org/bin/view/SensorWeb/SensorObservationServiceIVDocumentation&quot;&gt;documentation&lt;/a&gt;" />
<property name="description" value="The endpoint URL of this sos which will be shown in the GetCapabilities response (e.g. &lt;code&gt;http://localhost:8080/52nSOS/service&lt;/code&gt;). For detailed information, please read the &lt;a href=&quot;https://wiki.52north.org/bin/view/SensorWeb/SensorObservationServiceVDocumentation&quot;&gt;documentation&lt;/a&gt;" />
<property name="order" value="0.0" />
<property name="group" ref="serviceSettingDefintionGroup" />
<property name="defaultValue" value="http://localhost:8080/52n-sos-webapp/service" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@
public class HibernateDataSourceHarvesterJob extends ScheduledJob implements Job {

@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
public void executeInternal(JobExecutionContext context) throws JobExecutionException {
// TODO Auto-generated method stub

}

@Override
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@
<!-- 52N dependency versions -->
<version.n52.common.xml>2.7.0</version.n52.common.xml>
<version.arctic-sea>8.0.0</version.arctic-sea>
<version.helgoland.api>3.3.0</version.helgoland.api>
<version.dao-impl>3.3.0</version.dao-impl>
<version.db-model>3.0.0</version.db-model>
<version.helgoland.api>3.4.0</version.helgoland.api>
<version.dao-impl>3.4.0</version.dao-impl>
<version.db-model>3.0.1</version.db-model>
<!-- <dataset.proxy.version>1.0.0-SNAPSHOT</dataset.proxy.version> -->
<version.springframework.security>5.3.4.RELEASE</version.springframework.security>
<version.springframework>5.2.8.RELEASE</version.springframework>
Expand Down
9 changes: 6 additions & 3 deletions webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@
<groupId>org.n52.sensorweb-server.dao-impl</groupId>
<artifactId>dao-impl-webapp</artifactId>
<includes>
<include>WEB-INF/spring/*</include>
<include>WEB-INF/classes/**</include>
<!--
<include>WEB-INF/classes/*.json</include>
Expand All @@ -174,8 +173,12 @@
-->
</includes>
<excludes>
<exclude>WEB-INF/spring/series-database-config.xml</exclude>
<exclude>WEB-INF/classes/*.xml</exclude>
<exclude>WEB-INF/classes/application.properties</exclude>
<exclude>WEB-INF/**/series-database-config.xml</exclude>
<exclude>WEB-INF/**/services-beans.xml</exclude>
<exclude>WEB-INF/**/series-hibernate.cfg.xml</exclude>
<exclude>WEB-INF/**/dispatcher.xml</exclude>
<exclude>WEB-INF/**/spi-impl-dao_tasks.xm</exclude>
</excludes>
</overlay>
</overlays>
Expand Down
12 changes: 12 additions & 0 deletions webapp/src/main/resources/contexts/configured/service-beans.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ctx="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">

<bean id="serviceEntityFactory" class="org.n52.series.db.ServiceEntityFactory" />
</beans>
31 changes: 31 additions & 0 deletions webapp/src/main/resources/contexts/configured/tasks.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ctx="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">

<ctx:annotation-config />

<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="jobFactory">
<bean class="org.n52.io.task.AutowiringSpringBeanJobFactory" />
</property>
</bean>
<bean id="jobScheduler" class="org.n52.io.task.JobScheduler" init-method="init" destroy-method="shutdown">
<property name="scheduler" ref="scheduler" />
<property name="scheduledJobs">
<list>
<ref bean="preRenderingJob" />
</list>
</property>
</bean>
<bean id="preRenderingJobConfig" class="org.n52.io.task.PreRenderingJobConfig" />
<bean id="preRenderingJob" class="org.n52.io.task.PreRenderingJob">
<property name="jobName" value="Prerendering Job" />
<property name="jobDescription" value="Job prerendering charts." />
</bean>
</beans>
114 changes: 114 additions & 0 deletions webapp/src/main/resources/contexts/settings/helgoland-api.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">

<bean id="helgolandApiSettingDefinitionGroup" class="org.n52.faroe.SettingDefinitionGroup">
<property name="title" value="Helgoland-API" />
<property name="order" value="10.0" />
<property name="description" value="Some Settings for the HelgolandAPI" />
</bean>
<bean class="org.n52.faroe.settings.UriSettingDefinition">
<property name="key" value="helgoland.externa.url" />
<property name="title" value="External HelgolandAPI URL" />
<property name="description" value="The endpoint URL of this HelgolandAPI." />
<property name="order" value="0.0" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="defaultValue" value="http://localhost:8080/52n-sos-webapp" />
</bean>
<!-- Service -->
<bean class="org.n52.faroe.settings.IntegerSettingDefinition">
<property name="key" value="helgoland.service.id" />
<property name="title" value="Id of the service in the HelgolandAPI" />
<property name="description" value="The ID of the service entity provided by the HelgolandAPI." />
<property name="order" value="1.0" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="defaultValue" value="1" />
</bean>
<bean class="org.n52.faroe.settings.StringSettingDefinition">
<property name="key" value="helgoland.service.name" />
<property name="title" value="Name of the service" />
<property name="description" value="The name of the service" />
<property name="order" value="1.1" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="defaultValue" value="My RESTful Dataset Service" />
</bean>
<bean class="org.n52.faroe.settings.StringSettingDefinition">
<property name="key" value="helgoland.service.version" />
<property name="title" value="Service version" />
<property name="description" value="The version of this service" />
<property name="order" value="1.2" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="defaultValue" value="3.0" />
</bean>
<bean class="org.n52.faroe.settings.StringSettingDefinition">
<property name="key" value="helgoland.service.nodatavalues" />
<property name="title" value="No data values" />
<property name="description" value="Definition of the no data values. Multiple values are possible separated by comma!" />
<property name="order" value="1.3" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="optional" value="true" />
<property name="defaultValue" value="-9999.0,99999,NO_DATA" />
</bean>
<!-- Request interval restriction -->
<bean class="org.n52.faroe.settings.StringSettingDefinition">
<property name="key" value="helgoland.request.interval.restriction" />
<property name="title" value="Request interval restriction" />
<property name="description" value="Definition of the request interval restriction. Defined in ISO-8601 duration (&lt;code&gt;https://en.wikipedia.org/wiki/ISO_8601#Durations&lt;/code&gt;) notation!" />
<property name="order" value="2.0" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="optional" value="true" />
<property name="defaultValue" value="P370D" />
</bean>
<!-- Scheduler -->
<bean class="org.n52.faroe.settings.BooleanSettingDefinition">
<property name="key" value="helgoland.job.scheduler.enable" />
<property name="title" value="En-/disable the job scheduler" />
<property name="description" value="Enable or disable the job scheduler which executes tasks" />
<property name="order" value="3.0" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="defaultValue" value="false" />
</bean>
<bean class="org.n52.faroe.settings.IntegerSettingDefinition">
<property name="key" value="helgoland.job.scheduler.startup.delay" />
<property name="title" value="StartUp delay in seconds" />
<property name="description" value="Define the startup delay for the job scheduler in seconds" />
<property name="order" value="3.1" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="defaultValue" value="5" />
</bean>
<!-- Prerendering job -->
<bean class="org.n52.faroe.settings.BooleanSettingDefinition">
<property name="key" value="helgoland.job.prerendering.enable" />
<property name="title" value="En-/disable the pre-rendering job" />
<property name="description" value="Enable or disable the pre-rendering job" />
<property name="order" value="4.0" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="defaultValue" value="true" />
</bean>
<bean class="org.n52.faroe.settings.StringSettingDefinition">
<property name="key" value="helgoland.job.prerendering.config.file" />
<property name="title" value="Pre-rendering config file" />
<property name="description" value="Define the configuration file name for the pre-rendering job. Start with '/' to place config under 'WEB-INF/classes' folder" />
<property name="order" value="4.1" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="defaultValue" value="/config-task-prerendering.json" />
</bean>
<bean class="org.n52.faroe.settings.BooleanSettingDefinition">
<property name="key" value="helgoland.job.prerendering.trigger.startup" />
<property name="title" value="Trigger the execution on startup" />
<property name="description" value="Define if the job should be executed on startup." />
<property name="order" value="4.2" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="defaultValue" value="true" />
</bean>
<bean class="org.n52.faroe.settings.StringSettingDefinition">
<property name="key" value="helgoland.job.prerendering.cron.expression" />
<property name="title" value="Cron expression for execution" />
<property name="description" value="Definition the cron expression for the execution of the prerendering job. See &lt;code&gt;http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/tutorial-lesson-06.html&lt;/code&gt;" />
<property name="order" value="4.3" />
<property name="group" ref="helgolandApiSettingDefinitionGroup" />
<property name="defaultValue" value="0 0 03 * * ?" />
</bean>
</beans>
1 change: 1 addition & 0 deletions webapp/src/main/webapp/WEB-INF/application-context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<sec:http pattern="/static/**" security="none" />
<sec:http pattern="/install/**" security="none" />
<sec:http pattern="/service" security="none" />
<sec:http pattern="/api" security="none" />

<sec:http auto-config="true" use-expressions="true" disable-url-rewriting="true">
<sec:csrf disabled="true" />
Expand Down
37 changes: 34 additions & 3 deletions webapp/src/main/webapp/WEB-INF/dispatcher-servlet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,40 @@
</property>

</bean>
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"></property>
<property name="suffix" value=".jsp"></property>

<bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
<property name="mediaTypes">
<value>
json=application/json*
</value>
</property>
</bean>

<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="viewResolvers">
<list>
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
</list>
</property>
<property name="defaultViews">
<list>
<bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">
<property name="extractValueFromSingleKeyModel" value="true" />
<property name="disableCaching" value="false" />
<property name="objectMapper">
<bean class="com.fasterxml.jackson.databind.ObjectMapper">
<property name="serializationInclusion">
<!-- do not serialize NULL values -->
<value type="com.fasterxml.jackson.annotation.JsonInclude.Include">NON_NULL</value>
</property>
</bean>
</property>
</bean>
</list>
</property>
</bean>
</beans>
28 changes: 0 additions & 28 deletions webapp/src/main/webapp/WEB-INF/spring/series-database-config.xml

This file was deleted.

13 changes: 0 additions & 13 deletions webapp/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,8 @@
<servlet-class>org.n52.sos.SOSDispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>rest-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>-1</load-on-startup>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/application-context.xml,/WEB-INF/spring/dispatcher-servlet.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rest-dispatcher</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</web-app>

0 comments on commit 6c393ce

Please sign in to comment.