Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ModelWizard
ModelWizard [message #421933] Mon, 18 August 2008 19:04 Go to next message
exquisitus is currently offline exquisitusFriend
Messages: 211
Registered: July 2009
Senior Member
Hi

I set in genmodel->All->Prefix to XML so that the ResourceSet use XML.
Don´t know if thats bad? Works fine. If i use the standard genmodel
genmodel->All->Prefix=Model and try to create a XML-File with the Wizard
the head of the XML-File is wrong or i want the other head.

genmodel->All->Prefix=XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE build SYSTEM "build.dtd">
<model:Build xmlns:model="http://model.example">


genmodel->All->Prefix=Model
<?xml version="1.0" encoding="UTF-8"?>
<model:DocumentRoot xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:model="http://model.example">
<build/>
</model:DocumentRoot>

what do i have to change in the Wizard that it create XML-Files
Re: ModelWizard [message #421935 is a reply to message #421933] Mon, 18 August 2008 19:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Hi,

Comments below.

exquisitus wrote:
> Hi
>
> I set in genmodel->All->Prefix to XML so that the ResourceSet use XML.
This prefix is used for things like the XyzPackage, XyzFactory,
XyzSwitch. Typically it should represent an upper case name that
clearly denotes your specific model and will generally make those API
names unique with respect to others that might be used along with it.
> Don´t know if thats bad? Works fine. If i use the standard genmodel
> genmodel->All->Prefix=Model and try to create a XML-File with the Wizard
> the head of the XML-File is wrong or i want the other head.
In EMF 2.4 there is a separate setting "File Extensions" property that
you can set independently of the model prefix. You'd want to set this
to "xml" and make your Prefix be something better; model is not
descriptive in my opinion. Prior to EMF 2.3, you'd fiddle with the
plugin registrations and the plugin.properties to change the values for
these things things to be "xml".
>
> genmodel->All->Prefix=XML
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE build SYSTEM "build.dtd">
> <model:Build xmlns:model="http://model.example">
>
>
> genmodel->All->Prefix=Model
> <?xml version="1.0" encoding="UTF-8"?>
> <model:DocumentRoot xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI" xmlns:model="http://model.example">
> <build/>
> </model:DocumentRoot>
>
> what do i have to change in the Wizard that it create XML-Files
If you use the xml extension, I'd strongly recommend that you make use
of "Content Type Identifier" as well so that all the resource factory
and editor registrations are based on content type (will look at the
namespace in the *.xml file) not just on extension.

Also keep in mind that plugin.xml does not regenerate, nor do the values
of plugin.properties files change once generated; that's what allows
them to be changed arbitrarily. So if you change your GenModel, and you
will want to, you need to delete these files and regenerate them from
scratch.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ModelWizard [message #421939 is a reply to message #421935] Mon, 18 August 2008 20:24 Go to previous messageGo to next message
exquisitus is currently offline exquisitusFriend
Messages: 211
Registered: July 2009
Senior Member
Ed Merks schrieb:
> Hi,
>
> Comments below.
>
> exquisitus wrote:
>> Hi
>>
>> I set in genmodel->All->Prefix to XML so that the ResourceSet use XML.
> This prefix is used for things like the XyzPackage, XyzFactory,
> XyzSwitch. Typically it should represent an upper case name that
> clearly denotes your specific model and will generally make those API
> names unique with respect to others that might be used along with it.
>> Don´t know if thats bad? Works fine. If i use the standard genmodel
>> genmodel->All->Prefix=Model and try to create a XML-File with the Wizard
>> the head of the XML-File is wrong or i want the other head.
> In EMF 2.4 there is a separate setting "File Extensions" property that
> you can set independently of the model prefix. You'd want to set this
> to "xml" and make your Prefix be something better; model is not
> descriptive in my opinion. Prior to EMF 2.3, you'd fiddle with the
> plugin registrations and the plugin.properties to change the values for
> these things things to be "xml".
>>
>> genmodel->All->Prefix=XML
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE build SYSTEM "build.dtd">
>> <model:Build xmlns:model="http://model.example">
>>
>>
>> genmodel->All->Prefix=Model
>> <?xml version="1.0" encoding="UTF-8"?>
>> <model:DocumentRoot xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI" xmlns:model="http://model.example">
>> <build/>
>> </model:DocumentRoot>
>>
>> what do i have to change in the Wizard that it create XML-Files
> If you use the xml extension, I'd strongly recommend that you make use
> of "Content Type Identifier" as well so that all the resource factory
> and editor registrations are based on content type (will look at the
> namespace in the *.xml file) not just on extension.
>
> Also keep in mind that plugin.xml does not regenerate, nor do the values
> of plugin.properties files change once generated; that's what allows
> them to be changed arbitrarily. So if you change your GenModel, and you
> will want to, you need to delete these files and regenerate them from
> scratch.

Thanks a lot. But how can i change the namespace. Cant find the
namespace in the Properties of the genmodel.
Re: ModelWizard [message #421941 is a reply to message #421939] Mon, 18 August 2008 21:33 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
How much of t what I told you did you do? If you're still seeing XMI
and a document root then you haven't specified XML as your resource type
or done the other things...


exquisitus wrote:
> Ed Merks schrieb:
>> Hi,
>>
>> Comments below.
>>
>> exquisitus wrote:
>>> Hi
>>>
>>> I set in genmodel->All->Prefix to XML so that the ResourceSet use XML.
>> This prefix is used for things like the XyzPackage, XyzFactory,
>> XyzSwitch. Typically it should represent an upper case name that
>> clearly denotes your specific model and will generally make those API
>> names unique with respect to others that might be used along with it.
>>> Don´t know if thats bad? Works fine. If i use the standard genmodel
>>> genmodel->All->Prefix=Model and try to create a XML-File with the
>>> Wizard
>>> the head of the XML-File is wrong or i want the other head.
>> In EMF 2.4 there is a separate setting "File Extensions" property
>> that you can set independently of the model prefix. You'd want to
>> set this to "xml" and make your Prefix be something better; model is
>> not descriptive in my opinion. Prior to EMF 2.3, you'd fiddle with
>> the plugin registrations and the plugin.properties to change the
>> values for these things things to be "xml".
>>>
>>> genmodel->All->Prefix=XML
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!DOCTYPE build SYSTEM "build.dtd">
>>> <model:Build xmlns:model="http://model.example">
>>>
>>>
>>> genmodel->All->Prefix=Model
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <model:DocumentRoot xmi:version="2.0"
>>> xmlns:xmi="http://www.omg.org/XMI" xmlns:model="http://model.example">
>>> <build/>
>>> </model:DocumentRoot>
>>>
>>> what do i have to change in the Wizard that it create XML-Files
>> If you use the xml extension, I'd strongly recommend that you make
>> use of "Content Type Identifier" as well so that all the resource
>> factory and editor registrations are based on content type (will look
>> at the namespace in the *.xml file) not just on extension.
>>
>> Also keep in mind that plugin.xml does not regenerate, nor do the
>> values of plugin.properties files change once generated; that's what
>> allows them to be changed arbitrarily. So if you change your
>> GenModel, and you will want to, you need to delete these files and
>> regenerate them from scratch.
>
> Thanks a lot. But how can i change the namespace. Cant find the
> namespace in the Properties of the genmodel.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:specialize XMLSaveImpl
Next Topic:[EMF.Edit] Custom InitializeCopyCommand
Goto Forum:
  


Current Time: Tue Apr 23 16:56:22 GMT 2024

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

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

Back to the top