Skip to content

Commit 7574fde

Browse files
Merge pull request #37 from lepidus/main
Feature/use ROR ID to assign Thoth affiliations
2 parents e3b9830 + 6c85140 commit 7574fde

7 files changed

Lines changed: 13 additions & 10 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ This is required to use the API credentials provided, that are stored encrypted
3434
### Guidelines
3535

3636
- Only basic HTML tags are preserved (`<strong>`, `<mark>`, `<em>`, `<i>`, `<u>`, `<sup>`, `<sub>`, `<ul>`, `<ol>` and `<li>`); all others will be removed
37-
- ISBN must be properly formatted (e.g., 978-3-16-148410-0)
37+
- ISBN must be properly formatted (e.g., 978-3-16-148410-0).
38+
- To avoid incorrect assignment of affiliations in Thoth, is required the use of the [ROR plugin](https://github.com/withanage/ror) to fill the affiliations in OMP.
3839

3940
### Configuration
4041

classes/services/ThothAffiliationService.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public function __construct($repository)
2525
$this->repository = $repository;
2626
}
2727

28-
public function register($affiliation, $thothContributionId)
28+
public function register($rorId, $thothContributionId)
2929
{
30-
$thothInstitution = ThothRepository::institution()->find($affiliation);
30+
$thothInstitution = ThothRepository::institution()->find($rorId);
3131

3232
if ($thothInstitution === null) {
3333
return null;

classes/services/ThothContributionService.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public function register($author, $thothWorkId, $primaryContactId = null)
4848

4949
$thothContributionId = $this->repository->add($thothContribution);
5050

51-
if ($affiliation = $author->getLocalizedAffiliation()) {
52-
ThothService::affiliation()->register($affiliation, $thothContributionId);
51+
if ($rorId = $author->getData('rorId')) {
52+
ThothService::affiliation()->register($rorId, $thothContributionId);
5353
}
5454

5555
return $thothContributionId;

docs/README-es.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ Esto es necesario para utilizar las credenciales de la API proporcionadas, que s
3434
### Orientaciones
3535

3636
- Solo se conservan las etiquetas HTML básicas (`<strong>`, `<mark>`, `<em>`, `<i>`, `<u>`, `<sup>`, `<sub>`, `<ul>`, `<ol>` y `<li>`); todas las demás serán eliminadas
37-
- El ISBN debe estar correctamente formateado (por ejemplo, 978-3-16-148410-0)
37+
- El ISBN debe estar correctamente formateado (por ejemplo, 978-3-16-148410-0).
38+
- Para evitar la asignación incorrecta de afiliaciones en Thoth, se requiere el uso del [plugin ROR](https://github.com/withanage/ror) para completar las afiliaciones en OMP.
3839

3940
### Configuración
4041

docs/README-pt_BR.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ Isso é necessário para usar as credenciais da API fornecidas, que são armazen
3434
### Orientações
3535

3636
- Apenas tags básicas de HTML são preservadas (`<strong>`, `<mark>`, `<em>`, `<i>`, `<u>`, `<sup>`, `<sub>`, `<ul>`, `<ol>` e `<li>`); todas as outras serão removidas
37-
- O ISBN deve estar devidamente formatado (por exemplo, 978-3-16-148410-0)
37+
- O ISBN deve estar devidamente formatado (por exemplo, 978-3-16-148410-0).
38+
- Para evitar a atribuição incorreta de afiliações no Thoth, é necessário o uso do [plugin ROR](https://github.com/withanage/ror) para preencher as afiliações no OMP.
3839

3940
### Configuração
4041

tests/classes/services/ThothAffiliationServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ public function testRegisterAffiliation()
6060
->method('add')
6161
->will($this->returnValue('43f98edb-ac8c-45b4-9faa-2941a05c133c'));
6262

63-
$affiliation = 'My Affiliation Institution';
63+
$rorId = 'https://ror.org/00101234';
6464
$thothContributionId = '7315563c-e5c3-40b2-8558-8d1f9cede901';
6565

6666
$service = new ThothAffiliationService($mockRepository);
67-
$thothAffiliationId = $service->register($affiliation, $thothContributionId);
67+
$thothAffiliationId = $service->register($rorId, $thothContributionId);
6868

6969
$this->assertSame('43f98edb-ac8c-45b4-9faa-2941a05c133c', $thothAffiliationId);
7070
}

version.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<version>
44
<application>thoth</application>
55
<type>plugins.generic</type>
6-
<release>0.2.7.0</release>
6+
<release>0.2.8.0</release>
77
<date>2025-05-01</date>
88
<lazy-load>1</lazy-load>
99
<class>ThothPlugin</class>

0 commit comments

Comments
 (0)