Package org.eclipse.pass.loader.nihms
Class NihmsPublicationToSubmission
java.lang.Object
org.eclipse.pass.loader.nihms.NihmsPublicationToSubmission
Does the heavy lifting of data transform work, converting a NihmsPublication to a
NihmsSubmissionDTO (submission + deposits) for loading to the database
- Author:
- Karen Hanson
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor uses defaults for client service and pmid lookupNihmsPublicationToSubmission(NihmsPassClientService clientService, PmidLookup pmidLookup) Constructor initiates with the required NIHMS Client Service and PMID lookup Useful to pass in an existing clientService to reuse cache -
Method Summary
Modifier and TypeMethodDescriptionstatic CopyStatuscalcRepoCopyStatus(NihmsPublication pub, CopyStatus currCopyStatus) Determines a new deposit status based on various dates populated in the NIHMS publication If the status registered in PASS is further along than NIHMS thinks we are, roll back to what NIHMS says and log the fact as a warning.Does the heavy lifting of converting a NihmsPublication record into the NihmsSubmissionDTO that is needed for the NihmsLoader
-
Constructor Details
-
NihmsPublicationToSubmission
public NihmsPublicationToSubmission()Constructor uses defaults for client service and pmid lookup -
NihmsPublicationToSubmission
Constructor initiates with the required NIHMS Client Service and PMID lookup Useful to pass in an existing clientService to reuse cache- Parameters:
clientService- PASS clientpmidLookup- Entrez client
-
-
Method Details
-
transform
Does the heavy lifting of converting a NihmsPublication record into the NihmsSubmissionDTO that is needed for the NihmsLoader- Parameters:
pub- the publication- Returns:
- the DTO, never
null - Throws:
IOException- if there is a problem with the lookup of the publication, repository, submission
-
calcRepoCopyStatus
Determines a new deposit status based on various dates populated in the NIHMS publication If the status registered in PASS is further along than NIHMS thinks we are, roll back to what NIHMS says and log the fact as a warning. If this calc returns NULL, a repository copy should not have been created- Parameters:
pub- the publicationcurrCopyStatus- current RepositoryCopy CopyStatus- Returns:
- the new copy status, may be
null
-