1
0
Fork 0

DoiBoost AccessRigh #4362 - set BestAccessRight with the ususal comparator

This commit is contained in:
Miriam Baglioni 2021-07-19 12:34:35 +02:00
parent 199123b74b
commit 59530a14fb
1 changed files with 12 additions and 11 deletions

View File

@ -258,17 +258,18 @@ object DoiBoostMappingUtil {
i.setHostedby(hb) i.setHostedby(hb)
}) })
val ar = publication.getInstance().asScala.filter(i => i.getInstancetype != null && i.getAccessright!= null && i.getAccessright.getClassid!= null).map(f=> f.getAccessright.getClassid) publication.setBestaccessright(OafMapperUtils.createBestAccessRights(publication.getInstance()))
if (ar.nonEmpty) { // val ar = publication.getInstance().asScala.filter(i => i.getInstancetype != null && i.getAccessright!= null && i.getAccessright.getClassid!= null).map(f=> f.getAccessright.getClassid)
if(ar.contains(ModelConstants.ACCESS_RIGHT_OPEN)){ // if (ar.nonEmpty) {
val ar = getOpenAccessQualifier() // if(ar.contains(ModelConstants.ACCESS_RIGHT_OPEN)){
publication.setBestaccessright(OafMapperUtils.qualifier(ar.getClassid, ar.getClassname, ar.getSchemeid, ar.getSchemename)) // val ar = getOpenAccessQualifier()
} // publication.setBestaccessright(OafMapperUtils.qualifier(ar.getClassid, ar.getClassname, ar.getSchemeid, ar.getSchemename))
else { // }
val ar = getRestrictedQualifier() // else {
publication.setBestaccessright(OafMapperUtils.qualifier(ar.getClassid, ar.getClassname, ar.getSchemeid, ar.getSchemename)) // val ar = getRestrictedQualifier()
} // publication.setBestaccessright(OafMapperUtils.qualifier(ar.getClassid, ar.getClassname, ar.getSchemeid, ar.getSchemename))
} // }
// }
publication publication
} }