Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Different EMF DataSoruce
Different EMF DataSoruce [message #872484] Wed, 16 May 2012 03:54 Go to next message
Sir Wayne is currently offline Sir Wayne
Messages: 206
Registered: July 2009
Senior Member
Hello,

i want to print a SWT Table with a EMF Model. The EMF Model is stored in a xmi file. At runtime the user can choose the storage location for the xmi file.
1. Is a data source the stored xmi file or the ecore file?

If data source the xmi file(s):
2. How can i add this (different) data source in birt?

Is there a Tutorial for EMF and Birt?

Thanks

[Updated on: Wed, 16 May 2012 04:06]

Report message to a moderator

Re: Different EMF DataSoruce [message #872511 is a reply to message #872484] Wed, 16 May 2012 04:51 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25918
Registered: July 2009
Senior Member
You'll need to use EMFs ODA adapter.


On 16/05/2012 9:54 AM, Sir Wayne wrote:
> Hello,
>
> i want to print a SWT Table with a EMF Model. The EMF Model is stored
> in a xmi file. At runtime the user can choose the storage location for
> the xmi file.
> How can i add this (different) data source in birt?
>
> Thanks
Re: Different EMF DataSoruce [message #872520 is a reply to message #872511] Wed, 16 May 2012 05:07 Go to previous messageGo to next message
Sir Wayne is currently offline Sir Wayne
Messages: 206
Registered: July 2009
Senior Member
Ed Merks wrote on Wed, 16 May 2012 04:51
You'll need to use EMFs ODA adapter.



Yes i know. I can choose a EMF Ecore Data Source --> Resource.
Re: Different EMF DataSoruce [message #872648 is a reply to message #872520] Wed, 16 May 2012 10:20 Go to previous messageGo to next message
Sir Wayne is currently offline Sir Wayne
Messages: 206
Registered: July 2009
Senior Member
I tried out: http://timezra.blogspot.de/2008/04/oda-ecore-getting-started-guide.html, but i doesn't understand two things:
1. Do I need a ecore File or a instance of a ecore File?
2. If I need a instance of a ecore file, how can i switch the file at the runtime for a rcp application?

Defaultname.ecore has 1 class Peron {name}
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="defaultname"
    nsURI="http://defaultname/1.0" nsPrefix="defaultname">
  <eClassifiers xsi:type="ecore:EClass" name="Person">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
      <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
        <details key="wildcards" value=""/>
        <details key="name" value="hh:mm"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="date" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate">
      <eAnnotations source="FormattedControl" references="#//Person/date/%FormattedControl%">
        <details key="format" value="dd.mm.yyyy"/>
      </eAnnotations>
    </eStructuralFeatures>
  </eClassifiers>
</ecore:EPackage>


Instance Person.xmi
<?xml version="1.0" encoding="ASCII"?>
<defaultname:Person xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:defaultname="http://defaultname/1.0" xsi:schemaLocation="http://defaultname/1.0 DefaultName.ecore" name="test"/>



3. Did the Query-Wizard change?

[Updated on: Wed, 16 May 2012 10:28]

Report message to a moderator

Re: Different EMF DataSoruce [message #872709 is a reply to message #872648] Wed, 16 May 2012 12:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25918
Registered: July 2009
Senior Member
Comments below.

On 16/05/2012 4:20 PM, Sir Wayne wrote:
> I tried out:
> http://timezra.blogspot.de/2008/04/oda-ecore-getting-started-guide.html,
> but i doesn't understand two things:
> 1. Do I need a ecore File or a instance of a ecore File?
An instance file, which is parsed using the generated model. Assuming
you're using a generated model...
> 2. If I need a instance of a ecore file, how can i switch the file at
> the runtime for a rcp application?
>
> Defaultname.ecore has 1 class Peron {name}
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="defaultname"
> nsURI="http://defaultname/1.0" nsPrefix="defaultname">
> <eClassifiers xsi:type="ecore:EClass" name="Person">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="wildcards" value=""/>
> <details key="name" value="hh:mm"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="date"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate">
> <eAnnotations source="FormattedControl"
> references="#//Person/date/%FormattedControl%">
> <details key="format" value="dd.mm.yyyy"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> </ecore:EPackage>
>
>
> Instance Person.xmi
>
> <?xml version="1.0" encoding="ASCII"?>
> <defaultname:Person xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:defaultname="http://defaultname/1.0"
> xsi:schemaLocation="http://defaultname/1.0 DefaultName.ecore"
> name="test"/>
This seems to suggest your instance file is in the same folder as the
Ecore model file. Be sure to open the instance file with an absolute
URI, e.g, file:/c:/folder/Person.xmi so that the relative reference to
the Ecore model file can be resolved properly.
>
>
Re: Different EMF DataSoruce [message #872757 is a reply to message #872709] Wed, 16 May 2012 14:55 Go to previous message
Sir Wayne is currently offline Sir Wayne
Messages: 206
Registered: July 2009
Senior Member
Ed Merks wrote on Wed, 16 May 2012 12:42
Comments below.


Which one exactly do you mean?

Iam confused, if i use a ecore file as datasource, then i can only select ecore types (EAttribute, EAnnotation, EClass ...)in a dataset.
If i use a stored xmi file, i cant't select anything, the list is empty.
Previous Topic:Formatting numbers
Next Topic:Tabs and Dashboard
Goto Forum:
  


Current Time: Fri Jul 25 05:06:00 EDT 2014

Powered by FUDForum. Page generated in 0.03410 seconds