[jira] Created: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
OrderServices.updateApprovedOrderItems should update OrderItemAttributes
------------------------------------------------------------------------

                 Key: OFBIZ-2115
                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
             Project: OFBiz
          Issue Type: Improvement
          Components: order
    Affects Versions: SVN trunk
         Environment: Windows XP
            Reporter: Stephen Rufle
             Fix For: SVN trunk


I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
attibuteName+ ":" + orderItemSeqId

At the top of
OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.

For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Rufle updated OFBIZ-2115:
---------------------------------

    Attachment: 2009-01-08_001_OrderItemAtrributes.patch

Patches
applications/order/servicedef/services.xml
applications/order/src/org/ofbiz/order/order/OrderServices.java
applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java

with the modifications needed to update OrderItemAttributes

> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-08_001_OrderItemAtrributes.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Rufle updated OFBIZ-2115:
---------------------------------

    Attachment: 2009-01-14_001_shoppingcart.patch

After this issue was initially created I modified the appendOrderItem service by adding 2 new parms to the service definition and modified OrderServices.addItemToApprovedOrder to use them

Patch
- Adds an overloaded makeAllOrderAttributes to ShoppingCart that takes parms for returning Filled and Empty attributes ( the defined constants are also used for OrderItemAtrributes)
- Fixes a misnamed variable issue in ShoppingCartServices , the section with the comment  "load order item contact mechs" had a var named orderAttributesList i thought it should have been teh orderItemContactMechList just above instead
- There are also some tab to spaces fixes

> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-08_001_OrderItemAtrributes.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Updated: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Stephen Rufle-2
In reply to this post by Nicolas Malin (Jira)
What is the status of OFBIZ-2115 could some one take a look at my
patches, to see if it passes approval.
https://issues.apache.org/jira/browse/OFBIZ-2115

Stephen Rufle (JIRA) wrote:

