Skip to content

Commit 3a743c4

Browse files
committed
Added client, so it gets served by server as well
1 parent 8c06885 commit 3a743c4

324 files changed

Lines changed: 340091 additions & 17 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

EDI-T/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
1313
</attributes>
1414
</classpathentry>
15-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/Java SE 7 [1.7.0_51]"/>
15+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/Java SE 7 [1.7.0_17]"/>
1616
<classpathentry kind="output" path="target/classes"/>
1717
</classpath>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
eclipse.preferences.version=1
2+
org.springframework.ide.eclipse.core.builders.enable.aopreferencemodelbuilder=true
3+
org.springframework.ide.eclipse.core.builders.enable.beanmetadatabuilder=true
4+
org.springframework.ide.eclipse.core.enable.project.preferences=false
5+
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.beans.core.beansvalidator=true
6+
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.bestpractices.beansvalidator=false
7+
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.boot.bootvalidator=true
8+
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.core.springvalidator=false
9+
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.data.core.datavalidator=true
10+
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.webflow.core.validator=true
11+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.autowire.autowire-org.springframework.ide.eclipse.beans.core.beansvalidator=false
12+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanAlias-org.springframework.ide.eclipse.beans.core.beansvalidator=true
13+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanClass-org.springframework.ide.eclipse.beans.core.beansvalidator=true
14+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanConstructorArgument-org.springframework.ide.eclipse.beans.core.beansvalidator=true
15+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinition-org.springframework.ide.eclipse.beans.core.beansvalidator=true
16+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinitionHolder-org.springframework.ide.eclipse.beans.core.beansvalidator=true
17+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanFactory-org.springframework.ide.eclipse.beans.core.beansvalidator=true
18+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanInitDestroyMethod-org.springframework.ide.eclipse.beans.core.beansvalidator=true
19+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=true
20+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanReference-org.springframework.ide.eclipse.beans.core.beansvalidator=true
21+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.methodOverride-org.springframework.ide.eclipse.beans.core.beansvalidator=true
22+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.parsingProblems-org.springframework.ide.eclipse.beans.core.beansvalidator=true
23+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.requiredProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=false
24+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.toolAnnotation-org.springframework.ide.eclipse.beans.core.beansvalidator=false
25+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.bestpractices.com.springsource.sts.bestpractices.AvoidDriverManagerDataSource-org.springframework.ide.eclipse.bestpractices.beansvalidator=false
26+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.bestpractices.com.springsource.sts.bestpractices.ImportElementsAtTopRulee-org.springframework.ide.eclipse.bestpractices.beansvalidator=false
27+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.bestpractices.com.springsource.sts.bestpractices.ParentBeanSpecifiesAbstractClassRule-org.springframework.ide.eclipse.bestpractices.beansvalidator=false
28+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.bestpractices.com.springsource.sts.bestpractices.RefElementRule-org.springframework.ide.eclipse.bestpractices.beansvalidator=false
29+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.bestpractices.com.springsource.sts.bestpractices.TooManyBeansInFileRule-org.springframework.ide.eclipse.bestpractices.beansvalidator=false
30+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.bestpractices.com.springsource.sts.bestpractices.UnnecessaryValueElementRule-org.springframework.ide.eclipse.bestpractices.beansvalidator=false
31+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.bestpractices.com.springsource.sts.bestpractices.UseBeanInheritance-org.springframework.ide.eclipse.bestpractices.beansvalidator=false
32+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.bestpractices.legacyxmlusage.jndiobjectfactory-org.springframework.ide.eclipse.bestpractices.beansvalidator=false
33+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.boot.missingConfigurationProcessor-org.springframework.ide.eclipse.boot.bootvalidator=true
34+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.core.springClasspath-org.springframework.ide.eclipse.core.springvalidator=false
35+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.data.core.invalidDerivedQuery-org.springframework.ide.eclipse.data.core.datavalidator=true
36+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.data.core.invalidParameterType-org.springframework.ide.eclipse.data.core.datavalidator=true
37+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.action-org.springframework.ide.eclipse.webflow.core.validator=true
38+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.actionstate-org.springframework.ide.eclipse.webflow.core.validator=true
39+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.attribute-org.springframework.ide.eclipse.webflow.core.validator=true
40+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.attributemapper-org.springframework.ide.eclipse.webflow.core.validator=true
41+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.beanaction-org.springframework.ide.eclipse.webflow.core.validator=true
42+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.evaluationaction-org.springframework.ide.eclipse.webflow.core.validator=true
43+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.evaluationresult-org.springframework.ide.eclipse.webflow.core.validator=true
44+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.exceptionhandler-org.springframework.ide.eclipse.webflow.core.validator=true
45+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.import-org.springframework.ide.eclipse.webflow.core.validator=true
46+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.inputattribute-org.springframework.ide.eclipse.webflow.core.validator=true
47+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.mapping-org.springframework.ide.eclipse.webflow.core.validator=true
48+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.outputattribute-org.springframework.ide.eclipse.webflow.core.validator=true
49+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.set-org.springframework.ide.eclipse.webflow.core.validator=true
50+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.state-org.springframework.ide.eclipse.webflow.core.validator=true
51+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.subflowstate-org.springframework.ide.eclipse.webflow.core.validator=true
52+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.transition-org.springframework.ide.eclipse.webflow.core.validator=true
53+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.variable-org.springframework.ide.eclipse.webflow.core.validator=true
54+
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.webflowstate-org.springframework.ide.eclipse.webflow.core.validator=true

