feat(export): perfiles DSpace/EPrints/Dublin Core y selector SWORD en UI

Backend: generadores por repositorio, ZIP multi-formato y query profile en /export/sword. Frontend: selector Destino que envia profile al descargar SWORD XML.
This commit is contained in:
Mireya Cueto Garrido
2026-05-20 13:25:35 +02:00
parent 9b596af494
commit aa2e7280dc
9 changed files with 585 additions and 64 deletions
+9 -2
View File
@@ -402,13 +402,15 @@ export function getExportUrl(orcidId, format) {
* `["id1", "id2", ...]` (array crudo, tal como espera el backend).
* - Si viene vacío/undefined usamos el endpoint masivo
* `GET /export/{sword|zip}/researcher/{orcid_id}` y descargamos todo.
* - Para SWORD XML, `profile` añade `?profile=dublin_core|dspace|eprints`
* (genérico = sin query).
*
* Lanza `ApiError` en fallo.
*/
export async function downloadExport(
orcidId,
format,
{ signal, publicationIds } = {},
{ signal, publicationIds, profile } = {},
) {
if (USE_MOCKS) {
await mockExport(format);
@@ -421,10 +423,15 @@ export async function downloadExport(
? publicationIds
: null;
const url = ids
let url = ids
? `${BASE_URL}/export/${segment}/publications`
: `${BASE_URL}/export/${segment}/researcher/${encodeURIComponent(orcidId)}`;
if (format === "xml" && profile && profile !== "generic") {
const separator = url.includes("?") ? "&" : "?";
url += `${separator}profile=${encodeURIComponent(profile)}`;
}
const init = {
method: ids ? "POST" : "GET",
signal,