You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by nm...@apache.org on 2019/08/26 08:07:41 UTC

svn commit: r1865912 - in /ofbiz/ofbiz-framework/trunk/applications/product: groovyScripts/product/catalog/ groovyScripts/product/catalog/CatalogServices.groovy minilang/product/catalog/ servicedef/services.xml servicedef/services_maint.xml

Author: nmalin
Date: Mon Aug 26 08:07:41 2019
New Revision: 1865912

URL: http://svn.apache.org/viewvc?rev=1865912&view=rev
Log:
Improved: Convert CatalogServices.xml mini lang to groovy
(OFBIZ-9992) (OFBIZ-9350)
Thanks to Dennis Balkir for this conversion

Added:
    ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/product/catalog/
    ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/product/catalog/CatalogServices.groovy   (with props)
Removed:
    ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/catalog/
Modified:
    ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services.xml
    ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services_maint.xml

Added: ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/product/catalog/CatalogServices.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/product/catalog/CatalogServices.groovy?rev=1865912&view=auto
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/product/catalog/CatalogServices.groovy (added)
+++ ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/product/catalog/CatalogServices.groovy Mon Aug 26 08:07:41 2019
@@ -0,0 +1,421 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+import java.sql.Timestamp
+import org.apache.ofbiz.base.util.UtilDateTime
+import org.apache.ofbiz.base.util.UtilURL
+import org.apache.ofbiz.entity.GenericValue
+import org.apache.ofbiz.entity.util.EntityUtilProperties
+import org.apache.ofbiz.service.ServiceUtil
+
+/**
+ * get All categories
+ */
+def getAllCategories() {
+    String defaultTopCategoryId = parameters.topCategory ?: EntityUtilProperties.getPropertyValue("catalog", "top.category.default", delegator)
+    Map serviceRes = run service: "getRelatedCategories", with: [parentProductCategoryId: defaultTopCategoryId]
+    return serviceRes
+}
+
+def getRelatedCategories() {
+    Map result = success()
+    List categories = []
+    List rollups = from("ProductCategoryRollup")
+            .where("parentProductCategoryId", parameters.parentProductCategoryId)
+            .orderBy("sequenceNum")
+            .queryList()
+    if (parameters.categories) {
+        categories.addAll(parameters.categories)
+    }
+    if (rollups) {
+        List subCategories = []
+        for (GenericValue parent: rollups) {
+            subCategories << parent.getRelatedOne("CurrentProductCategory", true)
+        }
+        if (subCategories) {
+            Set distinctCategories = categories? [*categories] as Set: [] as Set
+            Map relatedCategoryContext = [categories: subCategories]
+            for (Map subCategory: subCategories) {
+                relatedCategoryContext.parentProductCategoryId = subCategory.productCategoryId
+                Map res = run service: "getRelatedCategories", with: relatedCategoryContext
+                if (res.categories) {
+                    distinctCategories.addAll(res.categories)
+                }
+            }
+            categories = distinctCategories as List
+        }
+    } else {
+        GenericValue productCategory = from("ProductCategory")
+                .where("productCategoryId", parameters.parentProductCategoryId)
+                .queryOne()
+        categories << productCategory
+    }
+    result.categories = categories
+    return result
+}
+
+
+/**
+ * Check if image url exists or not for all categories
+ */
+def checkImageUrlForAllCategories() {
+    Map result = success()
+    Map gacRes = run service: "getAllCategories", with: parameters
+    List categories = gacRes.categories
+    if (categories) {
+        Map categoriesMap = [:]
+        // get the category from categories
+        for (Map category : categories) {
+            Map ciufcapRes = run service: "checkImageUrlForCategoryAndProduct", with: [categoryId: category.productCategoryId]
+            Map fileStatusMap = [fileExists: ciufcapRes.fileExists, fileNotExists: ciufcapRes.fileNotExists]
+            String categoryId = category.productCategoryId
+            categoriesMap[categoryId] = fileStatusMap
+        }
+        result.categoriesMap = categoriesMap
+    }
+    return result
+}
+
+
+/**
+ * Check if image url exists or not for category and product
+ */
+def checkImageUrlForCategoryAndProduct() {
+    Map result = success()
+    Map gpcmRes = run service: "getProductCategoryMembers", with: parameters
+    List categoryMembers = gpcmRes.categoryMembers
+    Map category = gpcmRes.category
+
+    List fileExists = []
+    List fileNotExists = []
+    Map filesImageMap = [:]
+    // Get category images and check it exists or not
+    if (category) {
+        Map ciufcRes = run service: "checkImageUrlForCategory", with: [categoryId: category.productCategoryId]
+        filesImageMap = ciufcRes.filesImageMap
+
+        if (filesImageMap) {
+            fileImageExists("categoryImageUrlMap", "categoryImageUrl", filesImageMap, fileExists, fileNotExists)
+            fileImageExists("linkOneImageUrlMap", "linkOneImageUrl", filesImageMap, fileExists, fileNotExists)
+            fileImageExists("linkTwoImageUrlMap", "linkTwoImageUrl", filesImageMap, fileExists, fileNotExists)
+        }
+    }
+
+    if (categoryMembers) {
+        for (GenericValue productCategoryMember : categoryMembers) {
+            Map ciufpRes = run service: "checkImageUrlForProduct", with: [productId: productCategoryMember.productId]
+            filesImageMap = ciufpRes.filesImageMap
+
+            if (filesImageMap) {
+                fileImageExists("smallImageUrlMap", "smallImageUrl", filesImageMap, fileExists, fileNotExists)
+                fileImageExists("mediumImageUrlMap", "mediumImageUrl", filesImageMap, fileExists, fileNotExists)
+                fileImageExists("largeImageUrlMap", "largeImageUrl", filesImageMap, fileExists, fileNotExists)
+                fileImageExists("detailImageUrlMap", "detailImageUrl", filesImageMap, fileExists, fileNotExists)
+            }
+
+            /* Case for virtual product
+               get related assoc product */
+            Map product = productCategoryMember.getRelatedOne("Product", false)
+            if ("Y" == product.isVirtual) {
+                Map virtualProductContext = [
+                    productId: product.productId,
+                    productAssocTypeId: "PRODUCT_VARIANT"
+                ]
+                List variantProducts = from("ProductAssoc")
+                        .where(virtualProductContext)
+                        .filterByDate()
+                        .queryList()
+                if (variantProducts) {
+                    for (Map variantProduct : variantProducts) {
+                        Map res = run service: "checkImageUrlForProduct", with: [productId: variantProduct.productIdTo]
+                        filesImageMap = res.filesImageMap
+                        if (filesImageMap) {
+                            fileImageExists("smallImageUrlMap", "smallImageUrl", filesImageMap, fileExists, fileNotExists)
+                            fileImageExists("mediumImageUrlMap", "mediumImageUrl", filesImageMap, fileExists, fileNotExists)
+                            fileImageExists("largeImageUrlMap", "largeImageUrl", filesImageMap, fileExists, fileNotExists)
+                            fileImageExists("detailImageUrlMap", "detailImageUrl", filesImageMap, fileExists, fileNotExists)
+                        }
+                    }
+                }
+            }
+        }
+        result.fileExists = fileExists
+        result.fileNotExists = fileNotExists
+    }
+    return result
+}
+
+/**
+ * This Method checks if the images exist and puts them into
+ * the lists filesExist and filesNotExist.
+ * <p>
+ * The lists filesExist and filesNotExist are filled with the new values.
+ * @param map
+ * @param key
+ * @param filesImageMap
+ * @param fileExists
+ * @param fileNotExists
+ */
+def fileImageExists(map, key, filesImageMap, fileExists, fileNotExists) {
+    if (filesImageMap."${map}"?."${key}") {
+        if ("Y" == filesImageMap."${map}".isExists) {
+            fileExists.add(filesImageMap."${map}"."${key}")
+        } else {
+            fileNotExists.add(filesImageMap."${map}"."${key}")
+        }
+    }
+}
+
+/**
+ * This service gets the category id and checks if
+ * all the images of category exists or not
+ */
+def checkImageUrlForCategory() {
+    Map result = success()
+    Map filesImageMap = [:]
+    GenericValue category = from("ProductCategory")
+            .where("productCategoryId", parameters.categoryId)
+            .queryOne()
+    if (category) {
+        // check for category image url
+        imageUrlCheck(category, "categoryImageUrl", filesImageMap)
+        // check for link image url
+        imageUrlCheck(category, "linkOneImageUrl", filesImageMap)
+        // check for link two image url
+        imageUrlCheck(category, "linkTwoImageUrl", filesImageMap)
+        category.store()
+        if (filesImageMap) {
+            result.filesImageMap = filesImageMap
+        }
+    }
+    return result
+}
+
+/**
+ * Check if image url exists or not for product
+ */
+def checkImageUrlForProduct() {
+    Map result = success()
+    Map filesImageMap = [:]
+    if (parameters.productId) {
+        Map product = from("Product").where(parameters).queryOne()
+        // check for small image url
+        imageUrlCheck(product, "smallImageUrl", filesImageMap)
+        // check for medium image url
+        imageUrlCheck(product, "mediumImageUrl", filesImageMap)
+        // check for large image url
+        imageUrlCheck(product, "largeImageUrl", filesImageMap)
+        // check for detail image url
+        imageUrlCheck(product, "detailImageUrl", filesImageMap)
+        if (filesImageMap) {
+            result.filesImageMap = filesImageMap
+        }
+        product.store()
+    }
+    return result
+}
+
+/**
+ * This method fills filesImageMap with the needed content and sets the relevant type in
+ * the prodOrCat (product or category) map to null, if there is no image existent for this type
+ * @param prodOrCat
+ * @param filesImageMap
+ * @param imageType
+ * @return
+ */
+def imageUrlCheck(prodOrCat, imageType, filesImageMap) {
+    if (prodOrCat."${imageType}") {
+        Map res = run service: "checkImageUrl", with: [imageUrl: prodOrCat."${imageType}"]
+        String isExists = res.isExists
+        filesImageMap."${imageType}Map" = [:]
+        filesImageMap."${imageType}Map"."${imageType}" = prodOrCat."${imageType}"
+        filesImageMap."${imageType}Map".isExists = isExists
+        if (isExists == "N") {
+            prodOrCat."${imageType}" = null
+        }
+    }
+}
+
+/**
+ * Check if image url exists or not
+ */
+def checkImageUrl() {
+    def imageUrl = parameters.imageUrl
+    boolean httpFlag = imageUrl.startsWith("http")
+    boolean ftpFlag = imageUrl.startsWith("ftp")
+    String url = httpFlag || ftpFlag
+        ? UtilURL.fromUrlString(imageUrl)
+        : UtilURL.fromOfbizHomePath("/themes/common-theme/webapp" + imageUrl)
+    Map result = success()
+    result.isExists = url ? "Y" : "N"
+    return result
+}
+
+/**
+ * Catalog permission logic
+ */
+def catalogPermissionCheck() {
+    parameters.primaryPermission = "CATALOG"
+    Map result = run service: "genericBasePermissionCheck", with: parameters
+    return result
+}
+
+/**
+ * ProdCatalogToParty permission logic
+ */
+def prodCatalogToPartyPermissionCheck() {
+    parameters.altPermission = "PARTYMGR"
+    return catalogPermissionCheck()
+}
+
+/**
+ * create missing category and product alternative urls
+ */
+def createMissingCategoryAndProductAltUrls() {
+    Timestamp now = UtilDateTime.nowTimestamp()
+    Map result = success()
+    result.prodCatalogId = parameters.prodCatalogId
+    int categoriesNotUpdated = 0
+    int categoriesUpdated = 0
+    int productsNotUpdated = 0
+    int productsUpdated = 0
+    String checkProduct = parameters.product
+    String checkCategory = parameters.category
+    List prodCatalogCategoryList = from("ProdCatalogCategory").where("prodCatalogId", parameters.prodCatalogId).queryList()
+
+    // get all categories
+    List productCategories = []
+    for (GenericValue prodCatalog: prodCatalogCategoryList) {
+        productCategories.addAll(createMissingCategoryAltUrlInline(prodCatalog.productCategoryId))
+    }
+
+    for (Map productCategoryList : productCategories) {
+        // create product category alternative URLs
+        if (checkCategory) {
+            List productCategoryContentAndInfoList = from("ProductCategoryContentAndInfo")
+                    .where("productCategoryId", productCategoryList.productCategoryId,
+                            "prodCatContentTypeId", "ALTERNATIVE_URL")
+                    .filterByDate()
+                    .orderBy("-fromDate")
+                    .cache()
+                    .queryList()
+            if (!productCategoryContentAndInfoList) {
+                Map createSimpleTextContentForCategoryCtx = [
+                    fromDate: now,
+                    prodCatContentTypeId: "ALTERNATIVE_URL",
+                    localeString: "en",
+                    productCategoryId: productCategoryList.productCategoryId
+                ]
+                if (!productCategoryList.categoryName) {
+                    GenericValue productCategoryContent = from("ProductCategoryContentAndInfo")
+                            .where("productCategoryId", productCategoryList.productCategoryId,
+                                    "prodCatContentTypeId", "CATEGORY_NAME")
+                            .filterByDate()
+                            .orderBy("-fromDate")
+                            .cache()
+                            .queryFirst()
+                    if (productCategoryContent) {
+                        Map gcadrRes = run service: "getContentAndDataResource", with: [contentId: productCategoryContent.contentId]
+                        Map resultMap = gcadrRes.resultData
+                        createSimpleTextContentForCategoryCtx.text = resultMap.electronicText.textData
+                    }
+                } else {
+                    createSimpleTextContentForCategoryCtx.text = productCategoryList.categoryName
+                }
+                if (createSimpleTextContentForCategoryCtx.text) {
+                    Map res = run service: "createSimpleTextContentForCategory", with: createSimpleTextContentForCategoryCtx
+                    if (ServiceUtil.isError(res)) {
+                        return res
+                    }
+                    categoriesUpdated += 1
+                }
+            } else {
+                categoriesNotUpdated += 1
+            }
+        }
+
+        // create product alternative URLs
+        if (checkProduct) {
+            List productCategoryMemberList = from("ProductCategoryMember")
+                    .where("productCategoryId", productCategoryList.productCategoryId)
+                    .filterByDate()
+                    .orderBy("-fromDate")
+                    .cache()
+                    .queryList()
+            for (Map productCategoryMember: productCategoryMemberList) {
+                String memberProductId = productCategoryMember.productId
+                List productContentAndInfoList = from("ProductContentAndInfo")
+                        .where("productId", memberProductId, "productContentTypeId", "ALTERNATIVE_URL")
+                        .cache().orderBy("-fromDate")
+                        .filterByDate()
+                        .queryList()
+                if (!productContentAndInfoList) {
+                    GenericValue product = from("Product").where("productId", memberProductId).queryOne()
+                    Map createSimpleTextContentForProductCtx = [
+                        fromDate: now,
+                        productContentTypeId: "ALTERNATIVE_URL",
+                        localeString: "en",
+                        productId: memberProductId
+                    ]
+                    createSimpleTextContentForProductCtx.text = product.internalName ?: product.productName
+                    if (createSimpleTextContentForProductCtx.text) {
+                        Map res = run service: "createSimpleTextContentForProduct", with: createSimpleTextContentForProductCtx
+                        if (ServiceUtil.isError(res)) {
+                            return res
+                        }
+                        productsUpdated += 1
+                    }
+                } else {
+                    productsNotUpdated += 1
+                }
+            }
+        }
+    }
+    result.successMessageList = [
+        "Categories updated: ${categoriesUpdated}",
+        "Products updated: ${productsUpdated}"
+    ]
+    result.categoriesNotUpdated = categoriesNotUpdated
+    result.productsNotUpdated = productsNotUpdated
+    result.categoriesUpdated = categoriesUpdated
+    result.productsUpdated = productsUpdated
+    return result
+}
+
+def createMissingCategoryAltUrlInline(parentProductCategoryId) {
+    List productCategoryRollupIds = from("ProductCategoryRollup")
+            .where("parentProductCategoryId", parentProductCategoryId)
+            .filterByDate()
+            .cache()
+            .getFieldList("productCategoryId")
+    List productCategories = []
+    for (String productCategoryId : productCategoryRollupIds) {
+
+        // append product category to list
+        productCategories << from("ProductCategory")
+                .where("productCategoryId", productCategoryId)
+                .cache()
+                .queryOne()
+
+        // find rollup product categories
+        productCategories.addAll(createMissingCategoryAltUrlInline(productCategoryId))
+    }
+    return productCategories
+}
\ No newline at end of file