EDI-T/WebContent/WEB-INF/web.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
33
<display-name>EDI Server Light</display-name>
44

5-
<!--
65
<servlet>
76
<display-name>EDI Rest Servlet</display-name>
87
<servlet-name>RestServlet</servlet-name>
@@ -17,5 +16,4 @@
1716
<servlet-name>RestServlet</servlet-name>
1817
<url-pattern>/*</url-pattern>
1918
</servlet-mapping>
20-
-->
2119
</web-app>

EDI-T/edi.war

62.4 MB
Binary file not shown.
Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
11
package it.cnr.irea.ediT;
22

3+
import org.springframework.context.annotation.ComponentScan;
34
import org.springframework.context.annotation.Configuration;
5+
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
46
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
7+
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
8+
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
9+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
510

611
@Configuration
712
@EnableWebMvc
8-
public class WebConfig {
9-
13+
@ComponentScan
14+
public class WebConfig extends WebMvcConfigurerAdapter {
15+
private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
16+
"classpath:/META-INF/resources/", "classpath:/resources/",
17+
"classpath:/static/", "classpath:/public/", "classpath:/" };
18+
@Override
19+
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
20+
configurer.enable();
21+
}
22+
/*
23+
@Override
24+
public void addResourceHandlers(ResourceHandlerRegistry registry) {
25+
if (!registry.hasMappingForPattern("/**")) {
26+
registry.addResourceHandler("/**").addResourceLocations(
27+
CLASSPATH_RESOURCE_LOCATIONS);
28+
}
29+
}
30+
*/
31+
@Override
32+
public void addResourceHandlers(ResourceHandlerRegistry registry) {
33+
// registry.addResourceHandler("/").addResourceLocations("classpath:/static/index.html");
34+
registry.addResourceHandler("/*").addResourceLocations("classpath:/static/");
35+
}
36+
/*
37+
@Override
38+
public void addViewControllers(ViewControllerRegistry registry) {
39+
registry.addViewController("/").setViewName("forward:/index.html");
40+
}
41+
*/
1042
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package it.cnr.irea.ediT.rest;
2+
3+
import java.io.IOException;
4+
5+
import javax.servlet.http.HttpServletResponse;
6+
7+
import org.springframework.stereotype.Controller;
8+
import org.springframework.web.bind.annotation.RequestMapping;
9+
import org.springframework.web.bind.annotation.RequestMethod;
10+
11+
@Controller
12+
public class HTMLController {
13+
@RequestMapping(value="/", method = RequestMethod.GET)
14+
public void helloWorld(HttpServletResponse httpServletResponse) {
15+
// System.out.println("IS IN");
16+
// httpServletResponse.setHeader("Location", "/index.html");
17+
try {
18+
httpServletResponse.sendRedirect("/index.html");
19+
} catch (IOException e) {
20+
// TODO Auto-generated catch block
21+
e.printStackTrace();
22+
}
23+
// return "index.html";
24+
}
25+
}

