OCL standard library [message #63458] |
Tue, 28 October 2008 12:40  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------010406090106050308090808
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi,
I'm trying to use OCL in a standalone way and since I've had the problem
I was wondering wether there is a way to register the standard library
without accessing discouraged classes. What I have donne for now :
resourceSet.getPackageRegistry().put("http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore",
OCLStandardLibraryImpl.stdlibPackage);
This doesn't strike me as good programming : I couldn't access the
Standard library's NS URI + I couldn't access an instance of it. Did you
design any better way of doing this?
Laurent Goubet
Obeo
--------------010406090106050308090808
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr/">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard
--------------010406090106050308090808--
|
|
|
Re: OCL standard library [message #63482 is a reply to message #63458] |
Tue, 28 October 2008 13:15   |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
Hi, Laurent,
I use URI mappings for this purpose. This is from the
orge.eclipse.ocl.standalone.tests.AllTests class, which I use for
running the OCL test suites in an Eclipse-free environment:
uriMap.put(
URI.createURI("http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore"),
URI.createURI(PLATFORM_PLUGIN +
"org.eclipse.ocl.ecore/model/oclstdlib.ecore"));
uriMap.put(
URI.createURI("http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml"),
URI.createURI(PLATFORM_PLUGIN +
"org.eclipse.ocl.uml/model/oclstdlib.uml"));
You may find other handy set-up tips in there, besides.
HTH,
Christian
laurent Goubet wrote:
> Hi,
>
> I'm trying to use OCL in a standalone way and since I've had the problem
> I was wondering wether there is a way to register the standard library
> without accessing discouraged classes. What I have donne for now :
>
> resourceSet.getPackageRegistry().put("http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore",
> OCLStandardLibraryImpl.stdlibPackage);
>
> This doesn't strike me as good programming : I couldn't access the
> Standard library's NS URI + I couldn't access an instance of it. Did you
> design any better way of doing this?
>
> Laurent Goubet
> Obeo
|
|
|
|
|
Re: OCL standard library [message #63595 is a reply to message #63573] |
Wed, 29 October 2008 10:49   |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
Hi, Laurent,
You're quite right. These stdlib URIs should be available in the
EcoreEnvironment and UMLEnvironment classes.
Would you mind raising an enhancement request?
Thanks,
Christian
laurent Goubet wrote:
> Christian,
>
> using URIMaps as you hined towards did the trick, yet I'd still like to
> be able to get both the standard library NsURI and the OCLEcore plugin
> id without hard-coded Strings or discouraged accesses.
>
> Something like this
> resourceSet.getURIConverter().getURIMap().put(URI.createURI( "http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore"),
> URI.createURI(Platform.getBundle(OCLEcorePlugin.getPluginId( )).getEntry( "/model/oclstdlib.ecore").toString()));
>
> presents both the need of no hard-coded String (the NsURI of the
> standard library could evolve) and the discouraged access
> (org.eclipse.ocl.ecore plugin ID cannot be accessed without it).
>
> There may be things in OCLEcorePlugin that you don't want as API, but I
> think providing access to these Strings would really be helpful (for
> now, I'll stick with the discouraged access).
>
> Laurent Goubet
> Obeo
>
> laurent Goubet a écrit :
>> Thanks Christian, I had forgotten these standalone tests :(.
>>
>> Laurent Goubet
>> Obeo
>>
>> Christian W. Damus a écrit :
>>> Hi, Laurent,
>>>
>>> I use URI mappings for this purpose. This is from the
>>> orge.eclipse.ocl.standalone.tests.AllTests class, which I use for
>>> running the OCL test suites in an Eclipse-free environment:
>>>
>>> uriMap.put(
>>> URI.createURI("http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore"),
>>> URI.createURI(PLATFORM_PLUGIN +
>>> "org.eclipse.ocl.ecore/model/oclstdlib.ecore"));
>>> uriMap.put(
>>> URI.createURI("http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml"),
>>> URI.createURI(PLATFORM_PLUGIN +
>>> "org.eclipse.ocl.uml/model/oclstdlib.uml"));
>>>
>>>
>>> You may find other handy set-up tips in there, besides.
>>>
>>> HTH,
>>>
>>> Christian
>>>
>>> laurent Goubet wrote:
>>>> Hi,
>>>>
>>>> I'm trying to use OCL in a standalone way and since I've had the
>>>> problem I was wondering wether there is a way to register the
>>>> standard library without accessing discouraged classes. What I have
>>>> donne for now :
>>>>
>>>> resourceSet.getPackageRegistry().put("http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore",
>>>> OCLStandardLibraryImpl.stdlibPackage);
>>>>
>>>> This doesn't strike me as good programming : I couldn't access the
>>>> Standard library's NS URI + I couldn't access an instance of it. Did
>>>> you design any better way of doing this?
>>>>
>>>> Laurent Goubet
>>>> Obeo
>>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05756 seconds