Add a duration field type to improve input and representation of durations: DurationField, allows to show and input *d *h *m *s *ms
----------------------------------------------------------------------------------------------------------------------------------- Key: OFBIZ-3125 URL: https://issues.apache.org/jira/browse/OFBIZ-3125 Project: OFBiz Issue Type: Improvement Components: framework Affects Versions: SVN trunk Reporter: Karim Rahimpur Priority: Minor Is there interest in having a field that can parse and display durations expressed like these? - 10d 5h 6m - 6m 45s - 1s 145ms If so, then I can provide that. We're using this to handle durations as humans are used to, instead of having to see and express them in milliseconds. E.g. durations used in production runs: an operator knows it took so many hours to complete a task but it's uncomfortable to have to convert that to milliseconds when you want to store that data. So if there is enough interest I could provide a patch that adds a DurationField which can be used in forms like shown in these examples: - A field that displays a duration in the *d *h *m *s *ms format - this is a substitute for <display/> in milliseconds: {code:xml} <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"> <duration disabled="true"/> </field> {code} - A field that allows to input a duration in the *d *h *m *s *ms format - this is a substitute for <text/> input in milliseconds: {code:xml} <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"> <duration/> </field> {code} Comments are welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-3125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12771438#action_12771438 ] Adrian Crum commented on OFBIZ-3125: ------------------------------------ Have you seen the duration lookup in Work Effort - https://demo.ofbiz.org/workeffort/control/EditWorkEffort?workEffortId=9202 Having a duration field would be nice, but I'm not sure how that would work - since the value passed in the parameter must be in milliseconds. Even better would be to have a duration data type that could be used throughout the framework. > Add a duration field type to improve input and representation of durations: DurationField, allows to show and input *d *h *m *s *ms > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-3125 > URL: https://issues.apache.org/jira/browse/OFBIZ-3125 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Karim Rahimpur > Priority: Minor > Original Estimate: 24h > Remaining Estimate: 24h > > Is there interest in having a field that can parse and display durations expressed like these? > - 10d 5h 6m > - 6m 45s > - 1s 145ms > If so, then I can provide that. We're using this to handle durations as humans are used to, instead of having to see and express them in milliseconds. E.g. durations used in production runs: an operator knows it took so many hours to complete a task but it's uncomfortable to have to convert that to milliseconds when you want to store that data. > So if there is enough interest I could provide a patch that adds a DurationField which can be used in forms like shown in these examples: > - A field that displays a duration in the *d *h *m *s *ms format - this is a substitute for <display/> in milliseconds: > {code:xml} > <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"> > <duration disabled="true"/> > </field> > {code} > - A field that allows to input a duration in the *d *h *m *s *ms format - this is a substitute for <text/> input in milliseconds: > {code:xml} > <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"> > <duration/> > </field> > {code} > Comments are welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12771926#action_12771926 ] Karim Rahimpur commented on OFBIZ-3125: --------------------------------------- The lookup is an option but its not very comfortable: you still only see milliseconds. Imagine a production manager who has to check if tasks are performed in due time, review 150 tasks daily and have your calculator ready to convert from milliseconds to hours each time you take a look at a task ... it's just impractical. That's why we created the duration field, which is a view on the milliseconds that are stored. The parameter is still the same - milliseconds - but your view is expressed in *d *h *m ... and your input format is also that. So with that, at least where we use it, there is no need for a special duration data type. Also there would have to be quite a lot of changes made to production and work effort if we wanted to introduce a duration type there. > Add a duration field type to improve input and representation of durations: DurationField, allows to show and input *d *h *m *s *ms > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-3125 > URL: https://issues.apache.org/jira/browse/OFBIZ-3125 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Karim Rahimpur > Priority: Minor > Original Estimate: 24h > Remaining Estimate: 24h > > Is there interest in having a field that can parse and display durations expressed like these? > - 10d 5h 6m > - 6m 45s > - 1s 145ms > If so, then I can provide that. We're using this to handle durations as humans are used to, instead of having to see and express them in milliseconds. E.g. durations used in production runs: an operator knows it took so many hours to complete a task but it's uncomfortable to have to convert that to milliseconds when you want to store that data. > So if there is enough interest I could provide a patch that adds a DurationField which can be used in forms like shown in these examples: > - A field that displays a duration in the *d *h *m *s *ms format - this is a substitute for <display/> in milliseconds: > {code:xml} > <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"> > <duration disabled="true"/> > </field> > {code} > - A field that allows to input a duration in the *d *h *m *s *ms format - this is a substitute for <text/> input in milliseconds: > {code:xml} > <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"> > <duration/> > </field> > {code} > Comments are welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12771961#action_12771961 ] Adrian Crum commented on OFBIZ-3125: ------------------------------------ I don't think it would be that hard to implement a duration data type. The entity engine, mini-lang, and screen widgets could be modified to accept TimeDuration instances. > Add a duration field type to improve input and representation of durations: DurationField, allows to show and input *d *h *m *s *ms > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-3125 > URL: https://issues.apache.org/jira/browse/OFBIZ-3125 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Karim Rahimpur > Priority: Minor > Original Estimate: 24h > Remaining Estimate: 24h > > Is there interest in having a field that can parse and display durations expressed like these? > - 10d 5h 6m > - 6m 45s > - 1s 145ms > If so, then I can provide that. We're using this to handle durations as humans are used to, instead of having to see and express them in milliseconds. E.g. durations used in production runs: an operator knows it took so many hours to complete a task but it's uncomfortable to have to convert that to milliseconds when you want to store that data. > So if there is enough interest I could provide a patch that adds a DurationField which can be used in forms like shown in these examples: > - A field that displays a duration in the *d *h *m *s *ms format - this is a substitute for <display/> in milliseconds: > {code:xml} > <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"> > <duration disabled="true"/> > </field> > {code} > - A field that allows to input a duration in the *d *h *m *s *ms format - this is a substitute for <text/> input in milliseconds: > {code:xml} > <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"> > <duration/> > </field> > {code} > Comments are welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772060#action_12772060 ] Karim Rahimpur commented on OFBIZ-3125: --------------------------------------- Sure that would be an option as well. I think it would have been quite a lot more work though, let me explain roughly what we had to do to implement the DurationField: - ModelFormField.java : add the DurationField class, basically a modified TextField - *Renderer.java : implement renderDurationField(...) - change the *Forms.xml where we want durations to appear, e.g. ProductionRunForms.xml The other thing is that if you decide to use something like a TimeDuration there would have to be changes in the data model where that type should be used, and changes would also require functions to update etc. > Add a duration field type to improve input and representation of durations: DurationField, allows to show and input *d *h *m *s *ms > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-3125 > URL: https://issues.apache.org/jira/browse/OFBIZ-3125 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Karim Rahimpur > Priority: Minor > Original Estimate: 24h > Remaining Estimate: 24h > > Is there interest in having a field that can parse and display durations expressed like these? > - 10d 5h 6m > - 6m 45s > - 1s 145ms > If so, then I can provide that. We're using this to handle durations as humans are used to, instead of having to see and express them in milliseconds. E.g. durations used in production runs: an operator knows it took so many hours to complete a task but it's uncomfortable to have to convert that to milliseconds when you want to store that data. > So if there is enough interest I could provide a patch that adds a DurationField which can be used in forms like shown in these examples: > - A field that displays a duration in the *d *h *m *s *ms format - this is a substitute for <display/> in milliseconds: > {code:xml} > <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"> > <duration disabled="true"/> > </field> > {code} > - A field that allows to input a duration in the *d *h *m *s *ms format - this is a substitute for <text/> input in milliseconds: > {code:xml} > <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"> > <duration/> > </field> > {code} > Comments are welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772220#action_12772220 ] Adrian Crum commented on OFBIZ-3125: ------------------------------------ Using the TimeDuration class would be the most appropriate thing to do - especially since we are building out the HR and Project Management components. The data type would still be stored as a double - so it is backwards compatible: {code} <field-type-def type="duration" sql-type="Double" java-type="org.ofbiz.base.util.TimeDuration"><validate method="isSignedDouble"/></field-type-def> {code} GenericEntity and ObjectType.simpleTypeConvert(...) can be updated to perform the various conversions to/from TimeDuration. Doing it this way might eliminate the need for modifying form widgets and rendering code. Plus, the framework would make handling time durations easier by doing conversions automatically. > Add a duration field type to improve input and representation of durations: DurationField, allows to show and input *d *h *m *s *ms > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-3125 > URL: https://issues.apache.org/jira/browse/OFBIZ-3125 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Karim Rahimpur > Priority: Minor > Original Estimate: 24h > Remaining Estimate: 24h > > Is there interest in having a field that can parse and display durations expressed like these? > - 10d 5h 6m > - 6m 45s > - 1s 145ms > If so, then I can provide that. We're using this to handle durations as humans are used to, instead of having to see and express them in milliseconds. E.g. durations used in production runs: an operator knows it took so many hours to complete a task but it's uncomfortable to have to convert that to milliseconds when you want to store that data. > So if there is enough interest I could provide a patch that adds a DurationField which can be used in forms like shown in these examples: > - A field that displays a duration in the *d *h *m *s *ms format - this is a substitute for <display/> in milliseconds: > {code:xml} > <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"> > <duration disabled="true"/> > </field> > {code} > - A field that allows to input a duration in the *d *h *m *s *ms format - this is a substitute for <text/> input in milliseconds: > {code:xml} > <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"> > <duration/> > </field> > {code} > Comments are welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773064#action_12773064 ] Karim Rahimpur commented on OFBIZ-3125: --------------------------------------- Actually our focus is not so much on these components but more on production. Anyhow, how would one go about representing this data? If you want to represent durations in the *d *h ... format you would still need field renderers that can handle both input and visualization appropriately. I'm not saying I dislike the TimeDuration approach you propose but in the approach I offered, I'm more concerned with handling/representing data as it is defined now than trying to redefine the model. > Add a duration field type to improve input and representation of durations: DurationField, allows to show and input *d *h *m *s *ms > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-3125 > URL: https://issues.apache.org/jira/browse/OFBIZ-3125 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Karim Rahimpur > Priority: Minor > Original Estimate: 24h > Remaining Estimate: 24h > > Is there interest in having a field that can parse and display durations expressed like these? > - 10d 5h 6m > - 6m 45s > - 1s 145ms > If so, then I can provide that. We're using this to handle durations as humans are used to, instead of having to see and express them in milliseconds. E.g. durations used in production runs: an operator knows it took so many hours to complete a task but it's uncomfortable to have to convert that to milliseconds when you want to store that data. > So if there is enough interest I could provide a patch that adds a DurationField which can be used in forms like shown in these examples: > - A field that displays a duration in the *d *h *m *s *ms format - this is a substitute for <display/> in milliseconds: > {code:xml} > <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"> > <duration disabled="true"/> > </field> > {code} > - A field that allows to input a duration in the *d *h *m *s *ms format - this is a substitute for <text/> input in milliseconds: > {code:xml} > <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"> > <duration/> > </field> > {code} > Comments are welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773124#action_12773124 ] Adrian Crum commented on OFBIZ-3125: ------------------------------------ I understand your focus is on production. I'm trying to make the point that production is not the only place where durations would be used - so let's try to look at the bigger picture so that we can come up with the best design. I spent some time over the weekend looking into this further. Now I'm convinced even more that we need a duration data type. Right now different entities are using different data types for durations - so there is no consistency. I would recommend entering durations as yyyy:mm:dd:hh:mm:ss:mm. I'm working on improving the TimeDuration class - it will be able to parse a string in that format. It parses right-to-left so you only need to enter the least significant portions. It will also decode the various numeric representations currently in use. As I mentioned before, if we modify the framework to support durations, then there will be less work handling/representing them. I should have some improvements committed in the next few days. > Add a duration field type to improve input and representation of durations: DurationField, allows to show and input *d *h *m *s *ms > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-3125 > URL: https://issues.apache.org/jira/browse/OFBIZ-3125 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Karim Rahimpur > Priority: Minor > Original Estimate: 24h > Remaining Estimate: 24h > > Is there interest in having a field that can parse and display durations expressed like these? > - 10d 5h 6m > - 6m 45s > - 1s 145ms > If so, then I can provide that. We're using this to handle durations as humans are used to, instead of having to see and express them in milliseconds. E.g. durations used in production runs: an operator knows it took so many hours to complete a task but it's uncomfortable to have to convert that to milliseconds when you want to store that data. > So if there is enough interest I could provide a patch that adds a DurationField which can be used in forms like shown in these examples: > - A field that displays a duration in the *d *h *m *s *ms format - this is a substitute for <display/> in milliseconds: > {code:xml} > <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"> > <duration disabled="true"/> > </field> > {code} > - A field that allows to input a duration in the *d *h *m *s *ms format - this is a substitute for <text/> input in milliseconds: > {code:xml} > <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"> > <duration/> > </field> > {code} > Comments are welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-3125: ------------------------------- Attachment: WorkEffortDurationExample.patch I committed some preliminary work in rev 832574. You can use the TimeDuration class as a data type in service calls, and some limited support has been added to the entity engine. The entity-auto stuff doesn't work yet - that will require some more work in the Java SQL code. I have attached a patch that demonstrates the duration feature in the Edit Work Effort screen. Feel free to develop a duration form field widget for it. > Add a duration field type to improve input and representation of durations: DurationField, allows to show and input *d *h *m *s *ms > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-3125 > URL: https://issues.apache.org/jira/browse/OFBIZ-3125 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Karim Rahimpur > Priority: Minor > Attachments: WorkEffortDurationExample.patch > > Original Estimate: 24h > Remaining Estimate: 24h > > Is there interest in having a field that can parse and display durations expressed like these? > - 10d 5h 6m > - 6m 45s > - 1s 145ms > If so, then I can provide that. We're using this to handle durations as humans are used to, instead of having to see and express them in milliseconds. E.g. durations used in production runs: an operator knows it took so many hours to complete a task but it's uncomfortable to have to convert that to milliseconds when you want to store that data. > So if there is enough interest I could provide a patch that adds a DurationField which can be used in forms like shown in these examples: > - A field that displays a duration in the *d *h *m *s *ms format - this is a substitute for <display/> in milliseconds: > {code:xml} > <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"> > <duration disabled="true"/> > </field> > {code} > - A field that allows to input a duration in the *d *h *m *s *ms format - this is a substitute for <text/> input in milliseconds: > {code:xml} > <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"> > <duration/> > </field> > {code} > Comments are welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum reassigned OFBIZ-3125: ---------------------------------- Assignee: Adrian Crum > Add a duration field type to improve input and representation of durations: DurationField, allows to show and input *d *h *m *s *ms > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-3125 > URL: https://issues.apache.org/jira/browse/OFBIZ-3125 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Karim Rahimpur > Assignee: Adrian Crum > Priority: Minor > Attachments: WorkEffortDurationExample.patch > > Original Estimate: 24h > Remaining Estimate: 24h > > Is there interest in having a field that can parse and display durations expressed like these? > - 10d 5h 6m > - 6m 45s > - 1s 145ms > If so, then I can provide that. We're using this to handle durations as humans are used to, instead of having to see and express them in milliseconds. E.g. durations used in production runs: an operator knows it took so many hours to complete a task but it's uncomfortable to have to convert that to milliseconds when you want to store that data. > So if there is enough interest I could provide a patch that adds a DurationField which can be used in forms like shown in these examples: > - A field that displays a duration in the *d *h *m *s *ms format - this is a substitute for <display/> in milliseconds: > {code:xml} > <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"> > <duration disabled="true"/> > </field> > {code} > - A field that allows to input a duration in the *d *h *m *s *ms format - this is a substitute for <text/> input in milliseconds: > {code:xml} > <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"> > <duration/> > </field> > {code} > Comments are welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |