Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Tahir Nazir on September 25, 2012, 10:25:39 am
-
Hello everyone,
I am currently developing an add-in of EA. I am managing baselines through SVN.
For example when I have managed a SVN Repository in EA then with every checkout SVN create an .XMI file which is actually a baseline.
So when I have read the material about .eap file baseline, I get to know that .eap save baseline data as str.dat file and in zip format.
Now I have tried to get data from this baseline and it give us a zip file which have str.dat file which contain the information of baseline. This file is in xml format.
which is like this EA-->baseline-->zip-->str.dat
I get in this sequence data from .eap repository
Now I have tried the following, I have get xml file from svn repository using export. Now I have changed its name to str.dat
I have zipped it and put it back to t_document table as ole object.
it mean I have reverse the process
e.g. Model.xml --> zip --> insert into baseline through jet connection
It has created the baseline in .eap repositroy and now when I tried to compare it , it say something XMI 1.1 comparision problem.
I have checked with notepad++ and when I have changed the filename to str.dat then it change its encoding some ANSI format.
When I have took zipped file from EA repositry which is a baseline and stored also in t_document table. This baseline I had created though mangage baseline--> new baseline.
I have unzip the file which I have got from t_document table named str.dat. When I take this file and zip it again and insert back into database as new row in t_document table then it work fine.
Even I have copied in this file my content from SVN model.xml file, it also work fine and dont change the encoding. I have done it through notepad++.
So can anyone guide me that when I get a file from svn repository then how to use the format of that file so that it work in t_document table perfectly as baseline.
any help will be highly appreciated. there is no documentation that what encoding of this file type which is used by EA to store baseline.
thanks a lot.
:-[
-
From what I read you're doing it the right way. But this is something deep in EA's stomach and you will likely be on your own to find the cause of the issue. The only thing I can recommend is to try it with a very simple model. So I only can wish you good luck :-/
q.
-
What do you mean by small model?
Or can you guide me that how to build baseline using an xml file which i have got from svn checkout with the help of C#. :o
-
I mean that you should create a local EAP repository with just a few sample classes inside. Then create a baseline and see what you can figure out. It's probably easier than working with a large model. Sorry, but I can't help here very much.
q.
-
The zip is base64 encoded. Notepad opens it automatically. Try to use a different editor with the ability to see the hex code and try in your application an encoding with the wright code page.
-
I have tried with creating simple model and there I am creating this problem.
I mean that you should create a local EAP repository with just a few sample classes inside. Then create a baseline and see what you can figure out. It's probably easier than working with a large model. Sorry, but I can't help here very much.
q.
-
thanks a lot for your kind reply. As you have mentioned that base64 encoded should I use. What do you mean that notepad open the zip automatically?
I get one from my svn repository an xml file. Can you guide me that how should I encode that file which I have insert in the DB. I have problem with the encoding of that .xml file. Because when I change its name then its encoding get changed.
I will be highly thankful , if you guide me in this regard.
The zip is base64 encoded. Notepad opens it automatically. Try to use a different editor with the ability to see the hex code and try in your application an encoding with the wright code page.
-
I too think that the base64 encoding is the part you are missing.
Geert
-
Various columns contain binary data which are additionaly zipped. If you want to access the contents you have to follow these steps:
• Decode the column using base64.
• Unzip the resulting binary blob.
• Extract the file str.dat from the unzipped data.
This file finally contains the data.
An exception is Image which yields the raw image data right after decoding it via base64.
From my book Inside EA.
q.
-
Thanks for your kind reply. but as you are saying the ZIP file should be base64 encoded. But why then the file str.dat which I take from EA repository and ZIP that and put inside the database as new tuple then work that fine.
But when I take through SVN repository an xml file and rename it to str.dat and zip and insert back to database as new tuple then it gives some XMI 1.1 error.
I am interested in the structure of that svn.dat file that which kind of file is that. That is also might not be mentioned in your book.
if it is then I can buy that book also. Or if you have any suggestion then I am thankful to you.
Various columns contain binary data which are additionaly zipped. If you want to access the contents you have to follow these steps:
• Decode the column using base64.
• Unzip the resulting binary blob.
• Extract the file str.dat from the unzipped data.
This file finally contains the data.
An exception is Image which yields the raw image data right after decoding it via base64.
From my book Inside EA.
q.
-
But when I take through SVN repository an xml file and rename it to str.dat and zip and insert back to database as new tuple then it gives some XMI 1.1 error.
I'm lost with that? What do you want to achieve here? To me this looks like complete nonsense.
The XML taken from SVN is an XMI dump of a certain package in the repository and does not (directly) reflect the contents of any table used to represent the repository. These are two completely different pairs of shoes.
q.
-
Oh, I think I'm interested in extracting the data from, but I have no idea how to:
1.Decode the column using base64 (sql query)?
2.unzip the result ...
3.extact str.dat from unzip data
Some hints or answers?