You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Olivier Heintz (JIRA)" <ji...@apache.org> on 2012/07/02 12:42:22 UTC

[jira] [Created] (OFBIZ-4949) add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file

Olivier Heintz created OFBIZ-4949:
-------------------------------------

             Summary: add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file
                 Key: OFBIZ-4949
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
             Project: OFBiz
          Issue Type: Sub-task
          Components: framework
    Affects Versions: SVN trunk
            Reporter: Olivier Heintz
            Priority: Minor


This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.

For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).

This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file

Posted by "Paul Foxworthy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13499601#comment-13499601 ] 

Paul Foxworthy commented on OFBIZ-4949:
---------------------------------------

Hi all,

I think there's two fundamental problems with the patch. The core are these lines:

+                    for (String fieldName : currentEntity.getAllFieldNames() ){
+                        if (   ! ModelEntity.STAMP_FIELD.equals(fieldName)        && ! ModelEntity.STAMP_TX_FIELD.equals(fieldName)
+                            && ! ModelEntity.CREATE_STAMP_FIELD.equals(fieldName) && ! ModelEntity.CREATE_STAMP_TX_FIELD.equals(fieldName)
+                            && currentValue.get(fieldName) == null ) {
+                                currentValue.set(fieldName, null);
+                        }
+                    }

Problem 1: Won't this code replace a null with a null? I suspect line 4 was intended to be
+                            && currentValue.get(fieldName) != null ) {

Problem 2: Won't *every* attribute be overwritten with a null, even those where we read a new value from the file a moment earlier? I think we can't just use getAllFieldNames - rather we would need to identify the fields untouched by data from the file.

Am I missing something?

Thanks

Paul Foxworthy


                
> Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OFBIZ-4949) add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file

Posted by "Paul Foxworthy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407674#comment-13407674 ] 

Paul Foxworthy commented on OFBIZ-4949:
---------------------------------------

Hi Olivier,

I'd prefer the name setOtherFieldsToNull. What do you think?

Cheers

Paul Foxworthy


                
> add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, nullify-absent-fields

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501352#comment-13501352 ] 

Jacques Le Roux commented on OFBIZ-4949:
----------------------------------------

Indeed #3 sounds good to me too, flexible and powerful.
Even better when suggested by Jacopo ;), thanks!
                
> Add a new attribute for entity-engine-xml tag, nullify-absent-fields
> --------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> When you are first importing new data, quite naturally all fields other than those specified in the file will be null. If, however, you're updating existing data, you might want any field not specified in the file to retain its current value, or you might want the contents of the file to specify everything about a record, in other words "take this data and null out the rest". The alternative to set-other-fields-to-null (or whatever else we  might call it) would be a huge number of attribute="" in the file.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file

Posted by "Nicolas Malin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Malin updated OFBIZ-4949:
---------------------------------

    Attachment: OFBIZ-4949-NMA.patch

Hi,

I check this patch with your comments (Jira and mailing list) and I propose an other version (suffised by -NMA)

I correct java syntax
Change algo to resolve fields
Change variable name on Paul proposition

Adrian, I try to load UEL but without context, It's necessary to change some method's signature to propagate the loading data context, so I prefer see this point later. However, it's true that it would be a nice feature 


                
> Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OFBIZ-4949) add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file

Posted by "Olivier Heintz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Heintz updated OFBIZ-4949:
----------------------------------

    Attachment: OFBIZ-4949.patch

same as previous, but without error ;-)
                
> add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, nullify-absent-fields

Posted by "Jacopo Cappellato (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501117#comment-13501117 ] 

Jacopo Cappellato commented on OFBIZ-4949:
------------------------------------------

I like #3 too: an optional child element.
The following examples would then be valid xml files.
The default mode is "create-update" (as in current implementation); the following two are equivalent and both valid:
{code}
<entity-engine-xml>
    <Entity fieldId="ABC" description="abc"/>
    <Entity fieldId="DEF" description="def"/>
</entity-engine-xml>
{code}
{code}
<entity-engine-xml>
    <create-update>
        <Entity fieldId="ABC" description="abc"/>
        <Entity fieldId="DEF" description="def"/>
    </create-update>
</entity-engine-xml>
{code}
The other modes need to be explicitly set:

{code}
<entity-engine-xml>
    <create-replace>
        <Entity fieldId="ABC" description="abc"/>
        <Entity fieldId="DEF" description="def"/>
    </create-replace>
</entity-engine-xml>
{code}
and you can have several modes:
{code}
<entity-engine-xml>
    <Entity fieldId="ABC" description="abc"/>
    <create-replace>
        <Entity fieldId="DEF" description="def"/>
    </create-replace>
</entity-engine-xml>
{code}
or the same:
{code}
<entity-engine-xml>
    <create-update>
        <Entity fieldId="ABC" description="abc"/>
    </create-update>
    <create-replace>
        <Entity fieldId="DEF" description="def"/>
    </create-replace>
</entity-engine-xml>
{code}

                
> Add a new attribute for entity-engine-xml tag, nullify-absent-fields
> --------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> When you are first importing new data, quite naturally all fields other than those specified in the file will be null. If, however, you're updating existing data, you might want any field not specified in the file to retain its current value, or you might want the contents of the file to specify everything about a record, in other words "take this data and null out the rest". The alternative to set-other-fields-to-null (or whatever else we  might call it) would be a huge number of attribute="" in the file.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, nullify-absent-fields

Posted by "Nicolas Malin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Malin updated OFBIZ-4949:
---------------------------------

    Attachment: OFBIZ-4949-NMA.patch

In view of the comments, we can consider the #3 solution as consensu :)

I submitted  a new patch with this solution and add a example on specialpurpose/example/data/ExampleDemoData.xml.

If you load data with verbose debug you see some lines like " Detail created : 1, skipped : 3, updated : 42, replaced : 1, deleted : 0"

After a first review, I will create junit test.

Warn, if you load specialpurpose/example/data/ExampleDemoData.xml one more, the result given by detail line will be different because the transaction commit works by step with size 100.
                
> Add a new attribute for entity-engine-xml tag, nullify-absent-fields
> --------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> When you are first importing new data, quite naturally all fields other than those specified in the file will be null. If, however, you're updating existing data, you might want any field not specified in the file to retain its current value, or you might want the contents of the file to specify everything about a record, in other words "take this data and null out the rest". The alternative to set-other-fields-to-null (or whatever else we  might call it) would be a huge number of attribute="" in the file.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OFBIZ-4949) add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file

Posted by "Olivier Heintz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Heintz updated OFBIZ-4949:
----------------------------------

    Attachment: OFBIZ-4949.patch
    
> add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OFBIZ-4949) add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file

Posted by "Olivier Heintz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408181#comment-13408181 ] 

Olivier Heintz commented on OFBIZ-4949:
---------------------------------------

Paul, setOtherFieldsToNull est clearly better, thank's to propose it. I'll correct the patch

Scott,
The goal is to avoid to give all field, to have xml data file with only field with value.
ex: in  PortalPortlet, if portletTypeId is populated, screeLocation is not mandatory, because a default value exist ( ${component}:widget/${subcomponent}Screens.xml ) so if a enhancement move the screen to the default place, screenLocation should be change to null. It's the same thing for screenName, menuName, menuLocation, scriptName, formName, formLocation, ..... If the setOtherFieldsToNull not exist, it would be necessary to give all field with a default value to be sure.
Clearly, PortalPortlet is the only use case where this new attribute will be very usefull. 
                
> add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file

Posted by "Adrian Crum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13499642#comment-13499642 ] 

Adrian Crum commented on OFBIZ-4949:
------------------------------------

I agree that the brute-force approach is not a good idea.

I think a more worthwhile change would be to support UEL expressions in the class. Then you could initialize fields to null, now, etc.

                
> Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, nullify-absent-fields

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500173#comment-13500173 ] 

Scott Gray commented on OFBIZ-4949:
-----------------------------------

My main concern with #1 and #2 was decreased visibility to someone modifying the file which carries an increased risk of accidentally adding records under an inappropriate operation.

#3 and #4 also carry the advantage of being able to perform multiple related operations within the same file.
                
> Add a new attribute for entity-engine-xml tag, nullify-absent-fields
> --------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> When you are first importing new data, quite naturally all fields other than those specified in the file will be null. If, however, you're updating existing data, you might want any field not specified in the file to retain its current value, or you might want the contents of the file to specify everything about a record, in other words "take this data and null out the rest". The alternative to set-other-fields-to-null (or whatever else we  might call it) would be a huge number of attribute="" in the file.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OFBIZ-4949) add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407718#comment-13407718 ] 

Scott Gray commented on OFBIZ-4949:
-----------------------------------

Currently if you set an attribute with an empty value e.g. firstName="" then the field will be set to null, does this not suffice?
                
> add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OFBIZ-4949) Add new actions tag for loading data

Posted by "Olivier Heintz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Heintz updated OFBIZ-4949:
----------------------------------

    Summary: Add new actions tag for loading data  (was: Add a new attribute for entity-engine-xml tag, nullify-absent-fields)
    
> Add new actions tag for loading data
> ------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> When you are first importing new data, quite naturally all fields other than those specified in the file will be null. If, however, you're updating existing data, you might want any field not specified in the file to retain its current value, or you might want the contents of the file to specify everything about a record, in other words "take this data and null out the rest". The alternative to set-other-fields-to-null (or whatever else we  might call it) would be a huge number of attribute="" in the file.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, nullify-absent-fields

Posted by "Olivier Heintz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Heintz updated OFBIZ-4949:
----------------------------------

    Description: 
This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.

When you are first importing new data, quite naturally all fields other than those specified in the file will be null. If, however, you're updating existing data, you might want any field not specified in the file to retain its current value, or you might want the contents of the file to specify everything about a record, in other words "take this data and null out the rest". The alternative to set-other-fields-to-null (or whatever else we  might call it) would be a huge number of attribute="" in the file.


For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).

This enhancement will be very useful for portletData file. 

  was:
This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.

For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).

