Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-9350 Deprecate Mini Lang
  3. OFBIZ-11436

Convert ProductContentServices.xml mini lang to groovy

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Done
    • Trunk
    • None
    • product
    • None
    • OFBiz Community Day (Feb 2020), OFBiz Community Day (May 2020), OFBiz Community Day (Aug 2020)

    Attachments

      Issue Links

        Activity

          nmalin Nicolas Malin added a comment - - edited

          Thanks sberg for your patch, my remarks :

          UtilValidate.is[Not]Empty

          are useless :

          • 'if (UtilValidate.isNotEmpty(parameters.metaDescription)) {' == 'if (parameters.metaDescription) {'
          • 'if (UtilValidate.isEmpty(updateProductPromoContentMap.thruDate)) {' == 'if (!updateProductPromoContentMap.thruDate) {'

           

           

            Map updateContent = parameters
           run service:"updateContent", with: updateContent
          

           

          • You can write directly 'run service:"updateContent", with: parameters'

           

          .where([dataResourceId: productContent.dataResourceId])
          • [ ] are useless you can also do : .where(dataResourceId: productContent.dataResourceId)

           

          productContents = from("ProductContentAndInfo").where([productId: parameters.productId, productContentTypeId: "PAGE_TITLE"]).queryList()
          if (UtilValidate.isNotEmpty(productContents)) {
          GenericValue productContent = productContents.get(0)

          You can replace by a direct GenericValue resolution :

           

          GenericValue productContent = from("ProductContentAndInfo").where(productId: parameters.productId, productContentTypeId: "PAGE_TITLE").queryFirst()
          if (productContent) { ...
          nmalin Nicolas Malin added a comment - - edited Thanks sberg for your patch, my remarks : UtilValidate.is[Not]Empty are useless : 'if (UtilValidate.isNotEmpty(parameters.metaDescription)) {' == 'if (parameters.metaDescription) {' 'if (UtilValidate.isEmpty(updateProductPromoContentMap.thruDate)) {' == 'if (!updateProductPromoContentMap.thruDate) {'       Map updateContent = parameters  run service: "updateContent" , with: updateContent   You can write directly 'run service:"updateContent", with: parameters'   .where([dataResourceId: productContent.dataResourceId]) [ ] are useless you can also do : .where(dataResourceId: productContent.dataResourceId)   productContents = from( "ProductContentAndInfo" ).where([productId: parameters.productId, productContentTypeId: "PAGE_TITLE" ]).queryList() if (UtilValidate.isNotEmpty(productContents)) { GenericValue productContent = productContents.get(0) You can replace by a direct GenericValue resolution :   GenericValue productContent = from( "ProductContentAndInfo" ).where(productId: parameters.productId, productContentTypeId: "PAGE_TITLE" ).queryFirst() if (productContent) { ...
          sberg Sebastian Berg added a comment -

          Thanks nmalin for the feedback. I updated the patch accordingly.

          sberg Sebastian Berg added a comment - Thanks nmalin  for the feedback. I updated the patch accordingly.

          Commit 43b44f53e0897935a194db7c1ee56f2ebcbd8300 in ofbiz-framework's branch refs/heads/trunk from Nicolas Malin
          [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=43b44f5 ]

          Improved: Convert ProductContentServices.xml mini lang to groovy
          (OFBIZ-11436)

          Thanks to Sebastian Berg for providing the patch

          jira-bot ASF subversion and git services added a comment - Commit 43b44f53e0897935a194db7c1ee56f2ebcbd8300 in ofbiz-framework's branch refs/heads/trunk from Nicolas Malin [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=43b44f5 ] Improved: Convert ProductContentServices.xml mini lang to groovy ( OFBIZ-11436 ) Thanks to Sebastian Berg for providing the patch
          nmalin Nicolas Malin added a comment -

          Thanks sberg, I commited it on trunk.

          I converted the service removeProductPromoContent to entity-auto

          nmalin Nicolas Malin added a comment - Thanks sberg , I commited it on trunk. I converted the service removeProductPromoContent to entity-auto

          Commit ebe18e45f1e37567e2ba45dccc404894c01d0f73 in ofbiz-framework's branch refs/heads/trunk from Jacques Le Roux
          [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=ebe18e4 ]

          Improved: Unable to upload additional image for a product (OFBIZ-11844)

          OFBIZ-11436 broke the uploadProductAdditionalViewImages service but something
          else remains which prevents to create a content

          Thanks: Arpit Mor for report

          jira-bot ASF subversion and git services added a comment - Commit ebe18e45f1e37567e2ba45dccc404894c01d0f73 in ofbiz-framework's branch refs/heads/trunk from Jacques Le Roux [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=ebe18e4 ] Improved: Unable to upload additional image for a product ( OFBIZ-11844 ) OFBIZ-11436 broke the uploadProductAdditionalViewImages service but something else remains which prevents to create a content Thanks: Arpit Mor for report

          People

            sberg Sebastian Berg
            sberg Sebastian Berg
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: