[Metafacture] implementation of new morph functions
Günter Hipler
guenter.hipler at unibas.ch
Mon Mar 23 23:43:10 CET 2015
Hi,
I want to implement additional morph functions in my own repository and
deploy them AS packaged jar-files
There is a nice procedure with flux commands which are loaded as plugins
when they are part of the plugins directory in the metafacture-runner
repository. The only thing to be done is to write an additional
flux-commands.properties file with the new commands.
Metamorph functions in contrast have to be defined in the metamorph.xsd
schema ( <group name="function">) part of the metafacture-core
repository.
An additional morph-functions.properties file isn't enough. I get errors
like:
Exception in thread "main"
org.culturegraph.mf.exceptions.MetafactureException: class
org.culturegraph.mf.morph.Metamorph could not be instantiated
<snip....>
Caused by: org.culturegraph.mf.exceptions.MorphDefException: Error
during DOM creation: Error parsing xml: cvc-complex-type.2.4.a: Invalid
content was found starting with element 'itemLink'. One of
'{"http://www.culturegraph.org/metamorph":compose,
"http://www.culturegraph.org/metamorph":regexp,
"http://www.culturegraph.org/metamorph":replace,
"http://www.culturegraph.org/metamorph":substring,
"http://www.culturegraph.org/metamorph":lookup,
"http://www.culturegraph.org/metamorph":whitelist,
"http://www.culturegraph.org/metamorph":blacklist,
"http://www.culturegraph.org/metamorph":isbn,
"http://www.culturegraph.org/metamorph":equals,
"http://www.culturegraph.org/metamorph":not-equals,
"http://www.culturegraph.org/metamorph":case,
"http://www.culturegraph.org/metamorph":timestamp,
"http://www.culturegraph.org/metamorph":dateformat,
"http://www.culturegraph.org/metamorph":htmlanchor,
"http://www.culturegraph.org/metamorph":trim,
"http://www.culturegraph.org/metamorph":split,
"http://www.culturegraph.org/metamorph":normalize-utf8,
"http://www.culturegraph.org/metamorph":occurrence,
"http://www.culturegraph.org/metamorph":constant,
"http://www.culturegraph.org/metamorph":count,
"http://www.culturegraph.org/metamorph":urlencode,
"http://www.culturegraph.org/metamorph":buffer,
"http://www.culturegraph.org/metamorph":name,
"http://www.culturegraph.org/metamorph":switch-name-value,
"http://www.culturegraph.org/metamorph":unique,
"http://www.culturegraph.org/metamorph":script,
"http://www.culturegraph.org/metamorph":setreplace,
"http://www.culturegraph.org/metamorph":java}' is expected.
at
org.culturegraph.mf.util.xml.DomLoader$TransformerErrorHandler.handle(DomLoader.java:215)
at
org.culturegraph.mf.util.xml.DomLoader$TransformerErrorHandler.error(DomLoader.java:205)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.postErrorToListener(TransformerImpl.java:811)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:754)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:359)
at org.culturegraph.mf.util.xml.DomLoader.parse(DomLoader.java:113)
at
org.culturegraph.mf.morph.AbstractMetamorphDomWalker.walk(AbstractMetamorphDomWalker.java:109)
at
org.culturegraph.mf.morph.AbstractMetamorphDomWalker.walk(AbstractMetamorphDomWalker.java:105)
at org.culturegraph.mf.morph.Metamorph.<init>(Metamorph.java:163)
at org.culturegraph.mf.morph.Metamorph.<init>(Metamorph.java:108)
at org.culturegraph.mf.morph.Metamorph.<init>(Metamorph.java:98)
at org.culturegraph.mf.morph.Metamorph.<init>(Metamorph.java:94)
... 15 more
Caused by: javax.xml.transform.TransformerException: Error parsing xml:
cvc-complex-type.2.4.a: Invalid content was found starting with element
'itemLink'. One of '{"http://www.culturegraph.org/metamorph":compose,
"http://www.culturegraph.org/metamorph":regexp,
"http://www.culturegraph.org/metamorph":replace,
"http://www.culturegraph.org/metamorph":substring,
"http://www.culturegraph.org/metamorph":lookup,
"http://www.culturegraph.org/metamorph":whitelist,
"http://www.culturegraph.org/metamorph":blacklist,
"http://www.culturegraph.org/metamorph":isbn,
"http://www.culturegraph.org/metamorph":equals,
"http://www.culturegraph.org/metamorph":not-equals,
"http://www.culturegraph.org/metamorph":case,
"http://www.culturegraph.org/metamorph":timestamp,
"http://www.culturegraph.org/metamorph":dateformat,
"http://www.culturegraph.org/metamorph":htmlanchor,
"http://www.culturegraph.org/metamorph":trim,
"http://www.culturegraph.org/metamorph":split,
"http://www.culturegraph.org/metamorph":normalize-utf8,
"http://www.culturegraph.org/metamorph":occurrence,
"http://www.culturegraph.org/metamorph":constant,
"http://www.culturegraph.org/metamorph":count,
"http://www.culturegraph.org/metamorph":urlencode,
"http://www.culturegraph.org/metamorph":buffer,
"http://www.culturegraph.org/metamorph":name,
"http://www.culturegraph.org/metamorph":switch-name-value,
"http://www.culturegraph.org/metamorph":unique,
"http://www.culturegraph.org/metamorph":script,
"http://www.culturegraph.org/metamorph":setreplace,
"http://www.culturegraph.org/metamorph":java}' is expected.
... 25 more
At the moment I can't see a possibility to extend the metamorph.xsd in
my extensions without changing the original schema and compiling the
metafacture-core by my own.
Any suggestions?
Günter
--
UNIVERSITÄT BASEL
Universitätsbibliothek
Günter Hipler
Projekt swissbib
Schönbeinstrasse 18-20
4056 Basel, Schweiz
Tel.: +41 61 267 31 12
Fax: +41 61 267 31 03
E-Mail guenter.hipler at unibas.ch
URL www.swissbib.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.dnb.de/pipermail/metafacture/attachments/20150323/5ce23dc1/attachment.html
More information about the Metafacture
mailing list