Propchange: ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/product/catalog/CatalogServices.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/product/catalog/CatalogServices.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/product/catalog/CatalogServices.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services.xml?rev=1865912&r1=1865911&r2=1865912&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services.xml Mon Aug 26 08:07:41 2019
@@ -182,7 +182,7 @@ under the License.
         <attribute name="productId" type="String" mode="IN" optional="false"/>
         <attribute name="weight" type="Long" mode="IN" optional="true"/>
     </service>
-    
+
     <service name="createProductReview" engine="simple"
             location="component://product/minilang/product/product/ProductServices.xml" invoke="createProductReview" auth="true">
         <description>Create a product review entity</description>
@@ -245,14 +245,14 @@ under the License.
     <service name="createProductPrice" default-entity-name="ProductPrice" engine="simple"
                 location="component://product/minilang/product/price/PriceServices.xml" invoke="createProductPrice" auth="true">
         <description>
-            Create a Product Price. 
-            
-            If taxAuthGeoId and taxAuthPartyId are passed in then the price will be considered a price 
+            Create a Product Price.
+
+            If taxAuthGeoId and taxAuthPartyId are passed in then the price will be considered a price
             with tax included (the priceWithoutTax, priceWithTax, taxAmount, and taxPercentage fields will also be populated).
-            
+
             If the taxInPrice field is 'Y' then the price field will be left with the tax included (price will be equal to priceWithTax),
             otherwise tax will be removed from the passed in price and the price field will be equal to the priceWithoutTax field.
