Re: [UIMA 3.0] Maven Support

2016-11-27 Thread Pablo Duboue
Yes, that's why I felt custom subclasses could be a good compromise:

JCasGen handled by Maven, user customizations as subclasses that are kept
under version control.

On Wed, Nov 23, 2016 at 10:24 AM, Marshall Schor  wrote:

> good point...
>
> -Marshall
>
>
> On 11/23/2016 8:35 AM, Richard Eckart de Castilho wrote:
> > On 22.11.2016, at 21:33, Marshall Schor  wrote:
> >> Yes, I believe that is correct - the Maven plugin does not support
> "merging"
> >> with already generated customized JCasGen cover classes.
> >>
> >> If that was a requirement, I suspect (with some work, and dependencies
> such as
> >> you need to have an Eclipse installation...) it could be added.
> > I don't think that fits in well with a Maven-based build, does it?
> > I mean, customized code would be under version control. If JCasGen
> > would run over that and update it, then the code would always be
> > dirty... Using JCasGen in a Maven build for customized classes would
> > require a strategy to somehow separate the generated code and the
> > customized aspects, such that the first is under version control
> > but not that latter.
> >
> > Cheers,
> >
> > -- Richard
>
>


Re: [UIMA 3.0] Maven Support

2016-11-23 Thread Marshall Schor
good point... 

-Marshall


On 11/23/2016 8:35 AM, Richard Eckart de Castilho wrote:
> On 22.11.2016, at 21:33, Marshall Schor  wrote:
>> Yes, I believe that is correct - the Maven plugin does not support "merging"
>> with already generated customized JCasGen cover classes.
>>
>> If that was a requirement, I suspect (with some work, and dependencies such 
>> as
>> you need to have an Eclipse installation...) it could be added.
> I don't think that fits in well with a Maven-based build, does it?
> I mean, customized code would be under version control. If JCasGen
> would run over that and update it, then the code would always be 
> dirty... Using JCasGen in a Maven build for customized classes would
> require a strategy to somehow separate the generated code and the
> customized aspects, such that the first is under version control
> but not that latter.
>
> Cheers,
>
> -- Richard



Re: [UIMA 3.0] Maven Support

2016-11-23 Thread Richard Eckart de Castilho
On 22.11.2016, at 21:33, Marshall Schor  wrote:
> 
> Yes, I believe that is correct - the Maven plugin does not support "merging"
> with already generated customized JCasGen cover classes.
> 
> If that was a requirement, I suspect (with some work, and dependencies such as
> you need to have an Eclipse installation...) it could be added.

I don't think that fits in well with a Maven-based build, does it?
I mean, customized code would be under version control. If JCasGen
would run over that and update it, then the code would always be 
dirty... Using JCasGen in a Maven build for customized classes would
require a strategy to somehow separate the generated code and the
customized aspects, such that the first is under version control
but not that latter.

Cheers,

-- Richard

Re: [UIMA 3.0] Maven Support

2016-11-22 Thread Marshall Schor
Yes, I believe that is correct - the Maven plugin does not support "merging"
with already generated customized JCasGen cover classes.

If that was a requirement, I suspect (with some work, and dependencies such as
you need to have an Eclipse installation...) it could be added.

-Marshall


On 11/22/2016 3:13 AM, Peter Klügl wrote:
> Hi,
>
>
> I think there is a problem with customized JCasGen cover classes. The
> maven plugin does not support it but just generates new classes.
>
>
> Best,
>
>
> Peter
>
>
> Am 21.11.2016 um 22:27 schrieb Marshall Schor:
>> On 11/19/2016 1:10 PM, Pablo Duboue wrote:
>>> Can we support generated classes being handled by maven while the user
>>> provides custom subclasses?
>> We currently have a maven plugin that runs JCasGen, so, yes, I think this is
>> possible, even now.
>> -Marshall
>>> At least we should support realizing there are custom files in src and
>>> modify them there rather than generated-sources.
>>>
>>> Rationale:
>>>
>>> JCasGen output is big and computer generated. Without customization,
>>> what I have seen is to exclude those files from src/ and use the maven
>>> plugin to generate them. The new framework makes customization much
>>> more appealing, can we keep as much of the automatic generation
>>> process within maven?
>>>
>>> This thread can be a good place for maven discussion in general, too.
>>>
>



Re: [UIMA 3.0] Maven Support

2016-11-22 Thread Marshall Schor
I was making some incorrect assumptions.

I was assuming that the parent JCasGen'd class would correspond to a UIMA type,
and the subclass would be something that extended that but didn't add any
features, or needed to get registered, etc.

The only reason to register it would be to have non-JCas creation APIs create
instances of the subclass, rather than the other class.

I was assuming that was not the case; that the user was using JCas to create
instances. 

But because there's lots of things that could create instances, other than user
JCas code using the subclass, you would need a trick like Richard's suggestion. 
I haven't tried this, and it's quite possible that this might or might not work 
...

-Marshall

On 11/22/2016 2:31 AM, Richard Eckart de Castilho wrote:
> On 21.11.2016, at 23:12, Marshall Schor  wrote:
>> there's plenty of denseness to go around :-)  I think this ought to work in 
>> v2
>> as well?  Can you say a scenario where it wouldn't?
> In V2, one would at least have to manually implement the typeIndexID+friends 
> in the subclass, right:
>
>   /** @generated
>* @ordered 
>*/
>   @SuppressWarnings ("hiding")
>   public final static int typeIndexID = 
> JCasRegistry.register(NamedEntity.class);
>   /** @generated
>* @ordered 
>*/
>   @SuppressWarnings ("hiding")
>   public final static int type = typeIndexID;
>   /** @generated
>* @return index of the type  
>*/
>   @Override
>   public  int getTypeIndexID() {return typeIndexID;}
>
>
> Cheers,
>
> -- Richard 



Re: [UIMA 3.0] Maven Support

2016-11-22 Thread Peter Klügl
Hi,


I think there is a problem with customized JCasGen cover classes. The
maven plugin does not support it but just generates new classes.


Best,


Peter


Am 21.11.2016 um 22:27 schrieb Marshall Schor:
> On 11/19/2016 1:10 PM, Pablo Duboue wrote:
>> Can we support generated classes being handled by maven while the user
>> provides custom subclasses?
> We currently have a maven plugin that runs JCasGen, so, yes, I think this is
> possible, even now.
> -Marshall
>> At least we should support realizing there are custom files in src and
>> modify them there rather than generated-sources.
>>
>> Rationale:
>>
>> JCasGen output is big and computer generated. Without customization,
>> what I have seen is to exclude those files from src/ and use the maven
>> plugin to generate them. The new framework makes customization much
>> more appealing, can we keep as much of the automatic generation
>> process within maven?
>>
>> This thread can be a good place for maven discussion in general, too.
>>



Re: [UIMA 3.0] Maven Support

2016-11-21 Thread Richard Eckart de Castilho
On 21.11.2016, at 23:12, Marshall Schor  wrote:
> 
> there's plenty of denseness to go around :-)  I think this ought to work in v2
> as well?  Can you say a scenario where it wouldn't?

In V2, one would at least have to manually implement the typeIndexID+friends in 
the subclass, right:

  /** @generated
   * @ordered 
   */
  @SuppressWarnings ("hiding")
  public final static int typeIndexID = 
JCasRegistry.register(NamedEntity.class);
  /** @generated
   * @ordered 
   */
  @SuppressWarnings ("hiding")
  public final static int type = typeIndexID;
  /** @generated
   * @return index of the type  
   */
  @Override
  public  int getTypeIndexID() {return typeIndexID;}


Cheers,

-- Richard 

Re: [UIMA 3.0] Maven Support

2016-11-21 Thread Pablo Duboue
My recollection is that JCasGen tend to make things private and final,
but I haven't looked at the generated classes in a while (by virtue of
keeping them in generated-sources).

P

On Mon, Nov 21, 2016 at 5:12 PM, Marshall Schor  wrote:
> there's plenty of denseness to go around :-)  I think this ought to work in v2
> as well?  Can you say a scenario where it wouldn't?
>
> -Marshall
>
>
> On 11/21/2016 4:49 PM, Richard Eckart de Castilho wrote:
>> Sorry, probably I'm being dense ;) So for V2, I'm pretty sure that this
>> didn't "just work", but I gather you say that for V3, this really does
>> work?
>>
>> Cheers,
>>
>> -- Richard
>>
>>> On 21.11.2016, at 22:46, Marshall Schor  wrote:
>>>
>>> I'm probably being dense, but I'm not sure why it wouldn't just work:
>>>
>>> Foo : a JCas gen'd class
>>>
>>> SubFoo extends Foo - the subclass
>>>
>>> new SubFoo(jcas)  would create a new feature structure, assuming the 
>>> constructor
>>> called its superconstructor (as is normally the case).
>>>
>>> mySubFooInstance.getFeatureXyz()  - this would be implemented in the super
>>> class, and work fine, I think, as would the setters...
>>>
>>> -Marshall
>>
>


Re: [UIMA 3.0] Maven Support

