Revision 53097
Added by Michele Artini over 5 years ago
GridOrganizationsApplication.java | ||
---|---|---|
9 | 9 |
import org.springframework.boot.SpringApplication; |
10 | 10 |
import org.springframework.boot.autoconfigure.SpringBootApplication; |
11 | 11 |
|
12 |
import com.googlecode.protobuf.format.JsonFormat; |
|
13 |
|
|
12 | 14 |
import eu.dnetlib.grid.process.model.GridOrganization; |
13 | 15 |
import eu.dnetlib.grid.process.utils.Datasource; |
14 | 16 |
import eu.dnetlib.grid.process.utils.GridCleaner; |
... | ... | |
42 | 44 |
.filter(o -> o.getStatus().equals("active")) |
43 | 45 |
.collect(Collectors.toMap(GridOrganization::getId, GridUtils::findShortName)); |
44 | 46 |
|
47 |
final JsonFormat jsonFormat = new JsonFormat(); |
|
48 |
|
|
45 | 49 |
GridUtils.streamOrganizations(jsonFile) |
46 | 50 |
.filter(Objects::nonNull) |
47 | 51 |
.filter(o -> o.getStatus().equals("active")) |
48 | 52 |
.map(cleaner) |
49 | 53 |
.map(org -> GridUtils.toProtos(org, parents, gridDs)) |
50 | 54 |
.flatMap(List::stream) |
51 |
.map(s -> s.getEntity().getId()) // TODO OAF -> JSON |
|
55 |
.map(jsonFormat::printToString) |
|
56 |
// .map(s -> s.getEntity().getId()) // TODO OAF -> JSON |
|
52 | 57 |
.forEach(System.out::println); |
53 | 58 |
|
54 | 59 |
} |
Also available in: Unified diff