I just did a quick test:
1) as far as I can tell, UIMA provides no alternative to using a CustomResourceSpecifier for "Resource"s
2) other types can in fact be passed to "SharedResourceObject" implementations. If you just ignore the "load" method and pass no URL or some dummy URL in createExternalResourceDescription() you might get along with that.
I believe to make 1) work, the UIMA core framework needs to be changed.
-- Richard
> Hi Martin,
> for external resources that are derived from "Resource", we currently use a "CustomResourceSpecifier" which supports only Strings. You could try using a shared resource that implements "SharedResourceObject". For those we use a "ConfigurableDataResourceSpecifier" which (I think) supports the usual types. Needs to be tested.
> It is possible that alternative implementations of the respective uimaFIT methods are possible which would support the usual types also on normal resources implementing "Resource", but that would require a bit of research. Feel free to report this as an issue/feature request on the Apache Jira.
> Cheers,
> -- Richard
> Am 12.02.2013 um 18:12 schrieb Martin Toepfer <martin.toep...@uni-wuerzburg.de>:
>> Hi,
>> I have a class that extends Resource_ImplBase and has a configuration parameter:
>> @ConfigurationParameter(name = PARAM_ANNOTYPENAMES)
>> private String[] annotationTypeNames
>> When I try to create a description for it:
>> String[] ftypes = new String[] {
>> "org.apache.uima.textmarker.type.html.B",
>> "org.apache.uima.textmarker.type.html.U",
>> "org.apache.uima.textmarker.type.html.I" };
>> ExternalResourceDescription attX = ExternalResourceFactory
>> .createExternalResourceDescription(AnnotationBasedFCAAttributeExtractor.class,
>> AnnotationBasedFCAAttributeExtractor.PARAM_ANNOTYPENAMES, ftypes);
>> I get
>> Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String
>> at org.uimafit.factory.ExternalResourceFactory.
>> org.uimafit.factory.ExternalResourceFactory.createExternalResourceDescription(ExternalResourceFactory.java:140)
>> at org.uimafit.factory.ExternalResourceFactory.createExternalResourceDescription(ExternalResourceFactory.java:103)
>> at de.uniwue.medstat.control.Runner4FcaAERunner.main(Runner4FcaAERunner.java:73)
>> Am I doing something wrong?
>> Thanks in advance!
>> Cheers,
>> Martin
MSc. Martin Toepfer Raum: B008 Universität Würzburg Tel.: +49-(0)931-31-81856 Am Hubland Fax.: - 97074 Würzburg mail: martin....@uni-wuerzburg.de http://www.is.informatik.uni-wuerzburg.de/mitarbeiter/toepfer/