-            
+
             If taxAuthGeoId or taxAuthPartyId empty then the taxInPrice field will be ignored.
         </description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
@@ -1303,14 +1303,14 @@ under the License.
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
 
-    <service name="catalogPermissionCheck" engine="simple"
-        location="component://product/minilang/product/catalog/CatalogServices.xml" invoke="catalogPermissionCheck" auth="true">
+    <service name="catalogPermissionCheck" engine="groovy"
+        location="component://product/groovyScripts/product/catalog/CatalogServices.groovy" invoke="catalogPermissionCheck" auth="true">
         <description>Catalog Permission Checking Logic</description>
         <implements service="permissionInterface"/>
     </service>
 
-    <service name="prodCatalogToPartyPermissionCheck" engine="simple"
-            location="component://product/minilang/product/catalog/CatalogServices.xml" invoke="prodCatalogToPartyPermissionCheck">
+    <service name="prodCatalogToPartyPermissionCheck" engine="groovy"
+            location="component://product/groovyScripts/product/catalog/CatalogServices.groovy" invoke="prodCatalogToPartyPermissionCheck">
         <description>ProdCatalogToParty Permission Checking Logic</description>
         <implements service="permissionInterface"/>
     </service>
@@ -1320,7 +1320,7 @@ under the License.
         <description>Create product and inventory item</description>
         <attribute name="dirName" type="java.lang.String" mode="IN" optional="true"/>
     </service>
