Details

      Description

      While working on OFBIZ-6919 which was built on R13.07 I stumbled upon an issue due to r1652852 where Adrian improved the cacheKey in FormFactory.getFormFromLocation() by adding a delegator reference (Tenants). Actually I'm not even sure it was done at r1652852 because Adrian did not maintain the FormFactory svn history.

      Anyway, to make a long story short I had to introduce a DispatchContext parameter when calling FormFactory.readFormDocument() when the code from R13.07 only passed a null.

      This had an impact in the hierarchy tree because FormFactory.readFormDocument() was called in DataResourceWorker class, where the new code was called from renderDataResourceAsText(). So I instead of only passing a Delegator I decided to pass only a LocalDispatcher parameter in renderDataResourceAsText(), since we can get the Delegator from the LocalDispatcher. Doing so it had an impact on the renderDataResourceAsText hierarchy tree ending in DataResourceWorkerInterface and all related.

      I finally decided to apply the same "Change Method Signature" refactoring pattern to all cases related to ContentWorkerInterface. No need to pass a delegator when you have LocalDispatcher!

      Here I attach a patch for review, I'll commit in few days

      1. OFBIZ-9164.patch
        60 kB
        Jacques Le Roux
      2. OFBIZ-9164 DataResourceWorker.java.patch
        9 kB
        Jacques Le Roux

        Issue Links

          Activity

          Hide
          deepak.dixit Deepak Dixit added a comment -
          Show
          deepak.dixit Deepak Dixit added a comment - Thanks Jacques Le Roux
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          It's not fixed it's improved :/ Reopening for closing again :/

          Show
          jacques.le.roux Jacques Le Roux added a comment - It's not fixed it's improved :/ Reopening for closing again :/
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Hi Deepak,

          Fixed in rr1778421, I checked there should not be other issues. But as it's really a manual process we can never be sure :/

          I close here please open a new Jira if you find related issue, thanks.

          Show
          jacques.le.roux Jacques Le Roux added a comment - Hi Deepak, Fixed in rr1778421, I checked there should not be other issues. But as it's really a manual process we can never be sure :/ I close here please open a new Jira if you find related issue, thanks.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Thanks Deepak, I remember I had a look but I must say it was not deep enough.

          This also shows the limit of static Java methods usage in Freemarker. It's all a manual thing, when with an IDE refactoring Java is (almost) a bliss. Static Java methods usage in Freemarker should not have been allowed at all (and yes I did my part :/)

          Anyway I'll take care of that

          Show
          jacques.le.roux Jacques Le Roux added a comment - Thanks Deepak, I remember I had a look but I must say it was not deep enough. This also shows the limit of static Java methods usage in Freemarker. It's all a manual thing, when with an IDE refactoring Java is (almost) a bliss. Static Java methods usage in Freemarker should not have been allowed at all (and yes I did my part :/) Anyway I'll take care of that
          Hide
          deepak.dixit Deepak Dixit added a comment -

          Need to update method calling from ftl as well.

           Java method "org.apache.ofbiz.order.shoppingcart.ShoppingCartItem.getDescription(org.apache.ofbiz.service.LocalDispatcher)" takes 1 argument, but 0 was given. ---- FTL stack trace ("~" means nesting-related): - Failed at: ${cartLine.getDescription()!} [in template "component://order/template/entry/cart/ShowCartItems.ftl" at line 84, column 24] ---- 
          
          Show
          deepak.dixit Deepak Dixit added a comment - Need to update method calling from ftl as well. Java method "org.apache.ofbiz.order.shoppingcart.ShoppingCartItem.getDescription(org.apache.ofbiz.service.LocalDispatcher)" takes 1 argument, but 0 was given. ---- FTL stack trace ( "~" means nesting-related): - Failed at: ${cartLine.getDescription()!} [in template "component: //order/template/entry/cart/ShowCartItems.ftl" at line 84, column 24] ----
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Done at r1777297

          Show
          jacques.le.roux Jacques Le Roux added a comment - Done at r1777297
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          As you can see the changes are intricated, so no I'll not apply the OFBIZ-9164.patch alone but will rather apply with the relevant changes in DataResourceWorker.java.patch. I mean w/o the new stuff...

          Show
          jacques.le.roux Jacques Le Roux added a comment - As you can see the changes are intricated, so no I'll not apply the OFBIZ-9164 .patch alone but will rather apply with the relevant changes in DataResourceWorker.java.patch. I mean w/o the new stuff...
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          I also attach a separated patch to show the changes needed in DataResourceWorker.java

          Show
          jacques.le.roux Jacques Le Roux added a comment - I also attach a separated patch to show the changes needed in DataResourceWorker.java

            People

            • Assignee:
              jacques.le.roux Jacques Le Roux
              Reporter:
              jacques.le.roux Jacques Le Roux
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development