Skip to content

Commit

Permalink
Added the config to group/re-index all ROR, removed ringgold references
Browse files Browse the repository at this point in the history
  • Loading branch information
Camelia-Orcid committed Jun 29, 2023
1 parent 2b66222 commit 86b0941
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class LoadDataForOrganizationSource {

private OrgLoadSource rorOrgSource;
private OrgLoadSource fundrefOrgSource;
private OrgLoadSource ringgoldOrgSource;

private static final String ROR_TYPE="ROR";
private static final String FUNDREF_TYPE="FUNDREF";
Expand All @@ -44,7 +43,6 @@ private void init() {
orgLoadManager = (OrgLoadManager) context.getBean("orgLoadManager");
rorOrgSource = (OrgLoadSource) context.getBean("rorOrgDataSource");
fundrefOrgSource = (OrgLoadSource) context.getBean("fundrefOrgDataSource");
ringgoldOrgSource = (OrgLoadSource) context.getBean("ringgoldOrgDataSource");
}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ public class ProcessOrganizationAsPartOfGroupForDisambiguatedOrgId {
private static final Logger LOG = LoggerFactory.getLogger(ProcessOrganizationAsPartOfGroupForDisambiguatedOrgId.class);
private OrgDisambiguatedManager orgDisambiguatedManager;
private OrgDisambiguatedDao orgDisambiguatedDao;


private OrgLoadSource rorOrgSource;
private OrgLoadSource fundrefOrgSource;
private OrgLoadSource ringgoldOrgSource;


private static final String ROR_TYPE="ROR";
private static final String FUNDREF_TYPE="FUNDREF";
Expand All @@ -48,9 +44,6 @@ public class ProcessOrganizationAsPartOfGroupForDisambiguatedOrgId {
private void init() {
ApplicationContext context = new ClassPathXmlApplicationContext("orcid-scheduler-context.xml");
orgDisambiguatedManager = (OrgDisambiguatedManager) context.getBean("orgDisambiguatedManager");
rorOrgSource = (OrgLoadSource) context.getBean("rorOrgDataSource");
fundrefOrgSource = (OrgLoadSource) context.getBean("fundrefOrgDataSource");
ringgoldOrgSource = (OrgLoadSource) context.getBean("ringgoldOrgDataSource");
orgDisambiguatedDao = (OrgDisambiguatedDao) context.getBean("orgDisambiguatedDao");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public class RorOrgLoadSource implements OrgLoadSource {

@Value("${org.orcid.core.orgs.ror.localDataPath:/tmp/grid/ror.json}")
private String localDataPath;

@Value("${org.orcid.core.orgs.ror.indexAllEnabled:false}")
private boolean indexAllEnabled;

@Resource
private OrgDisambiguatedDao orgDisambiguatedDao;
Expand Down Expand Up @@ -223,7 +226,7 @@ private boolean loadData() {
private OrgDisambiguatedEntity processInstitute(String sourceId, String name, Iso3166Country country, String city, String region, String url, String orgType) {
OrgDisambiguatedEntity existingBySourceId = orgDisambiguatedDao.findBySourceIdAndSourceType(sourceId, OrgDisambiguatedSourceType.ROR.name());
if (existingBySourceId != null) {
if (entityChanged(existingBySourceId, name, country.value(), city, region, url, orgType)) {
if (entityChanged(existingBySourceId, name, country.value(), city, region, url, orgType) || indexAllEnabled) {
existingBySourceId.setCity(city);
existingBySourceId.setCountry(country.name());
existingBySourceId.setName(name);
Expand Down
3 changes: 3 additions & 0 deletions properties/development.properties
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,6 @@ org.orcid.core.profile.lockout.window=5

# ISSN Loader Cron Configuration
org.orcid.scheduler.web.loadIssnCronConfig=0 0 0 * * FRI

# Added the config to index all RORs not only the changed ones
org.orcid.core.orgs.ror.indexAllEnabled=false

0 comments on commit 86b0941

Please sign in to comment.