-    
+
     <!-- Start Web Analytics configuration services -->
     <service name="createWebAnalyticsConfig" default-entity-name="WebAnalyticsConfig" engine="entity-auto" invoke="create" auth="true">
         <description>Create a WebAnalyticsConfig</description>
@@ -1336,7 +1336,7 @@ under the License.
         <description>Delete a WebAnalyticsConfig</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
-    
+
     <service name="createWebAnalyticsType" default-entity-name="WebAnalyticsType" engine="entity-auto" invoke="create" auth="true">
         <description>Create a WebAnalyticsType</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
@@ -1351,7 +1351,7 @@ under the License.
         <description>Delete a WebAnalyticsType</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
-    
+
     <!-- Product Promo Content services -->
     <service name="createProductPromoContent" default-entity-name="ProductPromoContent" engine="entity-auto" invoke="create" auth="true">
         <description>Create Product Promo Content</description>
@@ -1517,12 +1517,12 @@ under the License.
         location="component://product/minilang/product/imagemanagement/ImageManagementServices.xml" invoke="createImageContentApproval" auth="true">
         <attribute name="contentId" mode="IN" type="String" optional="false"/>
     </service>
-    
+
     <service name="removeImageContentApproval" engine="simple"
         location="component://product/minilang/product/imagemanagement/ImageManagementServices.xml" invoke="removeImageContentApproval" auth="true">
         <attribute name="partyId" mode="IN" type="String" optional="false"/>
     </service>
