Re: initiating CpeComponentDescriptor from String or InputStream

2016-09-09 Thread Chen Xiaobin
Thanks, Richard!

That's also the solution I can think of: getting the descriptor contents
from the database and save them as temp files. Then use those temp files to
initiate the cas processors.

Best,
Xiaobin

On Fri, Sep 9, 2016 at 5:28 PM, Richard Eckart de Castilho 
wrote:

> Afaik there is no such thing. That is why the uimaFIT CpeBuilder
> stores programmatically created engine descriptors in temporary
> files.
>
> Cheers,
>
> -- Richard
>
> > On 09.09.2016, at 17:15, Chen Xiaobin  wrote:
> >
> > Hi,
> > I am wondering if there is a way to initiate a CpeComponentDescriptor
> from
> > an InputStream or a String, instead of from a physical descriptor file.
> > I am using the following code originally:
> >
> >CpeCasProcessor casProcessor = CpeDescriptorFactory.
> > produceCasProcessor(ae.getName());
> >CpeComponentDescriptor componentDescriptor = CpeDescriptorFactory.
> > produceComponentDescriptor("path/to/aeDescriptor.xml");
> >casProcessor.setCpeComponentDescriptor(componentDescriptor);
> >cpeDescription.addCasProcessor(casProcessor);
> >
> > But now in my application, all AE descriptors are stored in a database as
> > Strings. I need to construct a CPE and add some AEs to the CPE.
> >
> > Is there a way to substitute the second line of the above code to
> something
> > like:
> > CpeComponentDescriptor componentDescriptor =
> > CpeDescriptorFactory.produceComponentDescriptor(**
> descriptorFromAnInputStream
> > or String**);
> > The UIMA API does not provide such a method in the CpeDescriptorFactor.
> >
> > Thank you!
> >
> > Xiaobin
> > --
> > --
> > Eberhard Karls Universität Tübingen
> > LEAD Graduate School
> > Doctoral Candidate
> > Gartenstraße 29A · 72074 Tübingen · Germany
> > Phone +49 1765 7634 683
>
>


-- 
Xiaobin Chen
LEAD Graduate School & Research Network
Gartenstr. 29A, 72076 Tübingen


initiating CpeComponentDescriptor from String or InputStream

2016-09-09 Thread Chen Xiaobin
Hi,
I am wondering if there is a way to initiate a CpeComponentDescriptor from
an InputStream or a String, instead of from a physical descriptor file.
I am using the following code originally:

CpeCasProcessor casProcessor = CpeDescriptorFactory.
produceCasProcessor(ae.getName());
CpeComponentDescriptor componentDescriptor = CpeDescriptorFactory.
produceComponentDescriptor("path/to/aeDescriptor.xml");
casProcessor.setCpeComponentDescriptor(componentDescriptor);
cpeDescription.addCasProcessor(casProcessor);

But now in my application, all AE descriptors are stored in a database as
Strings. I need to construct a CPE and add some AEs to the CPE.

Is there a way to substitute the second line of the above code to something
like:
 CpeComponentDescriptor componentDescriptor =
CpeDescriptorFactory.produceComponentDescriptor(**descriptorFromAnInputStream
or String**);
The UIMA API does not provide such a method in the CpeDescriptorFactor.

Thank you!

Xiaobin
-- 
-- 
Eberhard Karls Universität Tübingen
LEAD Graduate School
Doctoral Candidate
Gartenstraße 29A · 72074 Tübingen · Germany
Phone +49 1765 7634 683