[08:57] <nmicoud> and while you're around : wdyt of https://groups.google.com/forum/#!topic/idempiere/KG2vAwYM7g8 ? [08:58] <JanThielemann> i'm not sure because i don't understand it [08:59] <JanThielemann> when is this used? [08:59] <JanThielemann> in your custom editor? [08:59] <nmicoud> for every field where reference is Number [08:59] <nmicoud> as there is no default for this kind of field, DisplayType search in plugins [09:00] *** KermitTheFragger a rejoint #idempiere [09:00] <JanThielemann> so when i have a plain number field you think it should use this method? [09:00] <JanThielemann> but it isn't used? [09:00] <nmicoud> and in my plugin i did not write if (displayType == myDisplayType)
so, my custom was used [09:01] <nmicoud> not a plain number, only number (like rate) [09:01] <JanThielemann> rates are covered by amount, costprice or quantity i think [09:01] <JanThielemann> and for default numbers if (locale != null) [09:01] <JanThielemann> format = (DecimalFormat)NumberFormat.getNumberInstance(locale); [09:01] <JanThielemann> else [09:01] <JanThielemann> format = (DecimalFormat)NumberFormat.getNumberInstance(Locale.US); [09:01] <JanThielemann> is used [09:02] <nmicoud> but format is then overwritten [09:03] <nmicoud> there is if integer, if qty, if amount, etc [09:03] <nmicoud> but there is no 'if number' [09:03] <nmicoud> it's not clearly defined [09:03] <Not-c6cb> [IDEMPIERE] tsvikruha updated [09:03] <Not-c6cb> [IDEMPIERE] Hi , do you know if anybody started with util class to validate read-only sql syntax? I think that actual fix is very limiting - how can i call web service with condition? For example i have WS for exporting products and i want to filter by product category or tax group. Maybe is enought if sql select doesn't include any of INSERT, UPDATE, DELETE, DROP, CREATE or ALTER commands. [09:03] <Not-c6cb> [IDEMPIERE] http://idempiere.atlassian.net/browse/IDEMPIERE-1784 [09:07] <JanThielemann> hmm [09:08] <JanThielemann> have you implemented your usggestion and if yes how does it behave in the application? [09:08] <JanThielemann> did you notice any changes? [09:08] *** infoder a rejoint #idempiere [09:08] <nmicoud> no, i just fix my plugin [09:08] <nmicoud> it works [09:08] <JanThielemann> i can imagine that if you use number as reference, it uses the number as it is in the database [09:08] <JanThielemann> if i get it right, the format can cut of fraction digits [09:08] <JanThielemann> which you might not want [09:09] <nmicoud> yes, in my case, 8,5 was displayed as 8 [09:09] <JanThielemann> instead display the number as it is stored in the db with the maximum of fraction digits the db supports [09:09] <JanThielemann> when using number 8,5 was 8? [09:09] <JanThielemann> let me validate [09:09] <nmicoud> ok [09:09] <JanThielemann> wait, in your custom editor? [09:09] <JanThielemann> or in the default number editor? [09:10] <nmicoud> i fix only my custom editor [09:10] <JanThielemann> so the default editor should show me 8 instead of 8,5? [09:10] <nmicoud> default should show 8,5 (same as in database) [09:12] <infoder> i get this error when i try to build my own plugin in jenkins [09:12] <infoder> Target /var/lib/jenkins/workspace/iDempiereCusto/MyCustom/build-target-platform.target has no containers [09:12] <infoder> where i user separate mercurial repository [09:15] <JanThielemann> ahhh [09:15] <JanThielemann> so have you implemented the IDisplayType? [09:15] <JanThielemann> and return your own number format? [09:15] <nmicoud> yep [09:16] <nmicoud> i made a newbie error [09:16] <JanThielemann> maybe the "format = (DecimalFormat)NumberFormat.getNumberInstance(locale);" is the problem :/ [09:17] <JanThielemann> because if you don't return your own format, the dfault format is used but in the last else statement: [09:17] <JanThielemann> format.setMaximumIntegerDigits(MAX_DIGITS); [09:17] <JanThielemann> format.setMaximumFractionDigits(MAX_FRACTION); [09:17] <JanThielemann> format.setMinimumFractionDigits(1); [09:17] <JanThielemann> is applied [09:17] <nmicoud> no, seems correct. i think we should just avoid to check in a plugin for a format which is related to a 'core' reference [09:18] <JanThielemann> yes [09:18] <JanThielemann> of course [09:18] <nmicoud> this is true for all reference but Number [09:18] <JanThielemann> you should only check for your custom displaytypes [09:18] <nmicoud> yes [09:18] <nmicoud> and it was my first (and only one) custom type, i did not think to add this check [09:19] <nmicoud> and this gives the descrbied issue [09:19] <JanThielemann> ahh you did forgot to check for your custom display type so your format was returned for number because there is no explicit check for number in the DisplayType.getNumberFormat, right? [09:20] <nmicoud> yes [09:20] <JanThielemann> now i understand xD [09:20] <nmicoud> yes, it was not really clear [09:20] <JanThielemann> okay [09:21] <JanThielemann> i'll write a response [09:21] <JanThielemann> can you create a ticket? [09:21] <JanThielemann> I'll vote for it [09:21] <nmicoud> sure
Environment
None
Activity
Show:
Carlos Ruiz July 27, 2018 at 4:13 PM
Closing as potential idea
Jan Thielemann October 2, 2014 at 7:36 AM
I think it is good to make a check for at least every core display type (so add the number because there is no explicit check yet). However, it is very important to check for your custom display type in IDisplayTypeFactory.getNumberFormat since you otherwise could overwrite the number format for every other custom editor provided by other plugins!
Following https://groups.google.com/forum/#!topic/idempiere/KG2vAwYM7g8
and I talked on IRC :
[08:57] <nmicoud> and while you're around : wdyt of https://groups.google.com/forum/#!topic/idempiere/KG2vAwYM7g8 ?
[08:58] <JanThielemann> i'm not sure because i don't understand it
[08:59] <JanThielemann> when is this used?
[08:59] <JanThielemann> in your custom editor?
[08:59] <nmicoud> for every field where reference is Number
[08:59] <nmicoud> as there is no default for this kind of field, DisplayType search in plugins
[09:00] *** KermitTheFragger a rejoint #idempiere
[09:00] <JanThielemann> so when i have a plain number field you think it should use this method?
[09:00] <JanThielemann> but it isn't used?
[09:00] <nmicoud> and in my plugin i did not write
if (displayType == myDisplayType)
so, my custom was used
[09:01] <nmicoud> not a plain number, only number (like rate)
[09:01] <JanThielemann> rates are covered by amount, costprice or quantity i think
[09:01] <JanThielemann> and for default numbers if (locale != null)
[09:01] <JanThielemann> format = (DecimalFormat)NumberFormat.getNumberInstance(locale);
[09:01] <JanThielemann> else
[09:01] <JanThielemann> format = (DecimalFormat)NumberFormat.getNumberInstance(Locale.US);
[09:01] <JanThielemann> is used
[09:02] <nmicoud> but format is then overwritten
[09:03] <nmicoud> there is if integer, if qty, if amount, etc
[09:03] <nmicoud> but there is no 'if number'
[09:03] <nmicoud> it's not clearly defined
[09:03] <Not-c6cb> [IDEMPIERE] tsvikruha updated
[09:03] <Not-c6cb> [IDEMPIERE] Hi , do you know if anybody started with util class to validate read-only sql syntax? I think that actual fix is very limiting - how can i call web service with condition? For example i have WS for exporting products and i want to filter by product category or tax group. Maybe is enought if sql select doesn't include any of INSERT, UPDATE, DELETE, DROP, CREATE or ALTER commands.
[09:03] <Not-c6cb> [IDEMPIERE] http://idempiere.atlassian.net/browse/IDEMPIERE-1784
[09:07] <JanThielemann> hmm
[09:08] <JanThielemann> have you implemented your usggestion and if yes how does it behave in the application?
[09:08] <JanThielemann> did you notice any changes?
[09:08] *** infoder a rejoint #idempiere
[09:08] <nmicoud> no, i just fix my plugin
[09:08] <nmicoud> it works
[09:08] <JanThielemann> i can imagine that if you use number as reference, it uses the number as it is in the database
[09:08] <JanThielemann> if i get it right, the format can cut of fraction digits
[09:08] <JanThielemann> which you might not want
[09:09] <nmicoud> yes, in my case, 8,5 was displayed as 8
[09:09] <JanThielemann> instead display the number as it is stored in the db with the maximum of fraction digits the db supports
[09:09] <JanThielemann> when using number 8,5 was 8?
[09:09] <JanThielemann> let me validate
[09:09] <nmicoud> ok
[09:09] <JanThielemann> wait, in your custom editor?
[09:09] <JanThielemann> or in the default number editor?
[09:10] <nmicoud> i fix only my custom editor
[09:10] <JanThielemann> so the default editor should show me 8 instead of 8,5?
[09:10] <nmicoud> default should show 8,5 (same as in database)
[09:12] <infoder> i get this error when i try to build my own plugin in jenkins
[09:12] <infoder> Target /var/lib/jenkins/workspace/iDempiereCusto/MyCustom/build-target-platform.target has no containers
[09:12] <infoder> where i user separate mercurial repository
[09:15] <JanThielemann> ahhh
[09:15] <JanThielemann> so have you implemented the IDisplayType?
[09:15] <JanThielemann> and return your own number format?
[09:15] <nmicoud> yep
[09:16] <nmicoud> i made a newbie error
[09:16] <JanThielemann> maybe the "format = (DecimalFormat)NumberFormat.getNumberInstance(locale);" is the problem :/
[09:17] <JanThielemann> because if you don't return your own format, the dfault format is used but in the last else statement:
[09:17] <JanThielemann> format.setMaximumIntegerDigits(MAX_DIGITS);
[09:17] <JanThielemann> format.setMaximumFractionDigits(MAX_FRACTION);
[09:17] <JanThielemann> format.setMinimumFractionDigits(1);
[09:17] <JanThielemann> is applied
[09:17] <nmicoud> no, seems correct.
i think we should just avoid to check in a plugin for a format which is related to a 'core' reference
[09:18] <JanThielemann> yes
[09:18] <JanThielemann> of course
[09:18] <nmicoud> this is true for all reference but Number
[09:18] <JanThielemann> you should only check for your custom displaytypes
[09:18] <nmicoud> yes
[09:18] <nmicoud> and it was my first (and only one) custom type, i did not think to add this check
[09:19] <nmicoud> and this gives the descrbied issue
[09:19] <JanThielemann> ahh you did forgot to check for your custom display type so your format was returned for number because there is no explicit check for number in the DisplayType.getNumberFormat, right?
[09:20] <nmicoud> yes
[09:20] <JanThielemann> now i understand xD
[09:20] <nmicoud> yes, it was not really clear
[09:20] <JanThielemann> okay
[09:21] <JanThielemann> i'll write a response
[09:21] <JanThielemann> can you create a ticket?
[09:21] <JanThielemann> I'll vote for it
[09:21] <nmicoud> sure