2016-11-21 Thread Marshall Schor
there's plenty of denseness to go around :-)  I think this ought to work in v2
as well?  Can you say a scenario where it wouldn't?

-Marshall


On 11/21/2016 4:49 PM, Richard Eckart de Castilho wrote:
> Sorry, probably I'm being dense ;) So for V2, I'm pretty sure that this
> didn't "just work", but I gather you say that for V3, this really does
> work?
>
> Cheers,
>
> -- Richard
>
>> On 21.11.2016, at 22:46, Marshall Schor  wrote:
>>
>> I'm probably being dense, but I'm not sure why it wouldn't just work:
>>
>> Foo : a JCas gen'd class
>>
>> SubFoo extends Foo - the subclass
>>
>> new SubFoo(jcas)  would create a new feature structure, assuming the 
>> constructor
>> called its superconstructor (as is normally the case).
>>
>> mySubFooInstance.getFeatureXyz()  - this would be implemented in the super
>> class, and work fine, I think, as would the setters...
>>
>> -Marshall
>



Re: [UIMA 3.0] Maven Support

2016-11-21 Thread Richard Eckart de Castilho
Sorry, probably I'm being dense ;) So for V2, I'm pretty sure that this
didn't "just work", but I gather you say that for V3, this really does
work?

Cheers,

-- Richard

> On 21.11.2016, at 22:46, Marshall Schor  wrote:
> 
> I'm probably being dense, but I'm not sure why it wouldn't just work:
> 
> Foo : a JCas gen'd class
> 
> SubFoo extends Foo - the subclass
> 
> new SubFoo(jcas)  would create a new feature structure, assuming the 
> constructor
> called its superconstructor (as is normally the case).
> 
> mySubFooInstance.getFeatureXyz()  - this would be implemented in the super
> class, and work fine, I think, as would the setters...
> 
> -Marshall



Re: [UIMA 3.0] Maven Support

2016-11-21 Thread Marshall Schor
I'm probably being dense, but I'm not sure why it wouldn't just work:

Foo : a JCas gen'd class

SubFoo extends Foo - the subclass

new SubFoo(jcas)  would create a new feature structure, assuming the constructor
called its superconstructor (as is normally the case).

mySubFooInstance.getFeatureXyz()  - this would be implemented in the super
class, and work fine, I think, as would the setters...

-Marshall

On 11/21/2016 4:35 PM, Richard Eckart de Castilho wrote:
> On 21.11.2016, at 22:27, Marshall Schor  wrote:
>> On 11/19/2016 1:10 PM, Pablo Duboue wrote:
>>> Can we support generated classes being handled by maven while the user
>>> provides custom subclasses?
>> We currently have a maven plugin that runs JCasGen, so, yes, I think this is
>> possible, even now.
> I presently can't imagine a user to manually create subclasses of JCas cover 
> classes.
> If I simple manually create a subclass e.g. of the built-in Annotation class 
> (doesn't
> even need to be JCasGen-generated), the JCas couldn't pretty much do anything 
> with
> it, could it? I'd have to add several adornments and decorations for JCas to 
> be able
> to make sense of this new class, right?
>
> Best,
>
> -- Richard



Re: [UIMA 3.0] Maven Support

2016-11-21 Thread Richard Eckart de Castilho
On 21.11.2016, at 22:27, Marshall Schor  wrote:
> 
> On 11/19/2016 1:10 PM, Pablo Duboue wrote:
>> Can we support generated classes being handled by maven while the user
>> provides custom subclasses?
> We currently have a maven plugin that runs JCasGen, so, yes, I think this is
> possible, even now.

I presently can't imagine a user to manually create subclasses of JCas cover 
classes.
If I simple manually create a subclass e.g. of the built-in Annotation class 
(doesn't
even need to be JCasGen-generated), the JCas couldn't pretty much do anything 
with
it, could it? I'd have to add several adornments and decorations for JCas to be 
able
to make sense of this new class, right?

Best,

-- Richard

Re: [UIMA 3.0] Maven Support

2016-11-21 Thread Marshall Schor
On 11/19/2016 1:10 PM, Pablo Duboue wrote:
> Can we support generated classes being handled by maven while the user
> provides custom subclasses?
We currently have a maven plugin that runs JCasGen, so, yes, I think this is
possible, even now.
-Marshall
> At least we should support realizing there are custom files in src and
> modify them there rather than generated-sources.
>
> Rationale:
>
> JCasGen output is big and computer generated. Without customization,
> what I have seen is to exclude those files from src/ and use the maven
> plugin to generate them. The new framework makes customization much
> more appealing, can we keep as much of the automatic generation
> process within maven?
>
> This thread can be a good place for maven discussion in general, too.
>