-    
+
     <service name="resizeImages" engine="simple"
         location="component://product/minilang/product/imagemanagement/ImageManagementServices.xml" invoke="resizeImages" auth="true">
         <description>Resize Images.</description>
@@ -1530,7 +1530,7 @@ under the License.
         <attribute name="productId" mode="IN" type="String" optional="false"/>
         <attribute name="size" mode="IN" type="String" optional="false"/>
     </service>
-    
+
     <service name="resizeImageOfProduct" engine="java"
         location="org.apache.ofbiz.product.imagemanagement.ImageManagementServices" invoke="resizeImageOfProduct" auth="true">
         <description>Resize Image Of Product.</description>
@@ -1538,7 +1538,7 @@ under the License.
         <attribute name="dataResourceName" mode="IN" type="String" optional="false"/>
         <attribute name="resizeWidth" mode="IN" type="String" optional="false"/>
     </service>
-    
+
     <service name="createNewImageThumbnail" engine="java"
         location="org.apache.ofbiz.product.imagemanagement.ImageManagementServices" invoke="createNewImageThumbnail" auth="true">
         <description>Create New Image Thumbnail.</description>
@@ -1548,14 +1548,14 @@ under the License.
         <attribute name="drObjectInfo" mode="IN" type="String" optional="false"/>
         <attribute name="sizeWidth" mode="IN" type="String" optional="false"/>
     </service>
