Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [emf-dev] FW: About Web Editors

Please use the forum to ask questions. 

https://www.eclipse.org/forums/index.php?t=thread&frm_id=108

Make sure the FAQ doesn't already answer your question, e.g.,

https://wiki.eclipse.org/EMF/FAQ#How_do_I_map_between_an_EMF_Resource_and_an_Eclipse_IFile.3F

To integrate with some other RESTful resource back-end, you could use a specialized URIHandlerImpl that you could add to your resource set's URI converter; you can look at the various existing subclasses for design ideas.

Please don't post follow-up questions on the mailing list but rather start a thread on the forum.

On 28.12.2016 14:39, Delchev, Nedelcho wrote:
Hi EMF Developers,

Can you please help with an idea how to handle the issue below?
In general can we initialise EMF from an abstract resource (not from the local file system)? Do you have some examples on how to do this?

Thanks in advance!

Regards,
Nedelcho

From: SAP SAP <nedelcho.delchev@xxxxxxx>
Date: Friday, November 25, 2016 at 17:14
To: Amine Lajmi <aminelajmi@xxxxxxxxx>
Cc: "Pavlov, Georgi" <georgi.pavlov@xxxxxxx>, "Pavlov, Yordan" <yordan.pavlov@xxxxxxx>, Dimitar Panayotov <dimitar.panayotov@xxxxxxx>, "Atanasov, Momchil" <momchil.atanasov@xxxxxxx>, Markus Knauer <mknauer@xxxxxxxxxxxxxxxxx>
Subject: Re: About Web Editors

Hi Amine,

Wow!!! It looks really veeery nice! :)

For the EMF in the past we hacked something which @Momchil probably can recall. The major problem is as you described that EMF relies on the file system directly instead of the Resource API. I hope that this has been changed meanwhile, but I am not sure.
In general in Eclipse Dirigible you can use either Resource API (hacked version by us) or Repository API (own implementation) to access resources. The Repository itself could be Local (file-system based), DB (RDBMS implementation), Git (read-only as of now), etc. The Resource API in Dirigible is connected as a layer on top of the Repository API, hence follow the same channel for accessing the actual resources. We have to see what have to be done in EMF to allow this. Once we make it, we can open Dirigible for the whole world of EMF based plugins available.

@Markus, do you know somebody from EMF team that can jump in and help here?

Btw. Just an idea – can we provide a custom protocol handler for the URIs that we can use? Similar thing we had in the integration of the Groovy engine:

Regards,
Nedelcho

From: Amine Lajmi <aminelajmi@xxxxxxxxx>
Date: Friday, November 25, 2016 at 14:00
To: SAP SAP <nedelcho.delchev@xxxxxxx>
Cc: "Pavlov, Georgi" <georgi.pavlov@xxxxxxx>, "Pavlov, Yordan" <yordan.pavlov@xxxxxxx>, Dimitar Panayotov <dimitar.panayotov@xxxxxxx>
Subject: Re: About Web Editors

Hi Nedelcho,

First attempt, looks nice right ? :-)

Images
                              intégrées 1

I have however some issues with EMF integration: s there a way to access the local repository location ? I need it to be ble to create an URI as the EMF API needs to check if the file exists in the file system when the resource is created otherwise it throws an exception.

For now, I hacked it this way:

IFile file = ((SourceFileEditorInput) editorInput).getFile();
IWorkspace workspace = WorkspaceLocator.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
IPath locationRoot = root.getLocation();
String ROOT = "D:/dev/sap/eclipse/dirigible_local/root";
IPath total = new Path(ROOT).append(locationRoot).append(file.getFullPath());
URI x = URI.createFileURI(total.toString());
ResourceSet resourceSet = getDefaultResourceSet();
XtextResource result = (XtextResource) resourceSet.getResource(x, true);

Is there a better way to do it ?

Thanks,
Amine




_______________________________________________
emf-dev mailing list
emf-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/emf-dev


Back to the top