This enhancement will be very useful for portletData file. 

        Summary: Add a new attribute for entity-engine-xml tag, nullify-absent-fields  (was: Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file)
    
> Add a new attribute for entity-engine-xml tag, nullify-absent-fields
> --------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> When you are first importing new data, quite naturally all fields other than those specified in the file will be null. If, however, you're updating existing data, you might want any field not specified in the file to retain its current value, or you might want the contents of the file to specify everything about a record, in other words "take this data and null out the rest". The alternative to set-other-fields-to-null (or whatever else we  might call it) would be a huge number of attribute="" in the file.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file

Posted by "Paul Foxworthy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Foxworthy updated OFBIZ-4949:
----------------------------------

    Summary: Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file  (was: add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file)
    
> Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500140#comment-13500140 ] 

Scott Gray commented on OFBIZ-4949:
-----------------------------------

UEL could be a good idea but it's a separate feature IMO, we already have the ability to set a field null by supplying an empty attribute value as I mentioned above.

Maybe the issue here is larger than we think and the forest isn't being seen for the trees.  The current mode of operation for data files is to perform a create-or-update operation for each record present.  What is essentially being asked for here is a new operation mode of create-or-replace.  How about if we were to find a way to support any possible operation mode?  This could also solve the recurring problems that seem to appear with seed-initial data where we would want a create only operation with no update if the value exists.  Possible operations:
- create
- create-update
- create-replace
- delete?

If we were to go this route we'd just need to decide how the operation should be set for a given file or record, options coming to mind:
1. At the reader in the entity-engine.xml or ofbiz-component.xml files
2. As an attribute of the entity-engine-xml element
3. As child element of the entity-engine-xml element
4. As an attribute of the record element itself

I think I'd prefer #2 or #3, probably #3

Thoughts?
                
> Add a new attribute for entity-engine-xml tag, set-other-fields-to-null= true, if it exists at the beginning data file, all updates will set to null all fields not detailed in the file
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, nullify-absent-fields

Posted by "Olivier Heintz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500171#comment-13500171 ] 

Olivier Heintz commented on OFBIZ-4949:
---------------------------------------

My preference is #2
or #3

delete should be useful for some specifics case like mass update prepared by end-user 
                
> Add a new attribute for entity-engine-xml tag, nullify-absent-fields
> --------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> When you are first importing new data, quite naturally all fields other than those specified in the file will be null. If, however, you're updating existing data, you might want any field not specified in the file to retain its current value, or you might want the contents of the file to specify everything about a record, in other words "take this data and null out the rest". The alternative to set-other-fields-to-null (or whatever else we  might call it) would be a huge number of attribute="" in the file.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OFBIZ-4949) add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file

Posted by "Olivier Heintz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Heintz updated OFBIZ-4949:
----------------------------------

    Attachment: OFBIZ-4949.patch
    
> add a new attribute for for entity-engine-xml tag, put-other-field-to-null= true, if it exist at the beginning data file, all update will put to null all field not detail in this file
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, nullify-absent-fields

Posted by "Adrian Crum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501111#comment-13501111 ] 

Adrian Crum commented on OFBIZ-4949:
------------------------------------

I prefer #3. It is similar to what I had in mind for the UEL integration.

I was thinking the UEL integration would use a child element like <import-context var1="foo" var2="bar".../>.

                
> Add a new attribute for entity-engine-xml tag, nullify-absent-fields
> --------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> When you are first importing new data, quite naturally all fields other than those specified in the file will be null. If, however, you're updating existing data, you might want any field not specified in the file to retain its current value, or you might want the contents of the file to specify everything about a record, in other words "take this data and null out the rest". The alternative to set-other-fields-to-null (or whatever else we  might call it) would be a huge number of attribute="" in the file.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OFBIZ-4949) Add a new attribute for entity-engine-xml tag, nullify-absent-fields

Posted by "Nicolas Malin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500961#comment-13500961 ] 

Nicolas Malin commented on OFBIZ-4949:
--------------------------------------

My preference is #3.

Scott, I can implement your idea, if we have a consensus on it
                
> Add a new attribute for entity-engine-xml tag, nullify-absent-fields
> --------------------------------------------------------------------
>
>                 Key: OFBIZ-4949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4949
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4949-NMA.patch, OFBIZ-4949.patch, OFBIZ-4949.patch, OFBIZ-4949.patch
>
>
> This enhancement is useful when a entity is load by reader (ex: seed) and sometime, it could be modify in data file. If a field is change from a value to null, currently this modification will not be done in the next load.
> When you are first importing new data, quite naturally all fields other than those specified in the file will be null. If, however, you're updating existing data, you might want any field not specified in the file to retain its current value, or you might want the contents of the file to specify everything about a record, in other words "take this data and null out the rest". The alternative to set-other-fields-to-null (or whatever else we  might call it) would be a huge number of attribute="" in the file.
> For portletWidget, entity PortalPortal have a lot of field with potential default value, so sometime, first release use some field and when it's reviewed and corrected, some field are changed to null to use the default value (to follow best practice).
> This enhancement will be very useful for portletData file. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira