Text

Answered

Error on importing JIIX data

Hello myscript team, 

After successfully exporting the Jiix data, and then, I am getting this error on importing the data.

https://developer.myscript.com/docs/interactive-ink/1.2/android/fundamentals/import-and-export/#jiix-import

I went through it but still getting this error.

java.lang.IllegalStateException: could not parse imported jiix, how to solve this ?



Best Answer

Dear Ghanendra,


Please make sure you replace both "label" fields:

 "label": "Thun",
 "words": [ {
   "label": "Thun",
   "candidates": [ "Geneva", "Thun", "Lucerne", "Sion" ],
   "bounding-box": {


Best regards,


Olivier


Dear Ghanendra,


Thank you for contacting us and your questions.


Currently, I am not sure to properly understand what you are trying to achieve:

-What does you export JIIX look like?

-Which changes did you do in in JIIX before importing it? You only updated the "label" with one of the candidates proposed? If so, there is no reason it doesn't work.


Please explain further, so that we understand what is not going one properly.


Best regards,


Olivier

Hello Olivier, this is how it looks like
Exported JIIX - File name - File1.jiix 
{
"type": "Text",
"bounding-box": {
"x": 13.634624,
"y": 34.706821,
"width": 31.917973,
"height": 12.194687
},
"label": "Geneva",
"words": [ {
"label": "Thun",
"candidates": [ "Geneva", "Thun", "Lucerne", "Sion" ],
"bounding-box": {
"x": 13.634624,
"y": 34.706821,
"width": 31.917973,
"height": 12.194687
}, Label name changed to one of candidate - "Thun" Do I have to keep "Geneva" as the label name And then I used this syntax to import the Jiix
String fileName = "File1.jiix"; File file = new File(getFilesDir().getPath() + File.separator + "tmp", fileName);
editor.import_(MimeType.JIIX, file.getPath(),editor.getRootBlock());
Is this systax is correct ? or we have to put "Geneva" as the string data , 2nd parameter to import function ?
Thanks
Ghanendra

Dear Ghanendra,


currently, please find the conditions that are mandatory to import JIIX data:


### JIIX import

JIIX import is so far limited to text words candidate changes. More import capabilities will be provided later on.

To change the text candidates within a given Text or Diagram block:

1. Export the block to the JIIX format.
2. Replace the `label` of the target `word` with another word **from the `candidates` list**.
3. Import the modified JIIX data back to your block.

Important : Importing JIIX data is only possible if the target block was not modified since it was exported.


In your particular case, can you confirm your target block was not modified in between export and import?


Best regards,


Olivier

Hello Olivier, 

Yes the target block was not modified.

Thanks

Answer

Dear Ghanendra,


Please make sure you replace both "label" fields:

 "label": "Thun",
 "words": [ {
   "label": "Thun",
   "candidates": [ "Geneva", "Thun", "Lucerne", "Sion" ],
   "bounding-box": {


Best regards,


Olivier