Skip to content

Commit

Permalink
Merge pull request #7 from ncats/arch-starter
Browse files Browse the repository at this point in the history
export and facet
  • Loading branch information
tylerperyea authored Nov 7, 2022
2 parents 8f30886 + ec3b372 commit 1b85282
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@

import gov.nih.ncats.common.util.Unchecked;
import gsrs.DefaultDataSourceConfig;
import gsrs.GsrsFactoryConfiguration;
import gsrs.autoconfigure.GsrsExportConfiguration;
import gsrs.controller.*;
import gsrs.controller.hateoas.HttpRequestHolder;
import gsrs.legacy.LegacyGsrsSearchService;
import gsrs.module.substance.SubstanceEntityServiceImpl;
import gsrs.repository.ETagRepository;
import gsrs.service.EtagExportGenerator;
import gsrs.service.ExportService;
import gsrs.service.GsrsEntityService;
import ix.core.models.ETag;
import ix.core.search.SearchOptions;
import ix.core.search.text.TextIndexer;
import ix.ginas.exporters.ExportMetaData;
import ix.ginas.exporters.ExportProcess;
import ix.ginas.exporters.Exporter;
Expand Down Expand Up @@ -84,6 +88,9 @@ public class ApplicationController extends EtagLegacySearchEntityController<Appl
@Autowired
private ObjectMapper objectMapper;

@Autowired
private GsrsFactoryConfiguration gsrsFactoryConfiguration;


@Override
public GsrsEntityService<Application, Long> getEntityService() {
Expand Down Expand Up @@ -234,6 +241,15 @@ public ResponseEntity<String> findCenterBySubstanceKey(@PathVariable("substanceK
}
*/

@Override
public SearchOptions instrumentSearchOptions(SearchOptions so) {

so= super.instrumentSearchOptions(so);
so.addDateRangeFacet("root_submitDate");

return so;
}

public JsonNode injectSubstanceBySubstanceKey(String substanceKey) {

JsonNode actualObj = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,15 @@ public void createIndexableValues(Application application, Consumer<IndexableVal
}

public String leftPadding(String value) {
/*
if (value != null) {
return String.format("%06d", Integer.parseInt(value));
}
return value;
*/
String paddedAppNumber = value;
if (value != null) {
paddedAppNumber = ("000000" + value).substring(("000000" + value).length() - 6);
}
return paddedAppNumber;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public String getStatusDateByYear(){
return result;
}

/*
@JsonIgnore
@Indexable(facet=true, name="Submit Date")
public String getSubmitDateRange(){
Expand Down Expand Up @@ -283,6 +284,7 @@ public String getSubmitDateRange(){
}
return result;
}
*/

/*
@JsonIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,4 +549,20 @@ gsrs.substances.molwitch.enabled=false
#Allows deep analysis of fields to do suggestions
ix.index.deepfieldsraw = "gov.hhs.gsrs.application.application.models.Application"

# Export CONFIG
ix.ginas.export.settingsPresets.applications= {
"ALL_DATA": {
"owner":"admin",
"scrubberSettings":null
}
}

# Export CONFIG
ix.ginas.export.settingsPresets.applicationsall= {
"ALL_DATA": {
"owner":"admin",
"scrubberSettings":null
}
}

##******* APPLICATION CONFIG END ***************

0 comments on commit 1b85282

Please sign in to comment.