Skip to content

Commit

Permalink
fix some transformer issues, and while we're at it migrate them to th…
Browse files Browse the repository at this point in the history
…e newly renamed bdp-core libraries
  • Loading branch information
clezag committed Dec 4, 2023
1 parent d9eeda5 commit 1dbba25
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 60 deletions.
6 changes: 3 additions & 3 deletions transformers/emobility-echarging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ SPDX-License-Identifier: CC0-1.0
</dependency>

<dependency>
<groupId>it.bz.idm.bdp</groupId>
<artifactId>dc-interface</artifactId>
<version>8.0.0</version>
<groupId>com.opendatahub.timeseries.bdp</groupId>
<artifactId>client</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

import it.bz.idm.bdp.dto.DataMapDto;
import it.bz.idm.bdp.dto.DataTypeDto;
import it.bz.idm.bdp.dto.ProvenanceDto;
import it.bz.idm.bdp.dto.RecordDtoImpl;
import it.bz.idm.bdp.dto.SimpleRecordDto;
import it.bz.idm.bdp.dto.StationDto;
import it.bz.idm.bdp.dto.StationList;
import it.bz.idm.bdp.json.NonBlockingJSONPusher;
import com.opendatahub.timeseries.bdp.dto.dto.DataMapDto;
import com.opendatahub.timeseries.bdp.dto.dto.DataTypeDto;
import com.opendatahub.timeseries.bdp.dto.dto.ProvenanceDto;
import com.opendatahub.timeseries.bdp.dto.dto.RecordDtoImpl;
import com.opendatahub.timeseries.bdp.dto.dto.SimpleRecordDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationList;
import com.opendatahub.timeseries.bdp.client.json.NonBlockingJSONPusher;
import com.opendatahub.dc.echarging.dto.ChargerDtoV2;
import com.opendatahub.dc.echarging.dto.ChargingPointsDtoV2;

