|
|
Re: start EVL validation from wizard [message #1682292 is a reply to message #1681763] |
Tue, 17 March 2015 17:27 |
Florian Haupt Messages: 5 Registered: February 2015 |
Junior Member |
|
|
Hi Dimitris,
thanks for the fast feedback.
If I create a tool, who will call it? The ETL transformation?
You suggested to run the validation programmatically using:
ValidateAction.runValidation((View) document.getContent());
Where do I get the View (or IDocument) object from if I put this code into a tool (and not into the DocumentProvider class)?
If I understand correctly, the use of a View indicates a dependency to GMF, i.e. to a graphical editor. What I currently do is independent of GMF, maybe this is my main problem. Let me show some code snippets:
public class MyHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IFile selectedFile = ...;
fileURI = selectedFile.getLocationURI().toString();
// TODO validate model here
// open a SaveAs dialog for the target file
...
// run a wizard to ask the user for some transformation parameters
...
// run the transformation
ETLExecutor executor = new ETLExecutor(MODEL_NAME, ETL_SCRIPT_LOCATION);
...
executor.execute();
}
}
The handler is activated when right-clicking on a EMF model file (that has been created using a GMF editor). Before processing the file I want to validate it, this is what my question was about. After that (this is already working) the user is asked for a target file and some parameters and the ETL transformation is executed.
I can load the EMF model from the file using the following code:
EmfModel model = EmfModelFactory.getInstance().loadEmfModel(MODEL_NAME, file, MODEL_NS, AccessMode.READ_ONLY);
Is there any chance to execute a EVL validation on this model without having the model opened in a GMF editor?
Thanks and regards
Florian
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03359 seconds