>      [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Stephen Rufle updated OFBIZ-2115:
> ---------------------------------
>
>     Attachment: 2009-01-08_001_OrderItemAtrributes.patch
>
> Patches
> applications/order/servicedef/services.xml
> applications/order/src/org/ofbiz/order/order/OrderServices.java
> applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
>
> with the modifications needed to update OrderItemAttributes
>
>  
>> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
>> ------------------------------------------------------------------------
>>
>>                 Key: OFBIZ-2115
>>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>>             Project: OFBiz
>>          Issue Type: Improvement
>>          Components: order
>>    Affects Versions: SVN trunk
>>         Environment: Windows XP
>>            Reporter: Stephen Rufle
>>             Fix For: SVN trunk
>>
>>         Attachments: 2009-01-08_001_OrderItemAtrributes.patch
>>
>>
>> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
>> attibuteName+ ":" + orderItemSeqId
>> At the top of
>> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
>> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed
>>    
>
>  

--
Stephen P Rufle
[hidden email]
H1:480-626-8022
H2:480-802-7173
Yahoo IM: stephen_rufle
AOL IM: stephen1rufle

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux reassigned OFBIZ-2115:
--------------------------------------

    Assignee: Jacques Le Roux

> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-08_001_OrderItemAtrributes.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666553#action_12666553 ]

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

Please Stephen,

Could you create a new patch, this one is out of date due to  (at least)  the tabs to spaces changes I did in r737003

Thanks

> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-08_001_OrderItemAtrributes.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666560#action_12666560 ]

Stephen Rufle commented on OFBIZ-2115:
--------------------------------------

I think OFBIZ-2109 will also be effected. Should I try to create two
patches?


--
Stephen P Rufle
[hidden email]
H1:480-626-8022
H2:480-802-7173
Yahoo IM: stephen_rufle
AOL IM: stephen1rufle



> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-08_001_OrderItemAtrributes.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666560#action_12666560 ]

srufle edited comment on OFBIZ-2115 at 1/23/09 7:21 AM:
---------------------------------------------------------------

I think OFBIZ-2109 will also be effected. Should I try to create two
patches?



      was (Author: srufle):
    I think OFBIZ-2109 will also be effected. Should I try to create two
patches?


--
Stephen P Rufle
[hidden email]
H1:480-626-8022
H2:480-802-7173
Yahoo IM: stephen_rufle
AOL IM: stephen1rufle


 

> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-08_001_OrderItemAtrributes.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666562#action_12666562 ]

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

OFBIZ-2109 is already commited, no worries on this one

> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-08_001_OrderItemAtrributes.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Rufle updated OFBIZ-2115:
---------------------------------

    Attachment: 2009-01-14_001_shoppingcart.patch

Created a new patch after the tabs 2 spaces commit. While I was reviewing it looks like I also wanted to add a itemDesiredDeliveryDate parm to addItemToApprovedOrder. I removed it from this patch because I could not find where I used that paramter after passing it in. There may be a second patch coming for that.

> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Rufle updated OFBIZ-2115:
---------------------------------

    Attachment:     (was: 2009-01-08_001_OrderItemAtrributes.patch)

> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666593#action_12666593 ]

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

Stephen,

Good catch on "if (UtilValidate.isNotEmpty(orderAttributesList))" from r727640 I did not spot

But could you please preferably use for loop like
{code}
        Map<String, Object> attributeNames = FastMap.newInstance();
        Set<String> keys = itemAttributesMap.keySet();
        for (String key : keys) {
            String[] attributeInfo = key.split(":");
            attributeNames.put(attributeInfo[0],attributeInfo[0]);
        }
{code}
instead of
{code}
        Map attributeNames =FastMap.newInstance();
        Iterator ia = itemAttributesMap.keySet().iterator();
        while (ia.hasNext()) {
            String key = (String) ia.next();
            String[] attributeInfo = key.split(":");
            attributeNames.put(attributeInfo[0],attributeInfo[0]);
        }
{code}
Don't worry about 1st line indentation above, seems that Jira is not handling that well...

BTW are your sure it's attributeInfo[0] in both cases ?


> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666612#action_12666612 ]

Stephen Rufle commented on OFBIZ-2115:
--------------------------------------

Sure I will change and resubmit. The attributeInfo[0] value is the same.
I was using that as a unique list of  attribute names. I am not sure how
else to do what I want since the list of attributes is arbitrary in
name. I am going through all the rows looking for attributes that have
been passed ignoring what line they may have come from. Then in the
second loop I look at the specific item and check all the attributes and
set them to the specified value.

I also see that I can change the loop style in the second loop also.




> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666629#action_12666629 ]

Adrian Crum commented on OFBIZ-2115:
------------------------------------

Stephen - Maybe what you're looking for is a Set.


> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666644#action_12666644 ]

Stephen Rufle commented on OFBIZ-2115:
--------------------------------------

Would I want to do the first loop through and put each attribute name in
a Set instead of a Map.

        Set<String> attributeNames =FastMap.newInstance();
        Set<String> keys  = itemAttributesMap.keySet();
        for (String key : keys) {
            String[] attributeInfo = key.split(":");
            attributeNames.put(attributeInfo[0],attributeInfo[0]);
        }
 then below
             // update the order item attributes
                if (itemAttributesMap != null) {
                    String attrValue = null;
                    for (String attrName : attributeNames) {
                        attrValue = (String)
itemAttributesMap.get(attrName + ":" + itemSeqId);
                        if (UtilValidate.isNotEmpty(attrName)) {
                            cartItem.setOrderItemAttribute(attrName,
attrValue);
                            Debug.log("Set item attribute Name: [" +
itemSeqId + "] " + attrName + " , Value:" + attrValue, module);
                        }
                    }
                }




> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666644#action_12666644 ]

srufle edited comment on OFBIZ-2115 at 1/23/09 1:03 PM:
---------------------------------------------------------------

Would I want to do the first loop through and put each attribute name in
a Set instead of a Map.
{code}
        Set<String> attributeNames =FastMap.newInstance();
        Set<String> keys  = itemAttributesMap.keySet();
        for (String key : keys) {
            String[] attributeInfo = key.split(":");
            attributeNames.put(attributeInfo[0],attributeInfo[0]);
        }
{code}
 then below
{code}
             // update the order item attributes
                if (itemAttributesMap != null) {
                    String attrValue = null;
                    for (String attrName : attributeNames) {
                        attrValue = (String)
itemAttributesMap.get(attrName + ":" + itemSeqId);
                        if (UtilValidate.isNotEmpty(attrName)) {
                            cartItem.setOrderItemAttribute(attrName,
attrValue);
                            Debug.log("Set item attribute Name: [" +
itemSeqId + "] " + attrName + " , Value:" + attrValue, module);
                        }
                    }
                }
{code}



      was (Author: srufle):
    Would I want to do the first loop through and put each attribute name in
a Set instead of a Map.

        Set<String> attributeNames =FastMap.newInstance();
        Set<String> keys  = itemAttributesMap.keySet();
        for (String key : keys) {
            String[] attributeInfo = key.split(":");
            attributeNames.put(attributeInfo[0],attributeInfo[0]);
        }
 then below
             // update the order item attributes
                if (itemAttributesMap != null) {
                    String attrValue = null;
                    for (String attrName : attributeNames) {
                        attrValue = (String)
itemAttributesMap.get(attrName + ":" + itemSeqId);
                        if (UtilValidate.isNotEmpty(attrName)) {
                            cartItem.setOrderItemAttribute(attrName,
attrValue);
                            Debug.log("Set item attribute Name: [" +
itemSeqId + "] " + attrName + " , Value:" + attrValue, module);
                        }
                    }
                }



 

> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Rufle updated OFBIZ-2115:
---------------------------------

    Attachment: 2009-01-14_001_shoppingcart.patch

Made changes suggested by Adrian about using a Set instead of a Map.

> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-2115) OrderServices.updateApprovedOrderItems should update OrderItemAttributes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-2115.
----------------------------------

    Resolution: Fixed

Thanks Stephen,

Well done, your patch is in trunk revision: 737200  

Only 2 other things to note.
* Please update before (re)doing a patch. I had already commited your fix on ShoppingCartServices.java in r737077
* While I was at it I replaced all cartLines.iterato() while loops by for loops
** for that, I simply introduced private List<ShoppingCartItem> cartLines = FastList.newInstance();


> OrderServices.updateApprovedOrderItems should update OrderItemAttributes
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-2115
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2115
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch, 2009-01-14_001_shoppingcart.patch
>
>
> I wanted updateApprovedOrderItems to be able to update any OrderItemAttributes there may be. added a new map (itemAttributesMap) to /applications/order/servicedef/services.xml#updateOrderItems the key value of the map should be in the form of
> attibuteName+ ":" + orderItemSeqId
> At the top of
> OrderServices.updateApprovedOrderItems(DispatchContext, Map) I create a new map with only the attribute names, later in the same method we repopulate the cartItem's OrderItemAttributes with any non-empty values. In saveUpdatedCartToOrder we call my modified ShoppingCart.makeAllOrderItemAttributes(String, int) I added the ability to return just empty , just filled or both empty and filled.
> For previously filled attributes that are now empty I remove them from the database. for either new or chnaged ones they are just added to the toStore that already existed

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.