Closed filak closed 6 years ago
Stejné je to i s ALTO streamy:
ERROR Error: Invalid XML: <?xml version="1.0" encoding="utf-8"?><alto /></TextLine></TextBlock></ComposedBlock></PrintSpace></Page></Layout></alto> at Function.error (scripts.cabdeae7befc236ae899.bundle.js:4) at Function.vt.parseXML (scripts.cabdeae7befc236ae899.bundle.js:6)
Server vraci duplicitni hlavicky: Access-Control-Allow-Headers: x-requested-with Access-Control-Allow-Headers: x-scheme, x-requested-with, Content-Type, origin, authorization, accept, client-security-token Access-Control-Allow-Methods: POST, GET, OPTIONS, HEAD Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE Access-Control-Allow-Origin: Access-Control-Allow-Origin: Access-Control-Max-Age: 1000 Access-Control-Max-Age: 3600
A konkretne dvoji Access-Control-Allow-Origin hlavicka brani v testovni klineta nad vasim Krameriem mimo vasi domenu. Tohle nevyresi prvotni problem, ale brani tomu, abych to mohl nejak lepe proverit.
Omlouvam se, jsem asi zmotal 2 problemy dohromady.
Hlavicky jsem poladil - uz jsou tam jen jednou.
Můžu potvrdit, že ALTO streamy už fungují dobře jak s K5 tak i K6 jádrem.
Podival jsem se na to jeste jednou a poradne, a problem vidim v tomto:
export class ModsParserService { parse(mods, uuid: string): Metadata { const xml = mods.replace(/xmlns.="."/g, '');
Tohle nahrazeni nefunguje dobre, kdyz se vyradi (const xml = mods;), tak se metadata normalne zobrazuji.
V konzoli je pak chyba:
main.2dacee832301f482d083.bundle.js:1 ERROR TypeError: Cannot read property 'modsCollection' of undefined at e.createMetadata (main.2dacee832301f482d083.bundle.js:1) at main.2dacee832301f482d083.bundle.js:1 ...
V odpovědi na požadavek http://.../search/api/v5.0/item/uuid:.../streams/BIBLIO_MODS je navíc xml deklarace:
<?xml version="1.0" encoding="UTF-8"?><mods:modsCollection xmlns:mods="http://www.loc.gov/mods/v3" xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:mets="http://www.loc.gov/METS/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><mods:mods><mods:identifier ...
Fedora 3 to XML vrací bez deklarace.