Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Xcore][CDO] Annotations instead of GenModel
[Xcore][CDO] Annotations instead of GenModel [message #1689660] Mon, 23 March 2015 23:18 Go to next message
Eclipse UserFriend
Want to generate CDO client code from an Xcore. Instead of going through
the process of creating a GenModel, and manually editing it then
generating my code, it would instead be cleaner to just use annotations
for this.

Example xcore:

@GenModel(copyrightFields="true",
copyrightText="Copyright Verticon, Inc. 2015 All rights reserved.",
editDirectory="/com.verticon.enterprise.cm.edit/src-gen",
editorDirectory="/com.verticon.enterprise.cm.editor/src-gen",
testsDirectory="/com.verticon.enterprise.cm.tests/src-gen",
modelName="CM", prefix="CM",
testSuiteClass="com.verticon.cm.tests.CMAllTests",
runtimePlatform="RCP",
featureDelegation="Reflective",
modulePlugInVariables="CDO=org.eclipse.emf.cdo,org.eclipse.xtext.xbase.lib,org.eclipse.emf.ecore.xcore.lib",

rootExtendsClass="org.eclipse.emf.internal.cdo.CDOObjectImpl",
rootExtendsInterface="org.eclipse.emf.cdo.CDOObject"
)
package com.verticon.enterprise.cm

class Identity{
id String _id
String name

}


For the most part it works except for the modulePlugInVariables which
still only set the Module Plug-in Variables to:

org.eclipse.xtext.xbase.lib,org.eclipse.emf.ecore.xcore.lib

Have a hunch I am not setting that Module Plug-in Variables properly.
Anyone have a clue how I can do this in an annotation?

thanks for any help,
John
Re: [Xcore][CDO] Annotations instead of GenModel [message #1689731 is a reply to message #1689660] Tue, 24 March 2015 03:45 Go to previous messageGo to next message
Eclipse UserFriend
John,

It could be because this is a multi-valued string property and it might
be that this isn't properly handled. Then again, it could be that you
need space as a separator, not comma. Please open a bugzilla with a
small test case...


On 24/03/2015 4:18 AM, John E. Conlon wrote:
> Want to generate CDO client code from an Xcore. Instead of going
> through the process of creating a GenModel, and manually editing it
> then generating my code, it would instead be cleaner to just use
> annotations for this.
>
> Example xcore:
>
> @GenModel(copyrightFields="true",
> copyrightText="Copyright Verticon, Inc. 2015 All rights reserved.",
> editDirectory="/com.verticon.enterprise.cm.edit/src-gen",
> editorDirectory="/com.verticon.enterprise.cm.editor/src-gen",
> testsDirectory="/com.verticon.enterprise.cm.tests/src-gen",
> modelName="CM", prefix="CM",
> testSuiteClass="com.verticon.cm.tests.CMAllTests",
> runtimePlatform="RCP",
> featureDelegation="Reflective",
> modulePlugInVariables="CDO=org.eclipse.emf.cdo,org.eclipse.xtext.xbase.lib,org.eclipse.emf.ecore.xcore.lib",
>
> rootExtendsClass="org.eclipse.emf.internal.cdo.CDOObjectImpl",
> rootExtendsInterface="org.eclipse.emf.cdo.CDOObject"
> )
> package com.verticon.enterprise.cm
>
> class Identity{
> id String _id
> String name
>
> }
>
>
> For the most part it works except for the modulePlugInVariables which
> still only set the Module Plug-in Variables to:
>
> org.eclipse.xtext.xbase.lib,org.eclipse.emf.ecore.xcore.lib
>
> Have a hunch I am not setting that Module Plug-in Variables properly.
> Anyone have a clue how I can do this in an annotation?
>
> thanks for any help,
> John
Re: [Xcore][CDO] Annotations instead of GenModel [message #1689929 is a reply to message #1689731] Tue, 24 March 2015 12:57 Go to previous messageGo to next message
Eclipse UserFriend
Ed,

I will experiment some more with your suggestion, but I still have some
questions:

1. Do I have the name of the property correct?
The GenModel UI calls it:
Module Plug-in Variables
and for the annotation I call it:
modulePlugInVariables
I could not use a dash character in the annotation so I just left it
out. That does not seem right though...

2. Can I mix plugin IDs and Java ClassPath values in this multi-valued
string property?
From EMF Second Edition p 353: 'Optionally, when not developing a
plug-in... it is possible to define Java Classpath variables...'
It's that 'Optionally when not' phrase that concerns me.

3. Why does CDO use the CDO=org.eclipse.emf.cdo Java Classpath variable
instead of a plug-in ID? After all I am developing a plugin.

thanks for any clarity,
John

On 03/24/2015 02:45 AM, Ed Merks wrote:
> John,
>
> It could be because this is a multi-valued string property and it might
> be that this isn't properly handled. Then again, it could be that you
> need space as a separator, not comma. Please open a bugzilla with a
> small test case...
>
>
> On 24/03/2015 4:18 AM, John E. Conlon wrote:
>> Want to generate CDO client code from an Xcore. Instead of going
>> through the process of creating a GenModel, and manually editing it
>> then generating my code, it would instead be cleaner to just use
>> annotations for this.
>>
>> Example xcore:
>>
>> @GenModel(copyrightFields="true",
>> copyrightText="Copyright Verticon, Inc. 2015 All rights reserved.",
>> editDirectory="/com.verticon.enterprise.cm.edit/src-gen",
>> editorDirectory="/com.verticon.enterprise.cm.editor/src-gen",
>> testsDirectory="/com.verticon.enterprise.cm.tests/src-gen",
>> modelName="CM", prefix="CM",
>> testSuiteClass="com.verticon.cm.tests.CMAllTests",
>> runtimePlatform="RCP",
>> featureDelegation="Reflective",
>> modulePlugInVariables="CDO=org.eclipse.emf.cdo,org.eclipse.xtext.xbase.lib,org.eclipse.emf.ecore.xcore.lib",
>>
>> rootExtendsClass="org.eclipse.emf.internal.cdo.CDOObjectImpl",
>> rootExtendsInterface="org.eclipse.emf.cdo.CDOObject"
>> )
>> package com.verticon.enterprise.cm
>>
>> class Identity{
>> id String _id
>> String name
>>
>> }
>>
>>
>> For the most part it works except for the modulePlugInVariables which
>> still only set the Module Plug-in Variables to:
>>
>> org.eclipse.xtext.xbase.lib,org.eclipse.emf.ecore.xcore.lib
>>
>> Have a hunch I am not setting that Module Plug-in Variables properly.
>> Anyone have a clue how I can do this in an annotation?
>>
>> thanks for any help,
>> John
>
Re: [Xcore][CDO] Annotations instead of GenModel [message #1689946 is a reply to message #1689929] Tue, 24 March 2015 13:51 Go to previous message
Eclipse UserFriend
John,

Comments below.

On 24/03/2015 5:57 PM, John E. Conlon wrote:
> Ed,
>
> I will experiment some more with your suggestion, but I still have
> some questions:
>
> 1. Do I have the name of the property correct?
> The GenModel UI calls it:
> Module Plug-in Variables
> and for the annotation I call it:
> modulePlugInVariables
> I could not use a dash character in the annotation so I just left it
> out. That does not seem right though...
It should be the actual feature names modelPluginVariables. Aren't you
setting these using the properties view? Or maybe that doesn't work for
this one either...
>
> 2. Can I mix plugin IDs and Java ClassPath values in this multi-valued
> string property?
> From EMF Second Edition p 353: 'Optionally, when not developing a
> plug-in... it is possible to define Java Classpath variables...'
> It's that 'Optionally when not' phrase that concerns me.
>
> 3. Why does CDO use the CDO=org.eclipse.emf.cdo Java Classpath
> variable instead of a plug-in ID? After all I am developing a plugin.
The thing before the = is just a name that might be used as a variable,
but I don't think any of those non-plugin things work anymore...
>
> thanks for any clarity,
> John
>
> On 03/24/2015 02:45 AM, Ed Merks wrote:
>> John,
>>
>> It could be because this is a multi-valued string property and it might
>> be that this isn't properly handled. Then again, it could be that you
>> need space as a separator, not comma. Please open a bugzilla with a
>> small test case...
>>
>>
>> On 24/03/2015 4:18 AM, John E. Conlon wrote:
>>> Want to generate CDO client code from an Xcore. Instead of going
>>> through the process of creating a GenModel, and manually editing it
>>> then generating my code, it would instead be cleaner to just use
>>> annotations for this.
>>>
>>> Example xcore:
>>>
>>> @GenModel(copyrightFields="true",
>>> copyrightText="Copyright Verticon, Inc. 2015 All rights reserved.",
>>> editDirectory="/com.verticon.enterprise.cm.edit/src-gen",
>>> editorDirectory="/com.verticon.enterprise.cm.editor/src-gen",
>>> testsDirectory="/com.verticon.enterprise.cm.tests/src-gen",
>>> modelName="CM", prefix="CM",
>>> testSuiteClass="com.verticon.cm.tests.CMAllTests",
>>> runtimePlatform="RCP",
>>> featureDelegation="Reflective",
>>> modulePlugInVariables="CDO=org.eclipse.emf.cdo,org.eclipse.xtext.xbase.lib,org.eclipse.emf.ecore.xcore.lib",
>>>
>>>
>>> rootExtendsClass="org.eclipse.emf.internal.cdo.CDOObjectImpl",
>>> rootExtendsInterface="org.eclipse.emf.cdo.CDOObject"
>>> )
>>> package com.verticon.enterprise.cm
>>>
>>> class Identity{
>>> id String _id
>>> String name
>>>
>>> }
>>>
>>>
>>> For the most part it works except for the modulePlugInVariables which
>>> still only set the Module Plug-in Variables to:
>>>
>>> org.eclipse.xtext.xbase.lib,org.eclipse.emf.ecore.xcore.lib
>>>
>>> Have a hunch I am not setting that Module Plug-in Variables properly.
>>> Anyone have a clue how I can do this in an annotation?
>>>
>>> thanks for any help,
>>> John
>>
>
Previous Topic:EMFStore vs. CDO
Next Topic:[EMFForms] Error in creating viewmodel
Goto Forum:
  


Current Time: Fri Jul 18 17:04:40 EDT 2025

Powered by FUDForum. Page generated in 0.04321 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top