Expand All @@ -37,7 +37,7 @@ public class ChargePusher extends NonBlockingJSONPusher {
private Environment env;

@Override
public String initIntegreenTypology() {
public String initStationType() {
return "EChargingStation";
}

Expand Down Expand Up @@ -83,7 +83,7 @@ public StationList mapStations2bdp(List<ChargerDtoV2> fetchedStations) {
s.getMetaData().put("accessType", dto.getAccessType());
s.getMetaData().put("categories", dto.getCategories());
s.setOrigin(origin);
s.setStationType(this.integreenTypology);
s.setStationType(this.stationType);
if (s.isValid()) {
stations.add(s);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@ComponentScan({"com.opendatahub.dc.echarging", "it.bz.idm.bdp"})
@ComponentScan({"com.opendatahub.dc.echarging", "com.opendatahub.timeseries.bdp"})
@SpringBootApplication
public class Main {
public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import com.opendatahub.transformer.lib.listener.MsgDto;
import com.opendatahub.transformer.lib.listener.TransformerListener;

import it.bz.idm.bdp.dto.DataMapDto;
import it.bz.idm.bdp.dto.DataTypeDto;
import it.bz.idm.bdp.dto.RecordDtoImpl;
import it.bz.idm.bdp.dto.StationList;
import com.opendatahub.timeseries.bdp.dto.dto.DataMapDto;
import com.opendatahub.timeseries.bdp.dto.dto.DataTypeDto;
import com.opendatahub.timeseries.bdp.dto.dto.RecordDtoImpl;
import com.opendatahub.timeseries.bdp.dto.dto.StationList;

@Service
public class Transformer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

import it.bz.idm.bdp.dto.ChildDto;
import com.opendatahub.timeseries.bdp.dto.dto.ChildDto;

@JsonInclude(value=Include.NON_EMPTY)
public class ChildPlugDto extends ChildDto{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import com.opendatahub.dc.echarging.dto.ChargingPositionDto;
import com.opendatahub.dc.echarging.dto.OutletDtoV2;

import it.bz.idm.bdp.dto.DataMapDto;
import it.bz.idm.bdp.dto.DataTypeDto;
import it.bz.idm.bdp.dto.RecordDtoImpl;
import it.bz.idm.bdp.dto.SimpleRecordDto;
import it.bz.idm.bdp.dto.StationDto;
import it.bz.idm.bdp.dto.StationList;
import com.opendatahub.timeseries.bdp.dto.dto.DataMapDto;
import com.opendatahub.timeseries.bdp.dto.dto.DataTypeDto;
import com.opendatahub.timeseries.bdp.dto.dto.RecordDtoImpl;
import com.opendatahub.timeseries.bdp.dto.dto.SimpleRecordDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationList;

public class PusherTestIT extends AbstractJUnit4SpringContextTests{

Expand Down
6 changes: 3 additions & 3 deletions transformers/google-spreadsheet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
<version>1.0</version>
</dependency>
<dependency>
<groupId>it.bz.idm.bdp</groupId>
<artifactId>dc-interface</artifactId>
<version>8.0.0</version>
<groupId>com.opendatahub.timeseries.bdp</groupId>
<artifactId>client</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import com.opendatahub.transformer.spreadsheet.google.services.ODHClient;
import com.opendatahub.transformer.spreadsheet.google.util.SheetUtil;

import it.bz.idm.bdp.dto.DataMapDto;
import it.bz.idm.bdp.dto.DataTypeDto;
import it.bz.idm.bdp.dto.RecordDtoImpl;
import it.bz.idm.bdp.dto.SimpleRecordDto;
import it.bz.idm.bdp.dto.StationList;
import com.opendatahub.timeseries.bdp.dto.dto.DataMapDto;
import com.opendatahub.timeseries.bdp.dto.dto.DataTypeDto;
import com.opendatahub.timeseries.bdp.dto.dto.RecordDtoImpl;
import com.opendatahub.timeseries.bdp.dto.dto.SimpleRecordDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationList;

@Service
/* This is the default implementation of a spreadsheet transformer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.opendatahub.transformer.lib.listener.TransformerListener;
import com.opendatahub.transformer.spreadsheet.google.util.Decoder;

@ComponentScan({"com.opendatahub.transformer.spreadsheet.google", "it.bz.idm.bdp"})
@ComponentScan({"com.opendatahub.transformer.spreadsheet.google", "com.opendatahub.timeseries.bdp"})
@SpringBootApplication
public class Main {
private Logger logger = LoggerFactory.getLogger(Main.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import com.opendatahub.transformer.spreadsheet.google.services.ODHClient;
import com.opendatahub.transformer.spreadsheet.google.util.SheetUtil;

import it.bz.idm.bdp.dto.StationDto;
import it.bz.idm.bdp.dto.StationList;
import com.opendatahub.timeseries.bdp.dto.dto.StationDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationList;

/**
* Reads static e-charging stations from a google spreadsheet and maps them to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package com.opendatahub.transformer.spreadsheet.google.dto;

import it.bz.idm.bdp.dto.DataTypeDto;
import com.opendatahub.timeseries.bdp.dto.dto.DataTypeDto;

public class DataTypeWrapperDto {
private DataTypeDto type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.ArrayList;
import java.util.List;

import it.bz.idm.bdp.dto.StationDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationDto;

public class MappingResult {
private List<StationDto> stationDtos = new ArrayList<StationDto>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import org.springframework.stereotype.Component;


import it.bz.idm.bdp.dto.DataTypeDto;
import it.bz.idm.bdp.dto.StationDto;
import it.bz.idm.bdp.dto.StationList;
import com.opendatahub.timeseries.bdp.dto.dto.DataTypeDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationList;
import jakarta.annotation.PostConstruct;

import com.google.api.services.sheets.v4.model.Sheet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import it.bz.idm.bdp.dto.DataMapDto;
import it.bz.idm.bdp.dto.ProvenanceDto;
import it.bz.idm.bdp.dto.RecordDtoImpl;
import it.bz.idm.bdp.json.NonBlockingJSONPusher;
import com.opendatahub.timeseries.bdp.dto.dto.DataMapDto;
import com.opendatahub.timeseries.bdp.dto.dto.ProvenanceDto;
import com.opendatahub.timeseries.bdp.dto.dto.RecordDtoImpl;
import com.opendatahub.timeseries.bdp.client.json.NonBlockingJSONPusher;

@Component
public class ODHClient extends NonBlockingJSONPusher{
Expand All @@ -31,7 +31,7 @@ public <T> DataMapDto<RecordDtoImpl> mapData(T data) {
}

@Override
public String initIntegreenTypology() {
public String initStationType() {
return stationtype;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import it.bz.idm.bdp.dto.StationDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationDto;
import jakarta.annotation.PostConstruct;

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import it.bz.idm.bdp.dto.StationDto;
import it.bz.idm.bdp.util.LocationLookup;
import it.bz.idm.bdp.util.NominatimException;
import it.bz.idm.bdp.util.NominatimLocationLookupUtil;
import com.opendatahub.timeseries.bdp.dto.dto.StationDto;
import com.opendatahub.timeseries.bdp.client.util.LocationLookup;
import com.opendatahub.timeseries.bdp.client.util.NominatimException;
import com.opendatahub.timeseries.bdp.client.util.NominatimLocationLookupUtil;

@Component
public class LocationLookupUtil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

package com.opendatahub.tr.meteorology.eurac;

import it.bz.idm.bdp.dto.DataMapDto;
import it.bz.idm.bdp.dto.ProvenanceDto;
import it.bz.idm.bdp.dto.RecordDtoImpl;
import it.bz.idm.bdp.json.NonBlockingJSONPusher;
import com.opendatahub.timeseries.bdp.dto.dto.DataMapDto;
import com.opendatahub.timeseries.bdp.dto.dto.ProvenanceDto;
import com.opendatahub.timeseries.bdp.dto.dto.RecordDtoImpl;
import com.opendatahub.timeseries.bdpjson.NonBlockingJSONPusher;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import com.opendatahub.transformer.lib.listener.MsgDto;
import com.opendatahub.transformer.lib.listener.TransformerListener;

import it.bz.idm.bdp.dto.DataMapDto;
import it.bz.idm.bdp.dto.DataTypeDto;
import it.bz.idm.bdp.dto.RecordDtoImpl;
import it.bz.idm.bdp.dto.StationDto;
import it.bz.idm.bdp.dto.StationList;
import com.opendatahub.timeseries.bdp.dto.dto.DataMapDto;
import com.opendatahub.timeseries.bdp.dto.dto.DataTypeDto;
import com.opendatahub.timeseries.bdp.dto.dto.RecordDtoImpl;
import com.opendatahub.timeseries.bdp.dto.dto.StationDto;
import com.opendatahub.timeseries.bdp.dto.dto.StationList;

@Service
public class Transformer {
Expand Down

0 comments on commit 1dbba25

Please sign in to comment.