Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • Blama
    replied
    Hi Isomorphic,

    thanks, this seems to be working for me using v12.0p_2019-02-24.

    Best regards
    Blama

    Leave a comment:


  • Blama
    replied
    Hi Isomorphic,

    thanks a lot. I'll report back once I have the time to change my code.

    Best regards
    Blama

    Leave a comment:


  • Isomorphic
    replied
    ImportDataSourceRecord(Map,...) and ImportToDataSource(Map,...) APIs are added and available in recent nightly builds.

    Leave a comment:


  • Isomorphic
    replied
    So, we are in sync ) Everything you wrote makes perfect sense and your assumption about escaping is correct - in order to use linefeed inside field value (read "inside a data row") you need to escape backslashes with "\\r". Yet it is simple to do, allowing Map would be a proper way and we are doing it, as mentioned earlier. Till then you may escape backslashes or use another import format.

    Leave a comment:


  • Blama
    replied
    FYI: Edited the post. As meta problem it seems that phpBB (or whatever runs the forum) has problems with \\ (backslashes) in data, at least when editing posts :)

    Leave a comment:


  • Blama
    replied
    Hi Isomorphic,

    answering in different order:
    Originally posted by Isomorphic View Post
    Regarding #3.2 (providing record as a Map instead of Reader to DataImport): do you expect that if we implement it, then this problem would automatically go away?
    Yes, expecting it to go away, because there is no escaping whatsoever, but only Java Map and no escaping or CSV/JSON/XML encode on my side and no CSV/JSON/XML decode on your side needed.

    Originally posted by Isomorphic View Post
    Are you talking about linefeeds inside field values? And the way DataImport is not working is that it treats those as new lines, which splits data into rows incorrectly and fails, right? We expect such linefeeds to be escaped. Also, do you get these values from some kind of tool? If so, we'd like to know what it is. Thank you.
    Yes, linefeeds in the field values. Data is self generated. I have a (pretty dumbed down, JSON would be better, but (perhaps) more difficult to generate for websites with forms) mail format that I import:
    Code:
    fieldname: value1;
    fieldname2: value2;
    fieldname3: value3;
    (with the requirement of no ; and : in the data). But for ease of mind, lets just assume it were JSON.
    I then build this from it:
    Code:
    fieldname;fieldname2;fieldname3
    "value1";"value2";"value3"
    and feed this to DataImport as CSV. DataImport is needed, as some of the fields need to go though DataImport's fK-value ->ID conversion. Otherwise I'd just use plain ADD.
    As you can see, I do have "value1" with quotes, which is what you mean by "We expect such linefeeds to be escaped" right?

    So an 1-row import with linefeeds could look like this:
    Code:
    fieldname;fieldname2;fieldname3
    "value1";"Some long data
    in
    field 2";"value3"
    .

    Or do you mean I should generated this instead by "We expect such linefeeds to be escaped"
    Code:
    fieldname;fieldname2;fieldname3
    "value1";"Some long data\r\nin\r\nfield 2";"value3"
    , so that it is always exactly 1 CSV row per data row?

    Then I'd also might have problems with "\" (escape it to "\\"?).
    This would also work for me for now and the change is easy on my side. But the correct way is using Java Map IMHO. Of course I could also build JSON or XML instead of CSV from the data, which is probably better, now that I think about it, but still, Java Map would be the one with basically no code needed.

    Best regards
    Blama
    Last edited by Blama; 18th Oct 2018, 02:12.

    Leave a comment:


  • Isomorphic
    replied
    Just to clarify if we understand #12 correctly. Please answer following questions.

    Are you talking about linefeeds inside field values? And the way DataImport is not working is that it treats those as new lines, which splits data into rows incorrectly and fails, right? We expect such linefeeds to be escaped. Also, do you get these values from some kind of tool? If so, we'd like to know what it is. Thank you.

    Regarding #3.2 (providing record as a Map instead of Reader to DataImport): do you expect that if we implement it, then this problem would automatically go away? Sorry for delay, we *are* going to implement this and will update this thread when we do.

    Leave a comment:


  • Blama
    replied
    Hi Isomorphic,

    #3 point 2 is indeed necessary, more a bug than an enhancement if you want to upload data that includes linefeeds (\r, \n, \r\n). If you do this now like convertToCSV() in #3 this will fail if you have linefeeds (because it seems like a new data row in the CSV). This is the one where you write "in progress" in #10.
    Linefeeds are perfectly fine in data IMHO and must be converted to <br> at display time if you want to respect them in a label. This is also working as expected when entering them in a TextAreaItem. But they don't work if you need to use DataImport.

    Best regards
    Blama

    Leave a comment:


  • Blama
    replied
    Hi Isomorphic,

    thanks. I can see that #3.1 is fixed and also the advice for #3.3 in the SmartGWT docs to look here.

    I'll wait for an update of #3.2 and perhaps #3.4 then.

    Best regards
    Blama

    Leave a comment:


  • Isomorphic
    replied
    Apologies for the delay, we are addressing issues you listed in #3 (same order as in your post):
    • fixed
    • this suggestion is in progress and will be reported here when it's done
    • we've added XML and JSON formats to the DataImport docs with the reference to format descriptions and samples in Smartclient Reference
    • taken into consideration

    Leave a comment:


  • Blama
    replied
    Hi Isomorphic,

    I can see that #1 and #2 are fixed using v11.1p_2017-12-27. Do you have any further information on #3?

    Thank you & Best regards
    Blama

    Leave a comment:


  • Isomorphic
    replied
    Issues #1 and #2 are fixed and are available for download in nightly builds since Dec 15 (today). Issues from #3 are in progress, thank you for your patience.

    Leave a comment:


  • Isomorphic
    replied
    No updates yet, they will be posted here when we have them.

    Leave a comment:


  • Blama
    replied
    Hi Isomorphic,

    do you have an update on this one?

    Thank you & Best regards
    Blama

    Leave a comment:


  • Isomorphic
    replied
    These issues are assigned. It's definitely a bug that queueStatus would appear twice; we haven't looked deeply enough into the others to say yet.

    Leave a comment:

Working...
X