Skip to content

Commit

Permalink
Merge pull request #1 from trygu/develop
Browse files Browse the repository at this point in the history
Updated java-vtl-tools to support VTL Pogues Connector
  • Loading branch information
trygu authored May 24, 2019
2 parents d4fd14f + d6178ea commit 7aa4ddc
Show file tree
Hide file tree
Showing 6 changed files with 2,739 additions and 27 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM openjdk:8-jre-alpine

ADD target/java-vtl-tools-*SNAPSHOT.jar java-vtl-tools.jar
RUN mkdir -p /src/main/resources
ADD ./src/main/resources/simpsons.xml /src/main/resources
RUN sh -c 'touch /java-vtl-tools.jar'
EXPOSE 8080
ENTRYPOINT ["java", "-Xmx300m", "-Djava.security.egd=file:/dev/./urandom","-jar","/java-vtl-tools.jar"]
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# java-vtl-tools
A collection of tools for Java VTL.

## Testing the VTL-Pogues-Connector

* Make sure the simpson.xml (in the resource directory) is available for the connector.

## Build and run as docker image
Run "mvn clean install" to build the application itself.

Build Docker image: docker build -t java-vtl-tools:{{tag}}
Build Docker image: docker build . -t i3sessnet/java-vtl-tools:latest

Run the application: docker run -p 8080:8080 i3sessnet/java-vtl-tools:latest

## Access the demo-application:

Run the application: docker run java-vtl-tools:{{tag}}
After starting the application/container it can be accessed from [http://localhost:8080/demo/index.html#](http://localhost:8080/demo/index.html#)
28 changes: 7 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,14 @@
<url>https://github.com/statisticsnorway/java-vtl-tools</url>
</scm>

<profiles>

<profile>
<!-- internal distribution for ssb -->
<id>ssb</id>
<distributionManagement>
<repository>
<id>releases</id>
<name>SSB Nexus Releases</name>
<url>https://nexus.ssb.no/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>SSB Snapshot Repository</name>
<url>https://nexus.ssb.no/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</profile>

</profiles>

<dependencies>

<dependency>
<groupId>fr.insee.vtl</groupId>
<artifactId>pogues-connector</artifactId>
<version>0.1</version>
</dependency>

<dependency>
<groupId>no.ssb.vtl</groupId>
<artifactId>java-vtl-script</artifactId>
Expand Down Expand Up @@ -217,6 +202,7 @@
<exclude>**/*.json</exclude>
<exclude>**/*.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/simpsons.xml</exclude>
</excludes>
</configuration>
<executions>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/no/ssb/vtl/tools/rest/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.common.collect.Lists;
import com.google.common.hash.HashCode;
import com.google.common.hash.Hashing;
import fr.insee.vtl.connectors.PoguesConnector;
import no.ssb.vtl.connectors.Connector;
import no.ssb.vtl.connectors.PxApiConnector;
import no.ssb.vtl.connectors.SsbApiConnector;
Expand Down Expand Up @@ -94,6 +95,9 @@ List<Connector> getConnectors(
connectors.add(connector);
}

// Adding Pogues VTL connector
connectors.add(new PoguesConnector());

connectors.add(new SsbApiConnector(new ObjectMapper()));
connectors.add(new SsbKlassApiConnector(new ObjectMapper(), SsbKlassApiConnector.PeriodType.YEAR));
if (pxApiConnectorConfiguration.getBaseUrls() != null && pxApiConnectorConfiguration.getBaseUrls().size() > 0) {
Expand Down
10 changes: 6 additions & 4 deletions src/main/resources/public/demo/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -20,8 +20,10 @@
angular.module('vtl', ['ui.codemirror', 'angular.filter'])
.controller('ExecutionController', ['$scope', '$http', '$q', function ($scope, $http, $q) {
"use strict";
$scope.expression = "ssbDataset := get(\"http://data.ssb.no/api/v0/dataset/1102\")\n" +
"klassDataset := get(\"http://data.ssb.no/api/klass/v1/classifications/20/codes?from=2013-01-01\")";
$scope.expression = "data := get(\"POGUES-TEST\")\n"+
"\ntest := [data] {\n" +
" measure VARIABLE := 3.14\n" +
"}\n";

$scope.editorOptions = {
lineWrapping: true,
Expand Down
Loading

0 comments on commit 7aa4ddc

Please sign in to comment.