Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo resource URI implementation
Teneo resource URI implementation [message #103211] Tue, 20 November 2007 14:08 Go to next message
Eclipse UserFriend
Originally posted by: akarypid.yahoo.gr

In continuation of my post to org.eclipse.emf:

My understanding is that EMF has a pluggable URI-based model loading
scheme. I'm not a guru, but I've just been reading the API javadoc for
ResourceSet, Resource and URIConverter. From what Ed Merks wrote, EMF
2.4 provides better support for capability inspection of URIs, but how
hard would it be to get that into Teneo 0.8.x with EMF 2.3?

I'm looking at the source of Teneo 0.8 and there's a HibernateResource
extending (via StoreResource) the basic EMF ResourceImpl. I see it
registered with the so called "Resource.Factory" for the
"hibernate://..." URI syntax in class HbDataStore. What would I have to
do to convince the generated EMF editor that one should be able to edit
models loaded from Teneo URIs?

Ed Merks wrote:

> Alexandros,
>
> Comments below.
>
> Alexandros Karypidis wrote:
>> Hi,
>>
>> I've got an EMF model which is persisted using Teneo & Hibernate to a
>> Derby database in an RCP application. I have three problems with the
>> generated RCP editor:
>>
>> 1) It is read-only (I can't edit anything).
> It should be possible to improve this kind of behavior in EMF 2.4 since
> URIHandler will support isReadOnly directly. Right now that's supported
> in AdapterFactoryEditingDomain like this which basically assumes that
> anything that's not platform:/resource, or file:/whatever will be read only.
>
> protected boolean isReadOnlyURI(URI uri)
> {
> if (uri.isArchive())
> {
> return isReadOnlyURI(URI.createURI(uri.authority()));
> }
>
> return !uri.isPlatformResource() && (uri.isRelative() ||
> !uri.isFile());
> }
>
> You'll need to specialize this method.
> I should talk to Martin about providing a HibernateURIHandlerImpl for
> the Teneo version that goes with EMF 2.4 for handling things like
> isReadOnly, delete and things like timestamps...
Re: Teneo resource URI implementation [message #103280 is a reply to message #103211] Tue, 20 November 2007 18:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Alexandros,
I hope Ed can comment on this (related to the generated editor, urihandler 2.4), my experience
regarding this is limited so I would need some more information to get me on the way.

If something needs to be changed to Teneo to help out here then ofcourse I am willing/interested to
make the required changes. Or incorporate any contributions...

gr. Martin

Alexandros Karypidis wrote:
> In continuation of my post to org.eclipse.emf:
>
> My understanding is that EMF has a pluggable URI-based model loading
> scheme. I'm not a guru, but I've just been reading the API javadoc for
> ResourceSet, Resource and URIConverter. From what Ed Merks wrote, EMF
> 2.4 provides better support for capability inspection of URIs, but how
> hard would it be to get that into Teneo 0.8.x with EMF 2.3?
>
> I'm looking at the source of Teneo 0.8 and there's a HibernateResource
> extending (via StoreResource) the basic EMF ResourceImpl. I see it
> registered with the so called "Resource.Factory" for the
> "hibernate://..." URI syntax in class HbDataStore. What would I have to
> do to convince the generated EMF editor that one should be able to edit
> models loaded from Teneo URIs?
>
> Ed Merks wrote:
>
>> Alexandros,
>>
>> Comments below.
>>
>> Alexandros Karypidis wrote:
>>> Hi,
>>>
>>> I've got an EMF model which is persisted using Teneo & Hibernate to a
>>> Derby database in an RCP application. I have three problems with the
>>> generated RCP editor:
>>>
>>> 1) It is read-only (I can't edit anything).
>> It should be possible to improve this kind of behavior in EMF 2.4
>> since URIHandler will support isReadOnly directly. Right now that's
>> supported in AdapterFactoryEditingDomain like this which basically
>> assumes that anything that's not platform:/resource, or file:/whatever
>> will be read only.
>>
>> protected boolean isReadOnlyURI(URI uri)
>> {
>> if (uri.isArchive())
>> {
>> return isReadOnlyURI(URI.createURI(uri.authority()));
>> }
>>
>> return !uri.isPlatformResource() && (uri.isRelative() ||
>> !uri.isFile());
>> }
>>
>> You'll need to specialize this method.
>> I should talk to Martin about providing a HibernateURIHandlerImpl for
>> the Teneo version that goes with EMF 2.4 for handling things like
>> isReadOnly, delete and things like timestamps...


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo resource URI implementation [message #103330 is a reply to message #103280] Tue, 20 November 2007 23:02 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------090608040801070007020200
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Martin,

Unfortunately document is sadly lagging behind. The general idea is
that in 2.4, the URIConverterImpl is more easily tailored by adding
handlers rather than by creating derived implementations which makes it
easier to compose different specialized URI handling mechanism. In
particular, you'll noticed that in 2.4, URIConverter has a list of
URIHandlers which are initialized in the next ExtensibleURIConverterImpl
which replaces the deprecated URIConverterImpl.

public ExtensibleURIConverterImpl()
{
this(URIHandler.DEFAULT_HANDLERS,
ContentHandler.Registry.INSTANCE.contentHandlers());
}

These are available by default:

/**
* The global default read only list of URI handlers.
*/
List<URIHandler> DEFAULT_HANDLERS =
Collections.unmodifiableList
(Arrays.asList
(new URIHandler []
{
new PlatformResourceURIHandlerImpl(),
new FileURIHandlerImpl(),
new EFSURIHandlerImpl(),
new ArchiveURIHandlerImpl(),
new URIHandlerImpl()
}));

So I imagine there ought to be a HibernateURIHandlerImpl that derives
from URIHandlerImpl and specializes methods like delete, exists, and
get/setAttribute. You could look at the other derived URIHandlerImpls
to see how they implement these mthods. Of course I'll be more than
happy to help answer any questions that come up...


Martin Taal wrote:
> Alexandros,
> I hope Ed can comment on this (related to the generated editor,
> urihandler 2.4), my experience regarding this is limited so I would
> need some more information to get me on the way.
>
> If something needs to be changed to Teneo to help out here then
> ofcourse I am willing/interested to make the required changes. Or
> incorporate any contributions...
>
> gr. Martin
>
> Alexandros Karypidis wrote:
>> In continuation of my post to org.eclipse.emf:
>>
>> My understanding is that EMF has a pluggable URI-based model loading
>> scheme. I'm not a guru, but I've just been reading the API javadoc
>> for ResourceSet, Resource and URIConverter. From what Ed Merks wrote,
>> EMF 2.4 provides better support for capability inspection of URIs,
>> but how hard would it be to get that into Teneo 0.8.x with EMF 2.3?
>>
>> I'm looking at the source of Teneo 0.8 and there's a
>> HibernateResource extending (via StoreResource) the basic EMF
>> ResourceImpl. I see it registered with the so called
>> "Resource.Factory" for the "hibernate://..." URI syntax in class
>> HbDataStore. What would I have to do to convince the generated EMF
>> editor that one should be able to edit models loaded from Teneo URIs?
>>
>> Ed Merks wrote:
>>
>>> Alexandros,
>>>
>>> Comments below.
>>>
>>> Alexandros Karypidis wrote:
>>>> Hi,
>>>>
>>>> I've got an EMF model which is persisted using Teneo & Hibernate to
>>>> a Derby database in an RCP application. I have three problems with
>>>> the generated RCP editor:
>>>>
>>>> 1) It is read-only (I can't edit anything).
>>> It should be possible to improve this kind of behavior in EMF 2.4
>>> since URIHandler will support isReadOnly directly. Right now that's
>>> supported in AdapterFactoryEditingDomain like this which basically
>>> assumes that anything that's not platform:/resource, or
>>> file:/whatever will be read only.
>>>
>>> protected boolean isReadOnlyURI(URI uri)
>>> {
>>> if (uri.isArchive())
>>> {
>>> return isReadOnlyURI(URI.createURI(uri.authority()));
>>> }
>>>
>>> return !uri.isPlatformResource() && (uri.isRelative() ||
>>> !uri.isFile());
>>> }
>>>
>>> You'll need to specialize this method.
>>> I should talk to Martin about providing a HibernateURIHandlerImpl
>>> for the Teneo version that goes with EMF 2.4 for handling things
>>> like isReadOnly, delete and things like timestamps...
>
>


--------------090608040801070007020200
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Martin,<br>
<br>
Unfortunately document is sadly lagging behind.&nbsp; The general idea is
that in 2.4, the URIConverterImpl is more easily tailored by adding
handlers rather than by creating derived implementations which makes it
easier to compose different specialized URI handling mechanism.&nbsp; In
particular, you'll noticed that in 2.4, URIConverter has a list of
URIHandlers which are initialized in the next
ExtensibleURIConverterImpl which replaces the deprecated
URIConverterImpl.<br>
<blockquote><small>&nbsp; public ExtensibleURIConverterImpl()<br>
&nbsp; {<br>
&nbsp;&nbsp;&nbsp; this(URIHandler.DEFAULT_HANDLERS,
ContentHandler.Registry.INSTANCE.contentHandlers());<br>
&nbsp; }</small><br>
</blockquote>
These are available by default:<small><br>
</small>
<blockquote><small>&nbsp; /**</small><br>
<small>&nbsp;&nbsp; * The global default read only list of URI handlers.</small><br>
<small>&nbsp;&nbsp; */</small><br>
<small>&nbsp; List&lt;URIHandler&gt; DEFAULT_HANDLERS = </small><br>
<small>&nbsp;&nbsp;&nbsp; Collections.unmodifiableList</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Arrays.asList</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; (new URIHandler [] </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; { </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new PlatformResourceURIHandlerImpl(), </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new FileURIHandlerImpl(), </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new EFSURIHandlerImpl(), </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new ArchiveURIHandlerImpl(), </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new URIHandlerImpl()</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }));</small><br>
</blockquote>
So I imagine there ought to be a HibernateURIHandlerImpl that derives
from URIHandlerImpl and specializes methods like delete, exists, and
get/setAttribute.&nbsp; You could look at the other derived URIHandlerImpls
to see how they implement these mthods.&nbsp; Of course I'll be more than
happy to help answer any questions that come up...<br>
<br>
<br>
Martin Taal wrote:
<blockquote cite="mid:fhv7sb$trb$1@build.eclipse.org" type="cite">Alexandros,
<br>
I hope Ed can comment on this (related to the generated editor,
urihandler 2.4), my experience regarding this is limited so I would
need some more information to get me on the way.
<br>
<br>
If something needs to be changed to Teneo to help out here then
ofcourse I am willing/interested to make the required changes. Or
incorporate any contributions...
<br>
<br>
gr. Martin
<br>
<br>
Alexandros Karypidis wrote:
<br>
<blockquote type="cite">In continuation of my post to
org.eclipse.emf:
<br>
<br>
My understanding is that EMF has a pluggable URI-based model loading
scheme. I'm not a guru, but I've just been reading the API javadoc for
ResourceSet, Resource and URIConverter. From what Ed Merks wrote, EMF
2.4 provides better support for capability inspection of URIs, but how
hard would it be to get that into Teneo 0.8.x with EMF 2.3?
<br>
<br>
I'm looking at the source of Teneo 0.8 and there's a HibernateResource
extending (via StoreResource) the basic EMF ResourceImpl. I see it
registered with the so called "Resource.Factory" for the
"hibernate://..." URI syntax in class HbDataStore. What would I have to
do to convince the generated EMF editor that one should be able to edit
models loaded from Teneo URIs?
<br>
<br>
Ed Merks wrote:
<br>
<br>
<blockquote type="cite">Alexandros,
<br>
<br>
Comments below.
<br>
<br>
Alexandros Karypidis wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
I've got an EMF model which is persisted using Teneo &amp; Hibernate to
a Derby database in an RCP application. I have three problems with the
generated RCP editor:
<br>
<br>
1) It is read-only (I can't edit anything).
<br>
</blockquote>
It should be possible to improve this kind of behavior in EMF 2.4 since
URIHandler will support isReadOnly directly.&nbsp; Right now that's
supported in AdapterFactoryEditingDomain like this which basically
assumes that anything that's not platform:/resource, or <a class="moz-txt-link-freetext" href="file:/whatever">file:/whatever</a>
will be read only.
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protected boolean isReadOnlyURI(URI uri)
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; if (uri.isArchive())
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return isReadOnlyURI(URI.createURI(uri.authority()));
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; return !uri.isPlatformResource() &amp;&amp; (uri.isRelative()
||
<br>
&nbsp;&nbsp;&nbsp; !uri.isFile());
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>
<br>
You'll need to specialize this method.
<br>
I should talk to Martin about providing a HibernateURIHandlerImpl for
the Teneo version that goes with EMF 2.4 for handling things like
isReadOnly, delete and things like timestamps...
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
<br>
</body>
</html>

--------------090608040801070007020200--
Re: Teneo resource URI implementation [message #612612 is a reply to message #103211] Tue, 20 November 2007 18:09 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Alexandros,
I hope Ed can comment on this (related to the generated editor, urihandler 2.4), my experience
regarding this is limited so I would need some more information to get me on the way.

If something needs to be changed to Teneo to help out here then ofcourse I am willing/interested to
make the required changes. Or incorporate any contributions...

gr. Martin

Alexandros Karypidis wrote:
> In continuation of my post to org.eclipse.emf:
>
> My understanding is that EMF has a pluggable URI-based model loading
> scheme. I'm not a guru, but I've just been reading the API javadoc for
> ResourceSet, Resource and URIConverter. From what Ed Merks wrote, EMF
> 2.4 provides better support for capability inspection of URIs, but how
> hard would it be to get that into Teneo 0.8.x with EMF 2.3?
>
> I'm looking at the source of Teneo 0.8 and there's a HibernateResource
> extending (via StoreResource) the basic EMF ResourceImpl. I see it
> registered with the so called "Resource.Factory" for the
> "hibernate://.." URI syntax in class HbDataStore. What would I have to
> do to convince the generated EMF editor that one should be able to edit
> models loaded from Teneo URIs?
>
> Ed Merks wrote:
>
>> Alexandros,
>>
>> Comments below.
>>
>> Alexandros Karypidis wrote:
>>> Hi,
>>>
>>> I've got an EMF model which is persisted using Teneo & Hibernate to a
>>> Derby database in an RCP application. I have three problems with the
>>> generated RCP editor:
>>>
>>> 1) It is read-only (I can't edit anything).
>> It should be possible to improve this kind of behavior in EMF 2.4
>> since URIHandler will support isReadOnly directly. Right now that's
>> supported in AdapterFactoryEditingDomain like this which basically
>> assumes that anything that's not platform:/resource, or file:/whatever
>> will be read only.
>>
>> protected boolean isReadOnlyURI(URI uri)
>> {
>> if (uri.isArchive())
>> {
>> return isReadOnlyURI(URI.createURI(uri.authority()));
>> }
>>
>> return !uri.isPlatformResource() && (uri.isRelative() ||
>> !uri.isFile());
>> }
>>
>> You'll need to specialize this method.
>> I should talk to Martin about providing a HibernateURIHandlerImpl for
>> the Teneo version that goes with EMF 2.4 for handling things like
>> isReadOnly, delete and things like timestamps...


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo resource URI implementation [message #612619 is a reply to message #103280] Tue, 20 November 2007 23:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33188
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090608040801070007020200
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Martin,

Unfortunately document is sadly lagging behind. The general idea is
that in 2.4, the URIConverterImpl is more easily tailored by adding
handlers rather than by creating derived implementations which makes it
easier to compose different specialized URI handling mechanism. In
particular, you'll noticed that in 2.4, URIConverter has a list of
URIHandlers which are initialized in the next ExtensibleURIConverterImpl
which replaces the deprecated URIConverterImpl.

public ExtensibleURIConverterImpl()
{
this(URIHandler.DEFAULT_HANDLERS,
ContentHandler.Registry.INSTANCE.contentHandlers());
}

These are available by default:

/**
* The global default read only list of URI handlers.
*/
List<URIHandler> DEFAULT_HANDLERS =
Collections.unmodifiableList
(Arrays.asList
(new URIHandler []
{
new PlatformResourceURIHandlerImpl(),
new FileURIHandlerImpl(),
new EFSURIHandlerImpl(),
new ArchiveURIHandlerImpl(),
new URIHandlerImpl()
}));

So I imagine there ought to be a HibernateURIHandlerImpl that derives
from URIHandlerImpl and specializes methods like delete, exists, and
get/setAttribute. You could look at the other derived URIHandlerImpls
to see how they implement these mthods. Of course I'll be more than
happy to help answer any questions that come up...


Martin Taal wrote:
> Alexandros,
> I hope Ed can comment on this (related to the generated editor,
> urihandler 2.4), my experience regarding this is limited so I would
> need some more information to get me on the way.
>
> If something needs to be changed to Teneo to help out here then
> ofcourse I am willing/interested to make the required changes. Or
> incorporate any contributions...
>
> gr. Martin
>
> Alexandros Karypidis wrote:
>> In continuation of my post to org.eclipse.emf:
>>
>> My understanding is that EMF has a pluggable URI-based model loading
>> scheme. I'm not a guru, but I've just been reading the API javadoc
>> for ResourceSet, Resource and URIConverter. From what Ed Merks wrote,
>> EMF 2.4 provides better support for capability inspection of URIs,
>> but how hard would it be to get that into Teneo 0.8.x with EMF 2.3?
>>
>> I'm looking at the source of Teneo 0.8 and there's a
>> HibernateResource extending (via StoreResource) the basic EMF
>> ResourceImpl. I see it registered with the so called
>> "Resource.Factory" for the "hibernate://.." URI syntax in class
>> HbDataStore. What would I have to do to convince the generated EMF
>> editor that one should be able to edit models loaded from Teneo URIs?
>>
>> Ed Merks wrote:
>>
>>> Alexandros,
>>>
>>> Comments below.
>>>
>>> Alexandros Karypidis wrote:
>>>> Hi,
>>>>
>>>> I've got an EMF model which is persisted using Teneo & Hibernate to
>>>> a Derby database in an RCP application. I have three problems with
>>>> the generated RCP editor:
>>>>
>>>> 1) It is read-only (I can't edit anything).
>>> It should be possible to improve this kind of behavior in EMF 2.4
>>> since URIHandler will support isReadOnly directly. Right now that's
>>> supported in AdapterFactoryEditingDomain like this which basically
>>> assumes that anything that's not platform:/resource, or
>>> file:/whatever will be read only.
>>>
>>> protected boolean isReadOnlyURI(URI uri)
>>> {
>>> if (uri.isArchive())
>>> {
>>> return isReadOnlyURI(URI.createURI(uri.authority()));
>>> }
>>>
>>> return !uri.isPlatformResource() && (uri.isRelative() ||
>>> !uri.isFile());
>>> }
>>>
>>> You'll need to specialize this method.
>>> I should talk to Martin about providing a HibernateURIHandlerImpl
>>> for the Teneo version that goes with EMF 2.4 for handling things
>>> like isReadOnly, delete and things like timestamps...
>
>


--------------090608040801070007020200
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Martin,<br>
<br>
Unfortunately document is sadly lagging behind.&nbsp; The general idea is
that in 2.4, the URIConverterImpl is more easily tailored by adding
handlers rather than by creating derived implementations which makes it
easier to compose different specialized URI handling mechanism.&nbsp; In
particular, you'll noticed that in 2.4, URIConverter has a list of
URIHandlers which are initialized in the next
ExtensibleURIConverterImpl which replaces the deprecated
URIConverterImpl.<br>
<blockquote><small>&nbsp; public ExtensibleURIConverterImpl()<br>
&nbsp; {<br>
&nbsp;&nbsp;&nbsp; this(URIHandler.DEFAULT_HANDLERS,
ContentHandler.Registry.INSTANCE.contentHandlers());<br>
&nbsp; }</small><br>
</blockquote>
These are available by default:<small><br>
</small>
<blockquote><small>&nbsp; /**</small><br>
<small>&nbsp;&nbsp; * The global default read only list of URI handlers.</small><br>
<small>&nbsp;&nbsp; */</small><br>
<small>&nbsp; List&lt;URIHandler&gt; DEFAULT_HANDLERS = </small><br>
<small>&nbsp;&nbsp;&nbsp; Collections.unmodifiableList</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Arrays.asList</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; (new URIHandler [] </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; { </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new PlatformResourceURIHandlerImpl(), </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new FileURIHandlerImpl(), </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new EFSURIHandlerImpl(), </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new ArchiveURIHandlerImpl(), </small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new URIHandlerImpl()</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }));</small><br>
</blockquote>
So I imagine there ought to be a HibernateURIHandlerImpl that derives
from URIHandlerImpl and specializes methods like delete, exists, and
get/setAttribute.&nbsp; You could look at the other derived URIHandlerImpls
to see how they implement these mthods.&nbsp; Of course I'll be more than
happy to help answer any questions that come up...<br>
<br>
<br>
Martin Taal wrote:
<blockquote cite="mid:fhv7sb$trb$1@build.eclipse.org" type="cite">Alexandros,
<br>
I hope Ed can comment on this (related to the generated editor,
urihandler 2.4), my experience regarding this is limited so I would
need some more information to get me on the way.
<br>
<br>
If something needs to be changed to Teneo to help out here then
ofcourse I am willing/interested to make the required changes. Or
incorporate any contributions...
<br>
<br>
gr. Martin
<br>
<br>
Alexandros Karypidis wrote:
<br>
<blockquote type="cite">In continuation of my post to
org.eclipse.emf:
<br>
<br>
My understanding is that EMF has a pluggable URI-based model loading
scheme. I'm not a guru, but I've just been reading the API javadoc for
ResourceSet, Resource and URIConverter. From what Ed Merks wrote, EMF
2.4 provides better support for capability inspection of URIs, but how
hard would it be to get that into Teneo 0.8.x with EMF 2.3?
<br>
<br>
I'm looking at the source of Teneo 0.8 and there's a HibernateResource
extending (via StoreResource) the basic EMF ResourceImpl. I see it
registered with the so called "Resource.Factory" for the
"hibernate://.." URI syntax in class HbDataStore. What would I have to
do to convince the generated EMF editor that one should be able to edit
models loaded from Teneo URIs?
<br>
<br>
Ed Merks wrote:
<br>
<br>
<blockquote type="cite">Alexandros,
<br>
<br>
Comments below.
<br>
<br>
Alexandros Karypidis wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
I've got an EMF model which is persisted using Teneo &amp; Hibernate to
a Derby database in an RCP application. I have three problems with the
generated RCP editor:
<br>
<br>
1) It is read-only (I can't edit anything).
<br>
</blockquote>
It should be possible to improve this kind of behavior in EMF 2.4 since
URIHandler will support isReadOnly directly.&nbsp; Right now that's
supported in AdapterFactoryEditingDomain like this which basically
assumes that anything that's not platform:/resource, or <a class="moz-txt-link-freetext" href="file:/whatever">file:/whatever</a>
will be read only.
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protected boolean isReadOnlyURI(URI uri)
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; if (uri.isArchive())
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return isReadOnlyURI(URI.createURI(uri.authority()));
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; return !uri.isPlatformResource() &amp;&amp; (uri.isRelative()
||
<br>
&nbsp;&nbsp;&nbsp; !uri.isFile());
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>
<br>
You'll need to specialize this method.
<br>
I should talk to Martin about providing a HibernateURIHandlerImpl for
the Teneo version that goes with EMF 2.4 for handling things like
isReadOnly, delete and things like timestamps...
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
<br>
</body>
</html>

--------------090608040801070007020200--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Teneo] Timeout after 8 hours
Next Topic:[Teneo] Timeout after 8 hours
Goto Forum:
  


Current Time: Sat Jul 27 10:56:25 GMT 2024

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

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

Back to the top