-    
+
     <service name="removeImageBySize" engine="simple"
         location="component://product/minilang/product/imagemanagement/ImageManagementServices.xml" invoke="removeImageBySize" auth="true">
         <description>Remove Image By Size.</description>
         <attribute name="productId" mode="IN" type="String" optional="false"/>
         <attribute name="mapKey" mode="IN" type="String" optional="false"/>
     </service>
-    
+
     <service name="replaceImageToExistImage" engine="java"
         location="org.apache.ofbiz.product.imagemanagement.ReplaceImage" invoke="replaceImageToExistImage" auth="true">
         <description>Resize Image Of Product.</description>
@@ -1565,7 +1565,7 @@ under the License.
         <attribute name="dataResourceNameExist" mode="IN" type="String" optional="false"/>
         <attribute name="dataResourceNameReplace" mode="IN" type="String" optional="false"/>
     </service>
-    
+
     <service name="renameImage" engine="java"
         location="org.apache.ofbiz.product.imagemanagement.ImageManagementServices" invoke="renameImage" auth="true">
         <description>Rename Image.</description>
@@ -1573,10 +1573,10 @@ under the License.
         <attribute name="contentId" mode="IN" type="String" optional="false"/>
         <attribute name="drDataResourceName" mode="IN" type="String" optional="false"/>
     </service>
-    
+
     <!-- Alternative URLs -->
-    <service name="createMissingCategoryAndProductAltUrls" engine="simple"
-                location="component://product/minilang/product/catalog/CatalogServices.xml" invoke="createMissingCategoryAndProductAltUrls" auth="true" use-transaction="false">
+    <service name="createMissingCategoryAndProductAltUrls" engine="groovy"
+                location="component://product/groovyScripts/product/catalog/CatalogServices.groovy" invoke="createMissingCategoryAndProductAltUrls" auth="true" use-transaction="false">
         <description>Create missing Category and Product Alternative URLs</description>
         <attribute name="prodCatalogId" mode="INOUT" type="String" optional="false"/>
         <attribute name="category" mode="IN" type="String" optional="true"/>
@@ -1593,7 +1593,7 @@ under the License.
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    
+
     <service name="updateMarketInterest" default-entity-name="MarketInterest" engine="entity-auto" invoke="update" auth="true">
         <description>Update a Market Interest</description>
         <permission-service service-name="productGenericPermission" main-action="UPDATE"/>

Modified: ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services_maint.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services_maint.xml?rev=1865912&r1=1865911&r2=1865912&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services_maint.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services_maint.xml Mon Aug 26 08:07:41 2019
@@ -93,64 +93,64 @@ under the License.
     </service>
 
     <!-- Check Urls exists or not related services -->
-    <service name="checkImageUrlForAllCategories" engine="simple"
-      location="component://product/minilang/product/catalog/CatalogServices.xml" invoke="checkImageUrlForAllCategories" transaction-timeout="36000">
+    <service name="checkImageUrlForAllCategories" engine="groovy"
+      location="component://product/groovyScripts/product/catalog/CatalogServices.groovy" invoke="checkImageUrlForAllCategories" transaction-timeout="36000">
         <description>check For Image Urls exists or not for all categories</description>
         <attribute name="topCategory" type="String" mode="IN" optional="true"/>
         <attribute name="excludeEmpty" type="Boolean" mode="IN" optional="true"/>
         <attribute name="categoriesMap" type="java.util.Map" mode="OUT" optional="true"/>
     </service>
 
