another fix for _typology_to_remove_
This commit is contained in:
parent
44e170946f
commit
2f36d8ff47
|
@ -95,9 +95,50 @@ public class DsmMappingUtils {
|
||||||
o.setCollectedfrom(dbe.getCollectedfrom());
|
o.setCollectedfrom(dbe.getCollectedfrom());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_fix_typology(dbe, d);
|
||||||
|
|
||||||
return dbe;
|
return dbe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
private static void _fix_typology(final DatasourceDbEntry dbe, final DatasourceDetails d) {
|
||||||
|
if (StringUtils.isNotBlank(d.getTypology()) && StringUtils.isBlank(d.getEoscDatasourceType())) {
|
||||||
|
// THE ORDER IS IMPORTANT: DO NOT CHANGE IT
|
||||||
|
if (d.getTypology().startsWith("crissystem")) {
|
||||||
|
dbe.setEoscDatasourceType("CRIS system");
|
||||||
|
} else if (d.getTypology().startsWith("entityregistry")) {
|
||||||
|
dbe.setEoscDatasourceType("Registry");
|
||||||
|
} else if (d.getTypology().startsWith("pubscatalogue") || d.getTypology().equals("websource")) {
|
||||||
|
dbe.setEoscDatasourceType("Catalogue");
|
||||||
|
} else if (d.getTypology().contains("journal")) {
|
||||||
|
dbe.setEoscDatasourceType("Journal archive");
|
||||||
|
} else if (d.getTypology().startsWith("aggregator")) {
|
||||||
|
dbe.setEoscDatasourceType("Aggregator");
|
||||||
|
} else if (d.getTypology().contains("repository")) {
|
||||||
|
dbe.setEoscDatasourceType("Repository");
|
||||||
|
} else {
|
||||||
|
dbe.setEoscDatasourceType("Aggregator");
|
||||||
|
}
|
||||||
|
} else if (StringUtils.isBlank(d.getTypology()) && StringUtils.isNotBlank(d.getEoscDatasourceType())) {
|
||||||
|
if (dbe.getEoscDatasourceType().equals("CRIS system")) {
|
||||||
|
dbe.setTypology("crissystem");
|
||||||
|
} else if (dbe.getEoscDatasourceType().equals("Registry")) {
|
||||||
|
dbe.setTypology("entityregistry");
|
||||||
|
} else if (dbe.getEoscDatasourceType().equals("Catalogue")) {
|
||||||
|
dbe.setTypology("pubscatalogue::unknown");
|
||||||
|
} else if (dbe.getEoscDatasourceType().equals("Journal archive")) {
|
||||||
|
dbe.setTypology("pubsrepository::journal");
|
||||||
|
} else if (dbe.getEoscDatasourceType().equals("Aggregator")) {
|
||||||
|
dbe.setTypology("aggregator");
|
||||||
|
} else if (dbe.getEoscDatasourceType().equals("Repository")) {
|
||||||
|
dbe.setTypology("pubsrepository::unknown");
|
||||||
|
} else {
|
||||||
|
dbe.setTypology("aggregator");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DatasourceDbEntry asDbEntry(final DatasourceDetailsUpdate d) {
|
public static DatasourceDbEntry asDbEntry(final DatasourceDetailsUpdate d) {
|
||||||
return _convert(d, DatasourceDbEntry.class);
|
return _convert(d, DatasourceDbEntry.class);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue