Skip to content
Snippets Groups Projects

fix(UnpaywallImportService): prevent exception blocking the deposit process...

Merged Nicolas.Rod requested to merge rodn-605-fix-unpaywall-import into master
1 unresolved thread

https://issues.unige.ch/browse/AOU-605

The logic is now in pseudo code:

if (bronze && has_repository_copy) {
  if(some location with license exists) {
      we take the 1st one:
        - accessLevel -> public
        - license -> "Other OA"
        - url_for_pdf
        - version
  
    } else {
      we take the 1st one without license:
        - accessLevel -> restricted
        - license -> null
        - url_for_pdf
        - version
    }  
} elseif ("best_oa_location" exists) {
  we take from "best_oa_location":
    - accessLevel -> restricted
    - url_for_pdf
    - license:
      - if the name is known in AoU, we use it
      - if there is a name, but it is unknown in AoU --> « Other OA »
      - if null -> null
    - version
} else {
  we don't take anything
}

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
117
118 } else if (jsonObject.has("best_oa_location")) {
119 /**
120 * Case of real Open Access
121 */
122 JSONObject bestOALocation = jsonObject.getJSONObject("best_oa_location");
123
124 String licenseName = this.getStringOrNull(bestOALocation, LICENSE);
125 license = this.getLicense(licenseName);
126 if (license != null) {
127 // if the license name returned by Unpaywall matches one of your license, we use it and set the access to public by default
128 accessLevel = DocumentFile.AccessLevel.PUBLIC;
129 } else {
130 // if the license doesn't match one of the OaU license, we use the OtherOA license and set the access to restricted by default
131 license = this.getLicense(LICENSE_OTHER_AO);
132 accessLevel = DocumentFile.AccessLevel.RESTRICTED;
  • Je crois que la licence doit etre Public dans le cas de pas bronze et avec "best_oa_location", au moins c'était expliqué comme ça dans la doc qu'il a dans l'issue.

  • Le pseudo code en haut a été validé par Floriane. Et encore, j'ai demandé à JB si on ne mettait pas public quand même quand on reconnaissait la licence. Je te propose de laisser comme ça et de corriger à l'usage s'ils se rendent compte qu'il faudrait modifier la logique.

  • Please register or sign in to reply
  • added 5 commits

    • 0ccad1c6...96421928 - 4 commits from branch master
    • 370a4270 - fix(UnpaywallImportService): prevent exception blocking the deposit process...

    Compare with previous version

  • Please register or sign in to reply
    Loading