Thanks,
I had a try at the code you demonstrated
in the new test but without much success as I keep getting a
MalformedURLException when calling “scribbler.getResource(…)”.
I am not
sure why this happening but it doesn’t seem to involve my extensions code.
Also,
despite this stack trace (which ends up logged in the error view), the call to “root.getComponentType()”returns a component type object with null values for all its
attributes
I copied the stack trace and other snippets
at the end of this mail.
Any idea?
Also, using
the approach demonstrated in this test, how would we know when there is no
introspector defined for a particular resource or if the introspection failed?
Cheers,
d.
============================================================
…
<extension point="org.eclipse.stp.core.componentTypeIntrospector">
<componentTypeIntrospector
class="org.eclipse.stp.sc.celtix.sca.CeltixProjectComponentTypeIntrospector"
extension="project"
implementationElementType="implementation.celtixproj"
shareableURIFactoryClass="org.eclipse.stp.sc.celtix.sca.CeltixSharableURIFactory"/>
</extension>
…
============================================================
…
58 ComponentType cptType = null; // = IModelIntrospectionManager.eINSTANCE.resolve(jImpl);
59
60 ComponentTypeScribblerDomain domain = new ComponentTypeScribblerDomain(projs[i].getFile(".project"));
61 IEditModelScribbler scribbler = domain.createScribblerForRead();
62 Resource r =
scribbler.getResource(domain.getComponentTypeDescriptor());
63 if (r.getContents().size() > 0) {
64 Object rootObject =
r.getContents().get(0);
65 if (rootObject instanceof SCACoreRoot) {
66 SCACoreRoot
root = (SCACoreRoot)r.getContents().get(0);
67 cptType =
root.getComponentType();
68 }
69 }
…
============================================================
Could not load resource
"comptype:/p7/test.project".
java.net.MalformedURLException: unknown
protocol: comptype
at
java.net.URL.<init>(URL.java:574)
at
java.net.URL.<init>(URL.java:464)
at
java.net.URL.<init>(URL.java:413)
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createURLInputStream(URIConverterImpl.java:564)
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createInputStream(URIConverterImpl.java:453)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:892)
at
org.eclipse.stp.core.internal.infrastructure.emf.EditModel.getResource(EditModel.java:457)
at
org.eclipse.stp.core.internal.infrastructure.emf.EditModelScribbler.getResource(EditModelScribbler.java:540)
at
org.eclipse.stp.core.internal.infrastructure.emf.EditModelScribbler.getResource(EditModelScribbler.java:487)
at
org.eclipse.stp.core.internal.infrastructure.emf.EditModelScribbler.getResource(EditModelScribbler.java:475)
at
org.eclipse.stp.sc.celtix.sca.view.updateView(view.java:66)
at
org.eclipse.stp.sc.celtix.sca.view$RefreshAction.run(view.java:114)
at
org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at
…
============================================================
From:
stp-dev-bounces@xxxxxxxxxxx [mailto:stp-dev-bounces@xxxxxxxxxxx] On Behalf Of Devang Parikh
Sent: 17 August 2006 19:58
To: STP
Dev list
Subject: RE: [stp-dev] writing an
introspector...
David,
I have
corrected a problem of ecore model in properties implementation example. ecore
model was refering to Implementation with old name.
Also I
have creted new test case org.eclipse.stp.core.tests.introspection.IntrospectionWithoutComponentTests.
This
Test case demonstrates how you can use Introspection framework without loading
implementation in assembly model.
hope
this helps,
Devang
Parikh
"Beaurpere, David"
<David.Beaurpere@xxxxxxxx>
Sent by:
stp-dev-bounces@xxxxxxxxxxx
08/17/2006
04:16 AM
Please respond
to
STP Dev list
<stp-dev@xxxxxxxxxxx>
|
|
To
|
"STP Dev list"
<stp-dev@xxxxxxxxxxx>
|
cc
|
|
Subject
|
RE: [stp-dev] writing an introspector...
|
|
Actually I was only referring the
“properties” implementation used in the docs and unit tests.
d.
From:
stp-dev-bounces@xxxxxxxxxxx [mailto:stp-dev-bounces@xxxxxxxxxxx] On Behalf Of Daniel Berg
Sent: 16 August 2006 19:00
To: STP Dev list
Subject: Re: [stp-dev] writing an introspector...
Are you referring to the Java implementation? If so this is true.
We have not contributed the Java implementation yet.
Regards,
Dan
-------------------------------------------------
Daniel Berg
Rational SOA Tools Lead
(919) 486-0047
T/L 526-0047
http://blogs.tap.ibm.com/weblogs/page/danberg@xxxxxxxxxx
http://planetradical.raleigh.ibm.com/
"Developers are like artists; they produce their best work if they have
the freedom to do so, but they need good tools." -- Werner Vogels
Oisin Hurley <ohurley@xxxxxxxx>
Sent by: stp-dev-bounces@xxxxxxxxxxx
08/16/2006
11:14 AM
Please respond
to
STP Dev list
<stp-dev@xxxxxxxxxxx>
|
|
To
|
STP Dev list
<stp-dev@xxxxxxxxxxx>
|
cc
|
|
Subject
|
Re: [stp-dev] writing an introspector...
|
|
> I also ran into trouble when I tried to extend the SCA model to add
> a new implementation type. I had a look at the properties example
> but the ecore files in CVS reference some IBM resources that
> haven’t been committed.
David - what's missing from here? Dan, Michael, did something get
left out by accident?
--oh_______________________________________________
stp-dev mailing list
stp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/stp-dev_______________________________________________
stp-dev mailing list
stp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/stp-dev