proper matcher syntax? [message #647113] |
Tue, 04 January 2011 16:25 |
Eric Gwin Messages: 10 Registered: July 2009 |
Junior Member |
|
|
I've got a base URL that points to a directory that contains OSGi bundles and jars my project needs to compile. I'm having difficulty writing a URL reader rule that works.
If I use a static URI format, I can use buckminster.component to get part of the filename, but cannot find a way to represent the rest of the filename.
Using a matcher as outlined in the manual is giving me:
What is the ERROR [0001] : org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'rm:matcher'. One of '{"http://www.eclipse.org/buckminster/RMap-1.0":property, "http://www.eclipse.org/buckminster/RMap-1.0":propertyElement, "http://www.eclipse.org/buckminster/RMap-1.0":documentation, "http://www.eclipse.org/buckminster/RMap-1.0":digest, "http://www.eclipse.org/buckminster/RMap-1.0":versionConverter}' is expected.: http://download.eclipse.org/rt/eclipselink/bucktest/eclipselink.rmap at line: 16 column: 97
Errors and Warnings
E [0001] : org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'rm:matcher'. One of '{"http://www.eclipse.org/buckminster/RMap-1.0":property, "http://www.eclipse.org/buckminster/RMap-1.0":propertyElement, "http://www.eclipse.org/buckminster/RMap-1.0":documentation, "http://www.eclipse.org/buckminster/RMap-1.0":digest, "http://www.eclipse.org/buckminster/RMap-1.0":versionConverter}' is expected.: http://download.eclipse.org/rt/eclipselink/bucktest/eclipselink.rmap at line: 16 column: 97: cvc-complex-type.2.4.a: Invalid content was found starting with element 'rm:matcher'. One of '{"http://www.eclipse.org/buckminster/RMap-1.0":property, "http://www.eclipse.org/buckminster/RMap-1.0":propertyElement, "http://www.eclipse.org/buckminster/RMap-1.0":documentation, "http://www.eclipse.org/buckminster/RMap-1.0":digest, "http://www.eclipse.org/buckminster/RMap-1.0":versionConverter}' is expected.
On the assumtion that I need a property, propertyElement, documentation, or versionConverter sibling defined, I added a versionConverter sibling. It generates:
ERROR [0001] : org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'rm:versionConverter'. One of '{"http://www.eclipse.org/buckminster/RMap-1.0":matcher, "http://www.eclipse.org/buckminster/RMap-1.0":uri}' is expected.: http://download.eclipse.org/rt/eclipselink/bucktest/eclipselink.rmap at line: 15 column: 37
Errors and Warnings
E [0001] : org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'rm:versionConverter'. One of '{"http://www.eclipse.org/buckminster/RMap-1.0":matcher, "http://www.eclipse.org/buckminster/RMap-1.0":uri}' is expected.: http://download.eclipse.org/rt/eclipselink/bucktest/eclipselink.rmap at line: 15 column: 37: cvc-complex-type.2.4.a: Invalid content was found starting with element 'rm:versionConverter'. One of '{"http://www.eclipse.org/buckminster/RMap-1.0":matcher, "http://www.eclipse.org/buckminster/RMap-1.0":uri}' is expected.
I must be missing something basic (and probably obvious) but I'm at a lost how to proceed. Buckminster is not yet even complaining about the probably ridiculously malformed values I've got inserted.
Provider section of rmap is below:
<rm:provider componentTypes="osgi.bundle,jar" readerType="url" source="false" mutable="false" resolutionFilter="">
<rm:versionConverter type=""/>
<rm:uri format="${matchedURL}"/>
<rm:matcher base="http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/bmpc/plugins">
<rm:match name="matchedURL" pattern="[a-zA-Z0-9_\.\-]+" prefix="http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/bmpc/plugins/"/>
<rm:name name="" pattern="${buckminster.component}_[a-zA-Z0-9_\.\-]+" prefix="http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/bmpc/plugins"/>
</rm:matcher>
</rm:provider>
Any help would be appreciated.
P.S. The manual is very helpful, but more examples are needed.
-Eric
|
|
|
|
Re: proper matcher syntax? [message #647297 is a reply to message #647186] |
Wed, 05 January 2011 15:38 |
Eric Gwin Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Thanks Alan! Just as you said, moving the URI after the matcher removed the syntax errors. It seems like a bug to me as well, since it was the editor that put them in the original order. I'm just not certain where the bug lies, in matcher code, or in the editor.
Can anyone confirm that
a) there is a bug here?
b) whether it has been filed?
My matcher is still not working however, and I'm running into a conceptual block again as far as the matcher section of the bucky book is concerned (pgs 45-46).
Either the URL reader needs a single URL that specifically points to a single jar, and the metadata extracting elements are only used to parse details about the jar from the URL string (ie. you need a reader specific to every jar/URL you may need) - this seems wrong, but is how I'm interpreting the manual, or
the URL reader can magikly parse through multiple URLs - this is also unlikely, given the errors below:
ERROR [0001] : java.lang.IllegalArgumentException: can't parse argument number matchedURL
Errors and Warnings
E [0001] : java.lang.IllegalArgumentException: can't parse argument number matchedURL: can't parse argument number matchedURL
When the rmap reader looks like:
<rm:provider componentTypes="osgi.bundle" readerType="url" source="false" mutable="false">
<rm:matcher base="http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/bmpc/plugins">
<rm:match name="matchedURL" pattern="(.+)?"/>
</rm:matcher>
<rm:uri format="${matchedURL}"/>
</rm:provider>
or the URL reader needs a single URL that will match the component requirements, and the metadata extracting elements act both to set metadata, and to select a single URL. However, without a way to link the component name and version range being searched for with the regular expression matching I'm led back to conclusion 1 that a URL reader is needed for every possible URL based component because I cannot seem to use property substitution in name children of the matcher.
can anyone post an example of a matcher that works?
Thanks.
-Eric
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05202 seconds