-    <service name="getAllCategories" engine="simple"
-      location="component://product/minilang/product/catalog/CatalogServices.xml" invoke="getAllCategories">
+    <service name="getAllCategories" engine="groovy"
+      location="component://product/groovyScripts/product/catalog/CatalogServices.groovy" invoke="getAllCategories">
         <description>Get all categories of a category </description>
         <attribute name="topCategory" type="String" mode="IN" optional="true"/>
         <attribute name="categories" type="java.util.List" mode="OUT" optional="true"/>
     </service>
 
-    <service name="getRelatedCategories" engine="simple"
-      location="component://product/minilang/product/catalog/CatalogServices.xml" invoke="getRelatedCategories">
+    <service name="getRelatedCategories" engine="groovy"
+      location="component://product/groovyScripts/product/catalog/CatalogServices.groovy" invoke="getRelatedCategories">
         <description>Get all related categories of a category </description>
         <attribute name="parentProductCategoryId" type="String" mode="IN" optional="false"/>
         <attribute name="categories" type="java.util.List" mode="INOUT" optional="true"/>
     </service>
-    
+
     <service name="getCategoryTrail" engine="java"
       location="org.apache.ofbiz.product.category.CategoryWorker" invoke="getCategoryTrail">
-        <description> Returns a complete category trail - can be used for exporting proper category trees. 
-        This is mostly useful when used in combination with breadcrumbs,  for building a facetted index tree, 
+        <description> Returns a complete category trail - can be used for exporting proper category trees.
+        This is mostly useful when used in combination with breadcrumbs,  for building a facetted index tree,
         or to export a category tree for migration to another system.
-        Will create the tree from root point to categoryId. 
-        
+        Will create the tree from root point to categoryId.
+
         This service is not meant to be run on every request.
-        Its best use is to generate the trail every so often and store somewhere (a lucene/solr tree, entities, cache or so). 
+        Its best use is to generate the trail every so often and store somewhere (a lucene/solr tree, entities, cache or so).
         </description>
         <attribute name="productCategoryId" type="String" mode="IN" optional="false"/>
         <attribute name="trail" type="java.util.List" mode="OUT" optional="true"/>
     </service>
 
-    <service name="checkImageUrlForCategoryAndProduct" engine="simple"
-      location="component://product/minilang/product/catalog/CatalogServices.xml" invoke="checkImageUrlForCategoryAndProduct">
+    <service name="checkImageUrlForCategoryAndProduct" engine="groovy"
+      location="component://product/groovyScripts/product/catalog/CatalogServices.groovy" invoke="checkImageUrlForCategoryAndProduct">
         <description>check For Image Urls exists or not for category</description>
         <attribute name="categoryId" type="String" mode="IN" optional="false"/>
         <attribute name="fileNotExists" type="java.util.List" mode="OUT" optional="true"/>
         <attribute name="fileExists" type="java.util.List" mode="OUT" optional="true"/>
     </service>
-    <service name="checkImageUrlForCategory" engine="simple"
-      location="component://product/minilang/product/catalog/CatalogServices.xml" invoke="checkImageUrlForCategory">
+    <service name="checkImageUrlForCategory" engine="groovy"
+      location="component://product/groovyScripts/product/catalog/CatalogServices.groovy" invoke="checkImageUrlForCategory">
         <description>check For Image Urls exists or not For Product</description>
         <attribute name="categoryId" type="String" mode="IN" optional="false"/>
         <attribute name="filesImageMap" type="java.util.Map" mode="OUT" optional="true"/>
     </service>
-    <service name="checkImageUrlForProduct" engine="simple"
-      location="component://product/minilang/product/catalog/CatalogServices.xml" invoke="checkImageUrlForProduct">
+    <service name="checkImageUrlForProduct" engine="groovy"
+      location="component://product/groovyScripts/product/catalog/CatalogServices.groovy" invoke="checkImageUrlForProduct">
         <description>check For Image Urls exists or not For Product</description>
         <attribute name="productId" type="String" mode="IN" optional="false"/>
         <attribute name="filesImageMap" type="java.util.Map" mode="OUT" optional="true"/>
     </service>
 
-    <service name="checkImageUrl" engine="simple"
-      location="component://product/minilang/product/catalog/CatalogServices.xml" invoke="checkImageUrl">
+    <service name="checkImageUrl" engine="groovy"
+      location="component://product/groovyScripts/product/catalog/CatalogServices.groovy" invoke="checkImageUrl">
         <description>check For Image Urls exists or not</description>
         <attribute name="imageUrl" type="String" mode="IN" optional="false"/>
         <attribute name="isExists" type="String" mode="OUT" optional="true"/>