Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Wtp-wst-dev] question about EMF resource register

Title: question about EMF resource register

Hi,

We have questions about registering the emf resource factory and getting the emf resource.

We registered the uri and the ResourceFactory using the following code:

J2EEResourceFactoryRegistry.INSTANCE.registerLastFileSegment("server-web-jar.xml.ser",new ServerWebJarResourceFactoryImpl));

which ServerWebJarResourceFactoryImpl extends XMLResourceFactoryImpl.

And then we use the following code to get the emf resource:
 public static final String SERVER_WEB_JAR_RESOURCE_URI ="/server-web-jar.xml.ser";
 public static final URI RESOURCE_URI =URI.createURI(SERVER_WEB_JAR_RESOURCE_URI );
 ...
 WebArtifactEdit edit =WebArtifactEdit.getWebArtifactEditForWrite(project);
 return  ((ArtifactEditModel)edit.getAdapter(ArtifactEditModel.ADAPTER_TYPE)).getResource(RESOURCE_URI);

But the resource that we got is the object in type of
"ReferencedComponentXMIResourceImp" not "ServerWebJarResourceFactoryImpl ".
Also, I have put a breakpoint in the ServerWebJarResourceFactoryImpl .createResource() but it does not stop there.
So I am thinking we are not registering the emf resource factory correctly.
But the above code was working in RAD v6 before.

Have we missed some steps in registering the emf resource factory or getting the emf resource?

Thanks a lot.
Cheers,
Amy


Back to the top