Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[emf-dev] DanglingHREFs and few other problems

Hi all,

Initially I had faced a danglinghref exception, which got solved when the EObjects were set with the proxy URIs.
Now the problem is not dangling exceptions, but as mentioned below.

Feature
:

The work is to serialize (to xml files) data available from the database. The data were loaded from xml files only (using ecore). Now to complete the entire flow we need to getback the original data back from database.

Existing functionality -

The XML file loaded to the database using Ecore.

<Entity-1 id="id1">
     <Entity-2 href="">
</Entity-1

XMl serialized through EMF by getting info from the database.

<Entity-1 id="id1" Entity-2 ="../CPM_KP25/CPM_KP25.xml#//ent_mt1"/>

I had used the ((entity-1EObject).setEntity-2()) method. The entity-2 had the proxy URI set, along with its associated attributes. Other internal EObjects for which the HREF s are coming properly are set on the parent EObject using setListofEntities() method, while the problematic ones are the the ones having the method as setEntity() type.

I would request you to suggest me ways of overcoming this.

The older problem which got solved with suggestions from newsgroup people is below

With the current implementation, I am able to serialize into the xml file all direct contents, but when some entity carries a href attribute, which points to an entity in a different xml file, I get a DanglingHREF exception.


<em>You should get this only for an EObject x if x.eResource() == null and x.eIsProxy() is false.</em>

Eg:

Input file content used to load data into database


<Entity-1 id="id1">
     <Entity-2 href="">
Output file when serialized (after discarding danglingHREFException)


<Entity-1 id="id1"/>

Is there a way that you could suggest me for this?


<em>It sounds to me like you have an object not contained bya resource which should be marked as a proxy (InternalEobject.eSetProxyURI()) if you want to serialize a reference to it.

--
With Regards
Shankar Ramachandran

Back to the top