GithubHelp home page GithubHelp logo

mets-model's People

Contributors

chiliego avatar dependabot[bot] avatar fluetze avatar kkrebs avatar m3ssman avatar mewel avatar possommi avatar sebhofmann avatar yagee-de avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mets-model's Issues

Exception on incomplete <mets:file>

Is the MIMETYPE attribute realy mandatory for <mets:file>

java.lang.IllegalArgumentException: MIMETYPE or ID of a mets:file must not be null
	at org.mycore.mets.model.Mets.createFileSec(Mets.java:420)
	at org.mycore.mets.model.Mets.<init>(Mets.java:140)
	at org.mycore.mets.iiif.MCRMetsMods2IIIFConverter.<init>(MCRMetsMods2IIIFConverter.java:89)

from org.mycore.mets.model.Mets:

 for (Element aFile : filesXP.evaluate(aFileGroup)) {
                String id = aFile.getAttributeValue("ID");
                String mimeType = aFile.getAttributeValue("MIMETYPE");
                if (id == null || mimeType == null) {
                    throw new IllegalArgumentException("MIMETYPE or ID of a mets:file must not be null");
                }
  }

StringIndexOutOfBoundsException in org.mycore.mets.model.files.File#asElement

java.util.concurrent.CompletionException: java.lang.StringIndexOutOfBoundsException: begin -1, end 34, length 34
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.StringIndexOutOfBoundsException: begin -1, end 34, length 34
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4601)
	at java.base/java.lang.String.substring(String.java:2704)
	at java.base/java.lang.String.substring(String.java:2677)
	at de.uni_jena.thulb.archive.media.MediaService.isMediaSupported(MediaService.java:180)
	at de.uni_jena.thulb.archive.media.events.MediaEventHandler.encodeMediaFile(MediaEventHandler.java:91)
	at de.uni_jena.thulb.archive.media.events.MediaEventHandler.lambda$handlePathCreated$2(MediaEventHandler.java:75)
	at org.mycore.util.concurrent.MCRTransactionableRunnable.run(MCRTransactionableRunnable.java:82)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)

Fail to evaluate logical sections

Desciption

Currently, mets-model fails to convert mets:structMap[@TYPE="LOGICAL"] document section into it's model, if this contains other elements than fptr or div - for example, it might also contain mptr elements.

If Mets#processLogicalChildren encounters mptr elements, the whole subtree will be ignored. This is even worse, since both fptrand mptrelements must be placed before any sibbling divs, so everything will be lost starting with this level.

SAXParse-Exception when parsing actual METS documents

org.jdom2.JDOMException: Encountered a SAX exception processing the Document: 
	at org.jdom2.transform.JDOMSource$DocumentReader.parse(JDOMSource.java:565)
	at java.xml/com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.validate(ValidatorHandlerImpl.java:731)
	at java.xml/com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:101)
	at java.xml/javax.xml.validation.Validator.validate(Validator.java:124)
	at org.mycore.mets.model.Mets.isValid(Mets.java:662)
	at org.mycore.mets.model.Mets.<init>(Mets.java:135)
	at org.mycore.mets.iiif.MCRMetsMods2IIIFConverter.<init>(MCRMetsMods2IIIFConverter.java:89)
...
Caused by: org.xml.sax.SAXParseException; cvc-type.3.1.1: Element 'mets:note' ist Simple Type und kann daher keine Attribute haben, mit Ausnahme der Attribute, deren Namespace-Name mit 'http://www.w3.org/2001/XMLSchema-instance' identisch ist und deren [lokaler Name] 'type', 'nil', 'schemaLocation' oder 'noNamespaceSchemaLocation' lautet. Es wurde allerdings das Attribut 'ubr:uri' gefunden.
	at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
	at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:135)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)

in Mayx 2018 - Version .12 the METS XML Schema was extended:

Added xsd:anyAttribute with namespace ##other and processContents lax to these elements: agent/note

Please update the internal METS-Schema that my METS document can be validated and parsed!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.