-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Web service module and configuration moved over to restructure (#22)
Web service module and the configurations for the xml and json rest api moved over from the module.
- Loading branch information
littlefieldnick
committed
Jul 9, 2019
1 parent
a50eee7
commit 448d5a1
Showing
78 changed files
with
3,977 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<pageflow:Pageflow xmlns:pageflow="http://www.sybase.com/suade/pageflow" id="pf15617555294340" configfile="/openhds/src/main/webapp/WEB-INF/faces-config.xml"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beansProjectDescription> | ||
<version>1</version> | ||
<pluginVersion><![CDATA[3.9.2.201712210913-RELEASE]]></pluginVersion> | ||
<configSuffixes> | ||
<configSuffix><![CDATA[xml]]></configSuffix> | ||
</configSuffixes> | ||
<enableImports><![CDATA[false]]></enableImports> | ||
<configs> | ||
</configs> | ||
<autoconfigs> | ||
<config>src/main/webapp/WEB-INF/reporter-servlet.xml</config> | ||
<config>src/main/webapp/WEB-INF/autocomplete-servlet.xml</config> | ||
<config>java:org.openhds.OpenhdsServerApplication</config> | ||
</autoconfigs> | ||
<configSets> | ||
</configSets> | ||
</beansProjectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,4 +233,4 @@ | |
</plugins> | ||
</build> | ||
|
||
</project> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...va/org/openhds/config/DatabaseConfig.java → ...penhds/config/modules/DatabaseConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.openhds.config; | ||
package org.openhds.config.modules; | ||
|
||
|
||
import org.openhds.service.JsfService; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../java/org/openhds/config/IdGenConfig.java → ...g/openhds/config/modules/IdGenConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.openhds.config; | ||
package org.openhds.config.modules; | ||
|
||
import java.util.HashMap; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...g/openhds/config/LocationLevelConfig.java → ...s/config/modules/LocationLevelConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.openhds.config.modules; | ||
|
||
public class SecurityConfig { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../openhds/config/SitePropertiesConfig.java → .../config/modules/SitePropertiesConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/java/org/openhds/config/TaskConfig.java → ...rg/openhds/config/modules/TaskConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.openhds.config; | ||
package org.openhds.config.modules; | ||
|
||
import java.util.concurrent.Executor; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
src/main/java/org/openhds/config/webapp/JsonWebServiceInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package org.openhds.config.webapp; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||
import org.springframework.boot.web.servlet.ServletRegistrationBean; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | ||
import org.springframework.http.converter.xml.MarshallingHttpMessageConverter; | ||
import org.springframework.orm.hibernate5.support.OpenSessionInViewFilter; | ||
import org.springframework.oxm.jaxb.Jaxb2Marshaller; | ||
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; | ||
import org.springframework.web.servlet.DispatcherServlet; | ||
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer; | ||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; | ||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter; | ||
|
||
public class JsonWebServiceInitializer extends WebMvcConfigurationSupport{ | ||
|
||
@Autowired | ||
private ApplicationContext context; | ||
|
||
@Bean | ||
public ServletRegistrationBean<DispatcherServlet> jsonRestApi() { | ||
AnnotationConfigWebApplicationContext contextApi = new AnnotationConfigWebApplicationContext(); | ||
contextApi.scan("org.openhds.webservice.resources.json"); | ||
contextApi.setParent(context); | ||
|
||
DispatcherServlet dispatcherServlet = new DispatcherServlet(); | ||
dispatcherServlet.setApplicationContext(contextApi); | ||
|
||
ServletRegistrationBean<DispatcherServlet> servletRegistrationBean = | ||
new ServletRegistrationBean<DispatcherServlet>(dispatcherServlet, "/api2/rest/*"); | ||
servletRegistrationBean.setName("webServices2"); | ||
return servletRegistrationBean; | ||
} | ||
|
||
@Bean | ||
FilterRegistrationBean transactionFilterRegistration() { | ||
FilterRegistrationBean reg = new FilterRegistrationBean(); | ||
reg.setFilter(new OpenSessionInViewFilter()); | ||
reg.addUrlPatterns("/api2/rest/*"); | ||
return reg; | ||
} | ||
|
||
@Bean | ||
public RequestMappingHandlerAdapter requestMappingHandlerAdapter() { | ||
RequestMappingHandlerAdapter adapter = super.requestMappingHandlerAdapter(); | ||
adapter.getMessageConverters().add(marshallingHttpMessageConverter()); | ||
adapter.getMessageConverters().add(mappingJackson2HttpMessageConverter()); | ||
return adapter; | ||
} | ||
|
||
@Bean | ||
public MarshallingHttpMessageConverter marshallingHttpMessageConverter() { | ||
MarshallingHttpMessageConverter converter = new MarshallingHttpMessageConverter();; | ||
converter.setMarshaller(new Jaxb2Marshaller()); | ||
converter.setUnmarshaller(new Jaxb2Marshaller()); | ||
|
||
return converter; | ||
} | ||
|
||
@Bean | ||
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() { | ||
return new MappingJackson2HttpMessageConverter(); | ||
} | ||
|
||
@Override | ||
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { | ||
configurer.favorPathExtension(false).favorParameter(true).parameterName("mediaType") | ||
.ignoreAcceptHeader(true).useRegisteredExtensionsOnly(false) | ||
.defaultContentType(MediaType.APPLICATION_JSON) | ||
.mediaType("xml", MediaType.APPLICATION_XML) | ||
.mediaType("json", MediaType.APPLICATION_JSON); | ||
} | ||
|
||
|
||
@Override | ||
public void addResourceHandlers(final ResourceHandlerRegistry registry) { | ||
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/"); | ||
} | ||
|
||
private List<MediaType> getSupportedMediaTypes() { | ||
final List<MediaType> list = new ArrayList<MediaType>(); | ||
list.add(MediaType.APPLICATION_JSON); | ||
list.add(MediaType.APPLICATION_XML); | ||
|
||
return list; | ||
} | ||
|
||
|
||
|
||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/org/openhds/config/webapp/XmlWebServiceInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.openhds.config.webapp; | ||
|
||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||
import org.springframework.boot.web.servlet.ServletRegistrationBean; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.orm.hibernate5.support.OpenSessionInViewFilter; | ||
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; | ||
import org.springframework.web.servlet.DispatcherServlet; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; | ||
|
||
@Configuration | ||
public class XmlWebServiceInitializer extends WebMvcConfigurationSupport{ | ||
|
||
@Autowired | ||
private ApplicationContext context; | ||
|
||
@Bean | ||
public ServletRegistrationBean<DispatcherServlet> xmlRestApi() { | ||
AnnotationConfigWebApplicationContext contextApi = new AnnotationConfigWebApplicationContext(); | ||
contextApi.scan("org.openhds.webservice.resources.xml"); | ||
contextApi.setParent(context); | ||
|
||
DispatcherServlet dispatcherServlet = new DispatcherServlet(); | ||
dispatcherServlet.setApplicationContext(contextApi); | ||
|
||
ServletRegistrationBean<DispatcherServlet> servletRegistrationBean = | ||
new ServletRegistrationBean<DispatcherServlet>(dispatcherServlet, "/api/rest/*"); | ||
servletRegistrationBean.setName("webServices"); | ||
return servletRegistrationBean; | ||
} | ||
|
||
@Bean | ||
FilterRegistrationBean transactionFilterRegistration() { | ||
FilterRegistrationBean reg = new FilterRegistrationBean(); | ||
reg.setFilter(new OpenSessionInViewFilter()); | ||
reg.addUrlPatterns("/api/rest/*"); | ||
return reg; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...hds/domain/wrapper/CensusIndividuals.java → ...ds/domain/wrappers/CensusIndividuals.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.openhds.domain.wrapper; | ||
package org.openhds.domain.wrappers; | ||
|
||
import java.util.List; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
.../openhds/domain/wrapper/FieldWorkers.java → ...openhds/domain/wrappers/FieldWorkers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.openhds.domain.wrapper; | ||
package org.openhds.domain.wrappers; | ||
|
||
import java.util.List; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...ava/org/openhds/domain/wrapper/Forms.java → ...va/org/openhds/domain/wrappers/Forms.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.openhds.domain.wrapper; | ||
package org.openhds.domain.wrappers; | ||
|
||
import java.util.List; | ||
|
||
|
Oops, something went wrong.