EDI-T/src/it/cnr/irea/ediT/rest/RestBase.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import org.xml.sax.SAXException;
5959

6060
@RestController
61+
@RequestMapping("rest")
6162
public class RestBase extends CORSDecorator {
6263
static String personURI = "http://somewhere/JohnSmith";
6364
static String fullName = "John Smith";
@@ -86,7 +87,7 @@ public void postConstruct() {
8687
return ErrorResponse.HOST_NOT_CONFIGURED;
8788
}
8889

89-
@RequestMapping(method = RequestMethod.GET, value = "rest/ediml/requestId", produces = MediaType.APPLICATION_JSON_VALUE)
90+
@RequestMapping(method = RequestMethod.GET, value = "ediml/requestId", produces = MediaType.APPLICATION_JSON_VALUE)
9091
@ResponseBody
9192
public Metadata getNewId(HttpServletRequest request, @RequestHeader("Host") String host) throws HostNotConfiguredException {
9293
if ( service.getHostName() == null ) {
@@ -99,7 +100,7 @@ public Metadata getNewId(HttpServletRequest request, @RequestHeader("Host") Stri
99100
return md;
100101
}
101102

102-
@RequestMapping(method = RequestMethod.POST, value = "rest/metadata", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_XML_VALUE)
103+
@RequestMapping(method = RequestMethod.POST, value = "metadata", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_XML_VALUE)
103104
@ResponseBody
104105
public ResponseEntity<PostMetadataResponse> postMetadataNG(HttpServletRequest req, @RequestHeader(value = "X-Forwarded-For", required = false) String ip, @RequestBody String xml, @RequestHeader(value = "api_key", required = false) String apiKey) {
105106
log.info("xml: " + xml);
@@ -205,14 +206,14 @@ public ResponseEntity<PostMetadataResponse> postMetadataNG(HttpServletRequest re
205206
return new ResponseEntity<PostMetadataResponse>(response, HttpStatus.INTERNAL_SERVER_ERROR);
206207
}
207208

208-
@RequestMapping(method = RequestMethod.OPTIONS, value = "rest/metadata", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_XML_VALUE)
209+
@RequestMapping(method = RequestMethod.OPTIONS, value = "metadata", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_XML_VALUE)
209210
@ResponseBody
210211
public ResponseEntity<PostMetadataResponse> optionsPostMetadata(String xml) {
211212
return new ResponseEntity<PostMetadataResponse>(HttpStatus.OK);
212213
}
213214

214215

215-
@RequestMapping(method = RequestMethod.GET, value = "/rest/xml/{id}.{suffix}", produces = MediaType.APPLICATION_XML_VALUE)
216+
@RequestMapping(method = RequestMethod.GET, value = "/xml/{id}.{suffix}", produces = MediaType.APPLICATION_XML_VALUE)
216217
@ResponseBody
217218
public HttpEntity<byte[]> getXml(@PathVariable int id, @PathVariable String suffix) {
218219
log.info("getXml " + id + ", " + suffix);
@@ -227,7 +228,7 @@ public HttpEntity<byte[]> getXml(@PathVariable int id, @PathVariable String suff
227228
return new HttpEntity<byte[]>(md.getOutput().getBytes(), header);
228229
}
229230

230-
@RequestMapping(method = RequestMethod.GET, value = "/rest/edimlFile/{id}.{suffix}", produces = MediaType.APPLICATION_XML_VALUE)
231+
@RequestMapping(method = RequestMethod.GET, value = "/edimlFile/{id}.{suffix}", produces = MediaType.APPLICATION_XML_VALUE)
231232
@ResponseBody
232233
public HttpEntity<byte[]> getEdimlFile(@PathVariable int id, @PathVariable String suffix) {
233234
log.info("getEdimlFile " + id + ", " + suffix);
@@ -248,15 +249,15 @@ public HttpEntity<byte[]> getEdimlFile(@PathVariable int id, @PathVariable Strin
248249
return new HttpEntity<byte[]>(doc.toString().getBytes(), header);
249250
}
250251

251-
@RequestMapping(method = RequestMethod.GET, value = "/rest/ediml/{id}", produces = MediaType.APPLICATION_XML_VALUE)
252+
@RequestMapping(method = RequestMethod.GET, value = "/ediml/{id}", produces = MediaType.APPLICATION_XML_VALUE)
252253
@ResponseBody
253254
public String getEDIMLXml(@PathVariable int id) {
254255
log.info("getEDIMLXml " + id);
255256
Metadata md = service.getMetadata(id);
256257
return md.getInput();
257258
}
258259

259-
@RequestMapping(method = RequestMethod.GET, value = "/rest/ediml/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
260+
@RequestMapping(method = RequestMethod.GET, value = "/ediml/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
260261
@ResponseBody
261262
public TemplateElementList getEDIML(@PathVariable int id) {
262263
log.info("getEDIML " + id);
@@ -310,19 +311,19 @@ public TemplateElementList getEDIML(@PathVariable int id) {
310311
return elementList;
311312
}
312313

313-
@RequestMapping(method = RequestMethod.GET, value = "rest/metadata/sync", produces = MediaType.APPLICATION_JSON_VALUE)
314+
@RequestMapping(method = RequestMethod.GET, value = "metadata/sync", produces = MediaType.APPLICATION_JSON_VALUE)
314315
public ServiceResponse syncMetadata() {
315316
return service.syncMetadata();
316317
}
317318

318-
@RequestMapping(method = RequestMethod.GET, value = "rest/test", produces = MediaType.APPLICATION_JSON_VALUE)
319+
@RequestMapping(method = RequestMethod.GET, value = "test", produces = MediaType.APPLICATION_JSON_VALUE)
319320
public String test(HttpServletRequest request) {
320321
String restOfTheUrl = (String) request.getAttribute(
321322
HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
322323
return "{\"url\": \"" + request.getRequestURL().toString() + "\", \"forwarded\":\"" + request.getHeader("X-Forwarded-Host") + "\"}";
323324
}
324325

325-
@RequestMapping(method = RequestMethod.GET, value = "rest/whoami", produces = MediaType.APPLICATION_JSON_VALUE)
326+
@RequestMapping(method = RequestMethod.GET, value = "whoami", produces = MediaType.APPLICATION_JSON_VALUE)
326327
public String getWhoAmIFromGeoSK() throws IOException {
327328
String result = "";
328329

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Datatypes available for EDI Templates
2+
## code (alias: codelist)
3+
Item value comes from a SPARQL codelist shown as a combo box (HTML *select* element):
4+
returned fields MUST be:
5+
* ?c (uri),
6+
* ?urn (optional urn),
7+
* ?l (in-language label),
8+
* ?a (alternative language label)
9+
* ?z (language-neutral label)
10+
11+
## select
12+
Item value depends on field from shared datasource.
13+
Whenever datasource is refreshed, item will be updated with the corresponding field value.
14+
Value can be manually overridden, but subsequent refresh on the datasource will always win.
15+
## copy
16+
Item takes value from another item whenever the latter is updated.
17+
Value can be manually overridden, but subsequent change on the main item will always win.
18+
## string
19+
Item is a string
20+
## URN
21+
Item is a URM
22+
## URI
23+
Item is a URI
24+
## URL
25+
Item is a URL (reachability of URL is not tested yet)
26+
## int
27+
Item is an integer
28+
## real (alias: double)
29+
Item is a real number
30+
## text
31+
Item is a long text
32+
## dependent
33+
34+
## ref
35+
Item is a reference to another item.
36+
ref fields are not shown and they get expanded when EDIML gets compiled into XML
37+
## autonumber
38+
Item is an automatically generated integer
39+
## hidden
40+
Item is hidden
41+
## date
42+
Item is a date
43+
## dateRange
44+
Item is a date range using two date pickers as input controls
45+
## boundingBox
46+
Item is a bounding box, i.e. 4 textboxes representing N, S, E and W.
47+
A map is also shown to allow displaying and setting the coordinates on map.

0 commit comments

Comments
 (0)