I have integrated xtext's orion editor in an iframe within my Angular application. I am facing a challenge where I need to save the edited content from my Angular application to a backend Java application. Can someone guide me on the API calls or approach that I should take from the Angular side to successfully save the content written in the editor?
Here is what I have attempted so far:
1. I tried extracting content from the iframe in my Angular application, but the data extracted was limited to what is only visible through the iframe and not the entire scrollable content.
2. I attempted to make 'save' API calls similar to those made by xtext during saving, but encountered a requirement for a stateId in the request body. I am looking for clarification on what this state Id represents and how it is generated.
The following code snippet demonstrates the call being made from my Angular application:
_this.saveEditor = function(args) {
var params = {
requiredStateId: args.stateId
}
_this.saveUrl = XTEXT_URL + '/save?resource=' + args.resourceId;
return $http({
method: 'POST',
url: _this.saveUrl,
data: params
});
};
The request body contains:
{"requiredStateId":"-80000000"}
The state Id mentioned above is obtained through a prior load API call which returns the state Id in its response.