Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Javascript improvement

  1. #1
    Matt Casters Guest

    Default Javascript improvement

    Hi Kettle devs,

    It has come to my attention that the current implementations of Javascript
    (all versions) have problems with field names that contain spaces, dashes and
    other special characters. For obvious reasons these fields are not useable
    in JavaScript.

    I would propose to expose these fieldnames using underscores to replace these
    unwanted characters.

    Any objections?

    All the best,

    --
    Matt
    ____________________________________________
    Matt Casters, Chief Data Integration
    Pentaho, Open Source Business Intelligence
    http://www.pentaho.org -- mcasters (AT) pentaho (DOT) org
    Tel. +32 (0) 486 97 29 37

    --~--~---------~--~----~------------~-------~--~----~
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com
    To unsubscribe from this group, send email to kettle-developers-unsubscribe (AT) g...oups (DOT) com
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en
    -~----------~----~----~----~------~----~------~--~---

  2. #2
    Roland Bouman Guest

    Default Re: Javascript improvement

    Hi Matt,

    > I would propose to expose these fieldnames using underscores to replace these
    > unwanted characters.


    That could clash with other field names. I would probably avoid having
    those kinds of names anyway, but there may be a solution that
    preserves all names regardless. That is, I don't know if it is
    feasible or easy to implement, but I know that this type of syntax is
    valid:

    var inputs = {};
    o["name with spaces"] = 1;
    o["name-with-dahses"] = 2;

    or, more compact:

    var inputs = {
    "name with spaces": 1
    , "name-with-dashes": 2
    }

    So afterwards, you can refer to them as: inputs["name with spaces"]

    just an Idea - not a big deal for me if it would be replaced with underscores

    >
    > Any objections?
    >
    > All the best,
    >
    > --
    > Matt
    > ____________________________________________
    > Matt Casters, Chief Data Integration
    > Pentaho, Open Source Business Intelligence
    > http://www.pentaho.org -- mcasters (AT) pentaho (DOT) org
    > Tel. +32 (0) 486 97 29 37
    >
    > >

    >



    --
    Roland Bouman
    http://rpbouman.blogspot.com/

    --~--~---------~--~----~------------~-------~--~----~
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com
    To unsubscribe from this group, send email to kettle-developers-unsubscribe (AT) g...oups (DOT) com
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en
    -~----------~----~----~----~------~----~------~--~---

  3. #3
    Matt Casters Guest

    Default Re: Javascript improvement

    Hi Roland,

    You would have to populate these "Hash" tables for every row and as such I
    worry about the performance.

    FYI, the fields are now accessible through the compatible option:

    row.getString("name-with-spaces", "");

    Since we're doing the replacement only once for all rows that pass we can make
    the algorithm as complex as possible. As such we can give existing names
    precedence. I mean, what are the odds that such a condition pops up? :-)

    Thanks for your input, I'll stay away from it for the time being.

    All the best,

    Matt


    On Wednesday 22 August 2007 22:41:31 Roland Bouman wrote:
    > Hi Matt,
    >
    > > I would propose to expose these fieldnames using underscores to replace
    > > these unwanted characters.

    >
    > That could clash with other field names. I would probably avoid having
    > those kinds of names anyway, but there may be a solution that
    > preserves all names regardless. That is, I don't know if it is
    > feasible or easy to implement, but I know that this type of syntax is
    > valid:
    >
    > var inputs = {};
    > o["name with spaces"] = 1;
    > o["name-with-dahses"] = 2;
    >
    > or, more compact:
    >
    > var inputs = {
    > "name with spaces": 1
    > , "name-with-dashes": 2
    > }
    >
    > So afterwards, you can refer to them as: inputs["name with spaces"]
    >
    > just an Idea - not a big deal for me if it would be replaced with
    > underscores
    >
    > > Any objections?
    > >
    > > All the best,
    > >
    > > --
    > > Matt
    > > ____________________________________________
    > > Matt Casters, Chief Data Integration
    > > Pentaho, Open Source Business Intelligence
    > > http://www.pentaho.org -- mcasters (AT) pentaho (DOT) org
    > > Tel. +32 (0) 486 97 29 37




    --
    Matt
    ____________________________________________
    Matt Casters, Chief Data Integration
    Pentaho, Open Source Business Intelligence
    http://www.pentaho.org -- mcasters (AT) pentaho (DOT) org
    Tel. +32 (0) 486 97 29 37

    --~--~---------~--~----~------------~-------~--~----~
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com
    To unsubscribe from this group, send email to kettle-developers-unsubscribe (AT) g...oups (DOT) com
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en
    -~----------~----~----~----~------~----~------~--~---

  4. #4
    Roland Bouman Guest

    Default Re: Javascript improvement

    Hi Matt,

    > You would have to populate these "Hash" tables for every row and as such I
    > worry about the performance.


    True. I agree - performance is more important.
    >
    > FYI, the fields are now accessible through the compatible option:
    >
    > row.getString("name-with-spaces", "");


    Ok - well, that settles it for me

    >
    > Since we're doing the replacement only once for all rows that pass we can make
    > the algorithm as complex as possible. As such we can give existing names
    > precedence. I mean, what are the odds that such a condition pops up? :-)


    Indeed. Like I said, I would stay far away from strange names like that.
    >
    > Thanks for your input, I'll stay away from it for the time being.


    np - kind regards,

    Roland
    >
    > All the best,
    >
    > Matt
    >
    >
    > On Wednesday 22 August 2007 22:41:31 Roland Bouman wrote:
    > > Hi Matt,
    > >
    > > > I would propose to expose these fieldnames using underscores to replace
    > > > these unwanted characters.

    > >
    > > That could clash with other field names. I would probably avoid having
    > > those kinds of names anyway, but there may be a solution that
    > > preserves all names regardless. That is, I don't know if it is
    > > feasible or easy to implement, but I know that this type of syntax is
    > > valid:
    > >
    > > var inputs = {};
    > > o["name with spaces"] = 1;
    > > o["name-with-dahses"] = 2;
    > >
    > > or, more compact:
    > >
    > > var inputs = {
    > > "name with spaces": 1
    > > , "name-with-dashes": 2
    > > }
    > >
    > > So afterwards, you can refer to them as: inputs["name with spaces"]
    > >
    > > just an Idea - not a big deal for me if it would be replaced with
    > > underscores
    > >
    > > > Any objections?
    > > >
    > > > All the best,
    > > >
    > > > --
    > > > Matt
    > > > ____________________________________________
    > > > Matt Casters, Chief Data Integration
    > > > Pentaho, Open Source Business Intelligence
    > > > http://www.pentaho.org -- mcasters (AT) pentaho (DOT) org
    > > > Tel. +32 (0) 486 97 29 37

    >
    >
    >
    > --
    > Matt
    > ____________________________________________
    > Matt Casters, Chief Data Integration
    > Pentaho, Open Source Business Intelligence
    > http://www.pentaho.org -- mcasters (AT) pentaho (DOT) org
    > Tel. +32 (0) 486 97 29 37
    >
    > >

    >



    --
    Roland Bouman
    http://rpbouman.blogspot.com/

    --~--~---------~--~----~------------~-------~--~----~
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com
    To unsubscribe from this group, send email to kettle-developers-unsubscribe (AT) g...oups (DOT) com
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en
    -~----------~----~----~----~------~----~------~--~---

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.