Interactive Ink

Import JIIX fails.

After succesfully exporting to JIIX format.  I try to turn around and import it but get ... 


Error, -[IINKEditor import_:data:block:error:]::476 invalid jiix data (incorrect elements count)


    NSError *error;

    NSString *contents = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];

    BOOL success = [self.editorViewController.editor import_: mimeTypeNumber.value data:contents block: nil error:&error];




  

{
 "type": "Diagram",
 "elements": [ {
   "type": "node",
   "id": 8,
   "bounding-box": {
    "x": 92.90303,
    "y": 42.295456,
    "width": 32.691666,
    "height": 20.087879
   },
   "range": "[0:0,0:98$]",
   "strokes": [ {
     "timestamp": "2017-11-07 04:10:23.539000",
     "X": [ 121.61212, 121.32349, 121.32349, 117.28258, 117.28258, 113.81894, 113.81894, 109.58561,
      109.58561, 104.775, 104.775, 101.11894, 98.136368, 96.500763, 96.500763, 95.538635,
      95.538635, 94.28788, 93.90303, 93.90303, 93.90303, 93.90303, 93.90303, 94.095459,
      94.095459, 96.115913, 97.943939, 100.63788, 100.63788, 105.73712, 111.50985, 111.50985,
      116.32046, 119.39925, 119.39925, 121.99697, 123.05531, 123.05531, 123.825, 124.11364,
      124.30606, 124.30606, 124.40228, 124.40228, 124.5947, 124.5947, 124.5947, 124.5947,
      124.5947, 124.5947, 124.5947, 124.5947, 124.5947, 124.5947, 124.30606, 124.30606,
      123.92121, 123.53637, 123.53637, 123.05531, 123.05531, 122.86288, 122.86288, 122.67046,
      122.57424, 122.57424, 122.57424, 122.47803, 122.38182, 122.38182, 122.28561, 122.28561,
      122.1894, 122.1894, 122.09319, 122.09319, 121.99697, 121.32349, 120.65, 120.65,
      120.26515, 119.8803, 119.8803, 119.59167, 119.59167, 119.49546, 119.20682, 119.20682,
      118.82197, 118.53333, 118.53333, 118.43713, 118.34091, 118.34091, 118.2447, 118.2447,
      118.14848, 118.14848, 118.14848 ],
     "Y": [ 44.257576, 44.35379, 44.35379, 44.35379, 44.35379, 44.35379, 44.35379, 44.35379,
      44.35379, 44.35379, 44.35379, 45.123486, 46.951515, 48.587124, 48.587124, 49.934093,
      49.934093, 52.724243, 54.359848, 55.706818, 55.706818, 56.957577, 56.957577, 58.689396,
      58.689396, 60.325001, 60.902275, 61.19091, 61.19091, 61.383335, 61.383335, 61.383335,
      60.70985, 59.651516, 59.651516, 58.400757, 57.823486, 57.823486, 57.053787, 56.861366,
      56.476517, 56.476517, 56.091667, 56.091667, 55.129547, 55.129547, 54.552273, 54.167427,
      54.167427, 53.975002, 53.975002, 53.782578, 53.782578, 53.686363, 53.301517, 53.301517,
      52.339394, 51.377274, 51.377274, 50.318939, 50.318939, 48.875759, 48.875759, 48.298485,
      47.913639, 47.721214, 47.721214, 47.52879, 47.52879, 47.52879, 47.52879, 47.52879,
      47.52879, 47.52879, 47.52879, 47.52879, 47.336365, 46.75909, 46.085606, 46.085606,
      45.70076, 45.31591, 45.31591, 45.123486, 45.123486, 44.931061, 44.642426, 44.642426,
      44.065151, 43.776516, 43.776516, 43.584091, 43.391666, 43.391666, 43.295456, 43.295456,
      43.295456, 43.295456, 43.295456 ],
     "F": [ 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0 ],
     "T": [ 0, 169, 169, 192, 192, 208, 208, 225,
      226, 273, 273, 324, 324, 324, 324, 354,
      354, 404, 404, 404, 404, 404, 404, 452,
      452, 507, 507, 507, 507, 537, 537, 537,
      588, 588, 588, 640, 640, 640, 691, 691,
      691, 691, 722, 722, 723, 723, 768, 768,
      768, 821, 821, 828, 828, 878, 878, 878,
      928, 928, 928, 929, 929, 959, 959, 1013,
      1013, 1013, 1013, 1061, 1061, 1061, 1112, 1112,
      1161, 1161, 1193, 1193, 1245, 1245, 1245, 1245,
      1297, 1297, 1297, 1348, 1348, 1378, 1378, 1378,
      1429, 1429, 1429, 1479, 1479, 1479, 1511, 1511,
      1562, 1562, 1612 ],
     "id": "000000000100c500ff00"
    } ],
   "kind": "ellipse",
   "cx": 109.31393,
   "cy": 52.853264,
   "rx": 16.021933,
   "ry": 8.9524441
  } ]
}

  

Dear Kenneth,

Thank you for contacting us.

We were able to reproduce on IOS (it does't occur on Android). We are currently working on it.

I keep you updated.

Best regards,

Olivier

Dear Olivier,

Just wondering if you had any updates.  Do you believe this is something that can be fixed quickly in a patch release of the runtime? 

Ken


Dear Kenneth,

after discussing internally, we have the following questions:
-Did you update your JIIX file?
-Are you trying to import on a new empty part?

Indeed, in the case of diagram:
-you should  only be able to use export/import on the same part.
-You should only be able to select a different TEXT candidate (in the case you have text in your diagram) and update the JIIX accordingly.
-You can then import the JIIX back to your diagram.

Any other use case does not work.

Best regards,

Olivier


-Did you update your JIIX file?

No

-Are you trying to import on a new empty part?

Yes, in this case. To test the import functionality I was exporting JIIX to file in Documents.  Stopping app, starting app, trying to import the exported JIIX file.  On startup, the app creates a new package, new empty part...so yes it is importing into not just a new part, a new package.

Indeed, in the case of diagram:
-you should  only be able to use export/import on the same part.

 The JIIX does not include part number in the specification.  So does this mean that this format cannot be used for restoring the diagram persisted on another system.  Say iPad user A creates diagram and saves JIIX in database.  iPad user B wants to import JIIX from database.  We want to apply business logic to JIIX on external system.   


-You should only be able to select a different TEXT candidate (in the case you have text in your diagram) and update the JIIX accordingly.

-You can then import the JIIX back to your diagram.


Does this mean that we can only modify text in JIIX? We cannot add new nodes, edges in JIIX, then import? 

Dear Kenneth,

Yes, in this case. To test the import functionality I was exporting JIIX to file in Documents.  Stopping app, starting app, trying to import the exported JIIX file.  On startup, the app creates a new package, new empty part...so yes it is importing into not just a new part, a new package.
>>For such purpose, you should use the IINKContentPackage::saveAs function to save the content package and later use the IINKEngine::openPackage function to re-open it.

Does this mean that we can only modify text in JIIX? We cannot add new nodes, edges in JIIX, then import?
>>exactly, the only update you can do is choosing a word candidate for the candidate list. Any other use wll not work.

Best regards,

Olivier
Login or Signup to post a comment