-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'alpha' into SCRUM-4654
- Loading branch information
Showing
37 changed files
with
1,052 additions
and
8 deletions.
There are no files selected for viewing
8 changes: 6 additions & 2 deletions
8
src/main/cliapp/src/components/Actions/EntityDetailsAction.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...ud/associations/agmAssociations/AgmSequenceTargetingReagentAssociationCrudController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.alliancegenome.curation_api.controllers.crud.associations.agmAssociations; | ||
|
||
import java.util.List; | ||
|
||
import org.alliancegenome.curation_api.controllers.base.BaseEntityCrudController; | ||
import org.alliancegenome.curation_api.dao.associations.agmAssociations.AgmSequenceTargetingReagentAssociationDAO; | ||
import org.alliancegenome.curation_api.interfaces.crud.associations.agmAssociations.AgmSequenceTargetingReagentAssociationCrudInterface; | ||
import org.alliancegenome.curation_api.jobs.executors.associations.agmAssociations.AgmStrAssociationExecutor; | ||
import org.alliancegenome.curation_api.model.entities.associations.agmAssociations.AgmSequenceTargetingReagentAssociation; | ||
import org.alliancegenome.curation_api.model.ingest.dto.associations.agmAssociations.AgmSequenceTargetingReagentAssociationDTO; | ||
import org.alliancegenome.curation_api.response.APIResponse; | ||
import org.alliancegenome.curation_api.response.ObjectResponse; | ||
import org.alliancegenome.curation_api.services.associations.agmAssociations.AgmStrAssociationService; | ||
|
||
import jakarta.annotation.PostConstruct; | ||
import jakarta.enterprise.context.RequestScoped; | ||
import jakarta.inject.Inject; | ||
|
||
@RequestScoped | ||
public class AgmSequenceTargetingReagentAssociationCrudController extends | ||
BaseEntityCrudController<AgmStrAssociationService, AgmSequenceTargetingReagentAssociation, AgmSequenceTargetingReagentAssociationDAO> | ||
implements AgmSequenceTargetingReagentAssociationCrudInterface { | ||
|
||
@Inject | ||
AgmStrAssociationService agmStrAssociationService; | ||
@Inject | ||
AgmStrAssociationExecutor agmStrAssociationExecutor; | ||
|
||
@Override | ||
@PostConstruct | ||
protected void init() { | ||
setService(agmStrAssociationService); | ||
} | ||
|
||
public ObjectResponse<AgmSequenceTargetingReagentAssociation> getAssociation(Long alleleId, String relationName, Long geneId) { | ||
return agmStrAssociationService.getAssociation(alleleId, relationName, geneId); | ||
} | ||
|
||
@Override | ||
public APIResponse updateAgmStrAssociations(String dataProvider, List<AgmSequenceTargetingReagentAssociationDTO> associationData) { | ||
return agmStrAssociationExecutor.runLoadApi(agmStrAssociationService, dataProvider, associationData); | ||
|
||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...ation_api/dao/associations/agmAssociations/AgmSequenceTargetingReagentAssociationDAO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.alliancegenome.curation_api.dao.associations.agmAssociations; | ||
|
||
import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; | ||
import org.alliancegenome.curation_api.model.entities.associations.agmAssociations.AgmSequenceTargetingReagentAssociation; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
@ApplicationScoped | ||
public class AgmSequenceTargetingReagentAssociationDAO extends BaseSQLDAO<AgmSequenceTargetingReagentAssociation> { | ||
|
||
protected AgmSequenceTargetingReagentAssociationDAO() { | ||
super(AgmSequenceTargetingReagentAssociation.class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...rud/associations/agmAssociations/AgmSequenceTargetingReagentAssociationCrudInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.alliancegenome.curation_api.interfaces.crud.associations.agmAssociations; | ||
|
||
import java.util.List; | ||
|
||
import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; | ||
import org.alliancegenome.curation_api.model.entities.associations.agmAssociations.AgmSequenceTargetingReagentAssociation; | ||
import org.alliancegenome.curation_api.model.ingest.dto.associations.agmAssociations.AgmSequenceTargetingReagentAssociationDTO; | ||
import org.alliancegenome.curation_api.response.APIResponse; | ||
import org.alliancegenome.curation_api.response.ObjectResponse; | ||
import org.alliancegenome.curation_api.view.View; | ||
import org.eclipse.microprofile.openapi.annotations.tags.Tag; | ||
|
||
import com.fasterxml.jackson.annotation.JsonView; | ||
|
||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.QueryParam; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
@Path("/agmstrassociation") | ||
@Tag(name = "CRUD - AGM Sequence Targeting Reagent Associations") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
public interface AgmSequenceTargetingReagentAssociationCrudInterface extends BaseIdCrudInterface<AgmSequenceTargetingReagentAssociation> { | ||
|
||
@GET | ||
@Path("/findBy") | ||
@JsonView(View.FieldsAndLists.class) | ||
ObjectResponse<AgmSequenceTargetingReagentAssociation> getAssociation(@QueryParam("agmId") Long agmId, @QueryParam("relationName") String relationName, @QueryParam("strId") Long strId); | ||
|
||
@POST | ||
@Path("/bulk/{dataProvider}/associationFile") | ||
@JsonView(View.FieldsAndLists.class) | ||
APIResponse updateAgmStrAssociations(@PathParam("dataProvider") String dataProvider, List<AgmSequenceTargetingReagentAssociationDTO> associationData); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...e/curation_api/jobs/executors/associations/agmAssociations/AgmStrAssociationExecutor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package org.alliancegenome.curation_api.jobs.executors.associations.agmAssociations; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; | ||
import org.alliancegenome.curation_api.jobs.executors.LoadFileExecutor; | ||
import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileHistory; | ||
import org.alliancegenome.curation_api.model.entities.bulkloads.BulkManualLoad; | ||
import org.alliancegenome.curation_api.model.ingest.dto.IngestDTO; | ||
import org.alliancegenome.curation_api.model.ingest.dto.associations.agmAssociations.AgmSequenceTargetingReagentAssociationDTO; | ||
import org.alliancegenome.curation_api.services.associations.agmAssociations.AgmStrAssociationService; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.inject.Inject; | ||
import lombok.extern.jbosslog.JBossLog; | ||
|
||
@JBossLog | ||
@ApplicationScoped | ||
public class AgmStrAssociationExecutor extends LoadFileExecutor { | ||
|
||
@Inject AgmStrAssociationService agmStrAssociationService; | ||
|
||
public void execLoad(BulkLoadFileHistory bulkLoadFileHistory, Boolean cleanUp) { | ||
|
||
BulkManualLoad manual = (BulkManualLoad) bulkLoadFileHistory.getBulkLoad(); | ||
BackendBulkDataProvider dataProvider = manual.getDataProvider(); | ||
log.info("Running with dataProvider: " + dataProvider.name()); | ||
|
||
IngestDTO ingestDto = readIngestFile(bulkLoadFileHistory, AgmSequenceTargetingReagentAssociationDTO.class); | ||
if (ingestDto == null) { | ||
return; | ||
} | ||
|
||
List<AgmSequenceTargetingReagentAssociationDTO> associations = ingestDto.getAgmStrAssociationIngestSet(); | ||
if (associations == null) { | ||
associations = new ArrayList<>(); | ||
} | ||
|
||
List<Long> associationIdsLoaded = new ArrayList<>(); | ||
List<Long> associationIdsBefore = new ArrayList<>(); | ||
if (cleanUp) { | ||
associationIdsBefore.addAll(agmStrAssociationService.getAssociationsByDataProvider(dataProvider)); | ||
associationIdsBefore.removeIf(Objects::isNull); | ||
} | ||
|
||
bulkLoadFileHistory.getBulkLoadFile().setRecordCount(associations.size() + bulkLoadFileHistory.getBulkLoadFile().getRecordCount()); | ||
bulkLoadFileDAO.merge(bulkLoadFileHistory.getBulkLoadFile()); | ||
|
||
bulkLoadFileHistory.setCount(associations.size()); | ||
updateHistory(bulkLoadFileHistory); | ||
|
||
boolean success = runLoad(agmStrAssociationService, bulkLoadFileHistory, dataProvider, associations, associationIdsLoaded); | ||
if (success && cleanUp) { | ||
runCleanup(agmStrAssociationService, bulkLoadFileHistory, dataProvider.name(), associationIdsBefore, associationIdsLoaded, "agm str association"); | ||
} | ||
bulkLoadFileHistory.finishLoad(); | ||
updateHistory(bulkLoadFileHistory); | ||
updateExceptions(bulkLoadFileHistory); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.