Generating the separate ecore files for the sub-Epackes present in the existing model - eclipse

Problem: I have an ecore file which has the sub-E Packages. Using this model I am trying to create the GUI part using Sirius. But the problem with Sirius is that it does not support ecore files containing sub-E Packages. So we have to extract those sub-E Packages to separate ecore files. But each sub-E Packages has relation with the other sub-E Packages. So how can we extract those sub-E Packages to separate ecore files such that the relations still exists between separate ecore files after extracting them.
Thanks

By extracting them the ecore Editor will lose the information unfortunately, which means some extra work...
I had the same issue with sirius and sub e-packages leading to sirius crashing the diagram constantly.
Here is how i solved extracting a sub-epackage:
First Create a new .ecore file for your desired sub-package.
Open both .ecore files (your main and the new one) with the Sample
ecore model editor (treeview).
Copy the Package properties to your new epackage node(ns, praefix,
uri) you need to do this manually.
Then drag and drop your whole contents(excluding the purple package
node) from your subpackage into the new Epackage
Save and make sure no errors in your new file occur.
load your new .ecore file into your main file by clicking "Load
resource" Now your main file knows 2 kinds of the EClasses you have in your sub-package, their names are identical but their uri is
different.
you could now simply replace all occurrences of sub-epackage-eclasses with the newer ones or smarter and safer
Replace an etype one time (where actually use the etype in your root package)
open your main .ecore file as text, you will see that the etype values all
have a path like eType="ecore:EClass
../../org.eclipse.emf.ecore/model/Ecore.ecore#//EObject" Then You need to know how your etype paths (from your sub-epackage and your new one) differ so you can simply replace them all and your good.
finally delete the sub-epackage
Hope this helps

In eclipse ecore editor you can use "Load Resource" in pop-up menu to load any ecore file and use objects from it.

Related

Is there a way to copy the layers list from one project to another?

I want to copy this layers to another project instead add the layers one by one in the other project :
In ProjectSettings, you can find the TagManager file.
This contains all your tags and layers, I'd guess a copy paste into your new project should be allowed.

Getting nsuri in Eclipse

I have Tree.ecore as source Metamodel. I need to write something like this:
model Tree driver EMF {nsuri="http://www.eclipse.org/emf/2002/Tree"};
How can I get exact nsuri of my registered ecore in eclipse?
If you are using #namespace(uri="Tree", prefix="Tree") in your Emfatic metamodel, then the nsuri you're looking for is Tree (nsuri stands for "namespace URI")
I suppose you have generated the model code for your Tree.ecore
Then you get the nsuri and all other elements (like all EAttributes, EReferences etc) via the generated static Package class.
In your case it is probably called TreePackage.
So you get the nsuri like this:
TreePackage.eNS_URI or TreePackage.eINSTANCE.getNsURI()
Update:
If you only have the *.ecore file and want to know the uri, open the file with a text editor and look in the <ecore:EPackage tag at the beginning of the file. There you see the attribut nsURI

Clon EA-elements within the model

Can I clon a class diagram (with classes) to another package within the same model?
Moving the elements is easy, simply drag and drop, copying to another model (EAP file) also, but I could not find a way to actually clon some elements within the model.
Individual elements can be cloned within one diagram or from one diagram to another using Copy - Paste as New (Ctrl-C - Shift-Ctrl-V); they can also be copied in the project browser using Copy Element(s) from Clipboard - Paste Element(s) from Clipboard (Ctrl-C - Ctrl-V).
A diagram can be copied in the project browser, but this does not clone the diagram's contents.
Copying a package in the project browser does clone all its contents (Ctrl-C - Ctrl-V).
So in order to achieve a complete clone of a diagram and its contents, simply place them all in the same package and copy / paste that.

profiled Relationship matrix in html reports in Enterprise Architect

How can i include a profiled Relationship matrix in html reports in Enterprise Architect.
I have a link on each diagram which points to a profiled relationship matrix.
I tried to generate a html report for my project. But all these relation matrix links are disabled.
A relationship matrix can't be directly included in an HTML generation and there's no way to script running it or exporting it to an image file. But you can include it in an RTF document, so here's a sort of workaround based on RTF templates and virtual documents.
Create an RTF template which outputs the relationship matrix image. You might want to include the package name and the current date and time as well.
For each package you want a matrix report for, create a «model document» and add the package to it. Please note that if you've defined multiple relationship matrices for a package, you can't choose which one to report - EA will just pick one.
For each «model document», create an Artifact and draw a «trace» from the «model document» to the Artifact.
Move the Artifacts to a package which is included in the HTML generation. You don't have to place them in any diagrams if you don't want to, but they must reside inside the hierarchy for which HTML is generated.
The «model document»:s should be in a separate package which is not included in the HTML generation. Name them according to the scheme "pkgname - matrixname" or similar.
The Artifacts should be given names which make sense within the generated HTML - call them "Requirement Matrix: pkgname" or similar.
Now, before you run your HTML generation, you must run the matrix reports individually and manually by right-clicking the Artifact in the same diagram as the «model document» and selecting "Create Document to Artifact" (so it's a good idea to include the date and time in the template). Then generate your HTML as usual.
This will output the matrix images into the HTML. You'll have to click the document to see the image and as noted you'll have to run the matrix reports manually, but the result will be there.
You could do something similar by placing hyperlinks to image files in your diagrams and then output the different matrices to these image files. I prefer the Artifact method, because it keeps everything inside EA (no broken links) and it gives you the option of including the report date and time and more stuff if you want it.

Unable to loacte properites file in wicket

In my wicket application i have 3-4 different packages say pack1,pack2 and so on .
In pack1 i have different html and java classes. I am validating the null check by setRequired(true) and getting the message from properties file.I am naming my properties file as Send.properties ... as i have Send.html and Send.java in pack1.In properties file i am mentioning like this
formname.field.Required=The ${label} is missing
I want to validate all the html fields which are present in different html pages of the same package (pack1)in one properties file say pack1.properties .So my question here is will one singe properties will be sufficient for one package where in all the validation will be taken care.
Yes, wicket first looks for the property in the properties file associated to the page, and then in the properties asociated to the package (and after that in parents packages...).
But, as long as I know the package properties file is called package.properties (independently of the package name).