[ofbiz-framework] branch trunk updated: Improved: Convert CategoryContentServices.xml mini lang to groovy.

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

[ofbiz-framework] branch trunk updated: Improved: Convert CategoryContentServices.xml mini lang to groovy.

mbrohl
This is an automated email from the ASF dual-hosted git repository.

mbrohl pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f3d3547  Improved: Convert CategoryContentServices.xml mini lang to groovy.
f3d3547 is described below

commit f3d3547515aaba8d62f93b364116b8a4d4285034
Author: Michael Brohl <[hidden email]>
AuthorDate: Tue Feb 25 20:27:51 2020 +0100

    Improved: Convert CategoryContentServices.xml mini lang to groovy.
   
    (OFBIZ-10001)
   
    Thanks Dennis Balkir for reporting and the initial work,
    Deepak Dixit for review and Sebastian Berg for the refactored patch.
---
 .../category/CategoryContentServices.groovy        | 215 ++++++++++++++++++++
 .../product/category/CategoryContentServices.xml   | 222 ---------------------
 applications/product/servicedef/services.xml       |  49 ++---
 3 files changed, 237 insertions(+), 249 deletions(-)

diff --git a/applications/product/groovyScripts/product/category/CategoryContentServices.groovy b/applications/product/groovyScripts/product/category/CategoryContentServices.groovy
new file mode 100644
index 0000000..705cdc5
--- /dev/null
+++ b/applications/product/groovyScripts/product/category/CategoryContentServices.groovy
@@ -0,0 +1,215 @@
+/*
+ * 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.entity.GenericValue
+import org.apache.ofbiz.entity.util.EntityUtil
+import org.apache.ofbiz.service.ModelService
+
+
+/**
+ * Create Content For Product Category
+ */
+def createCategoryContent() {
+    GenericValue newEntity = delegator.makeValue("ProductCategoryContent")
+    newEntity.setPKFields(parameters, true)
+    newEntity.setNonPKFields(parameters, true)
+
+    if(!newEntity.fromDate) {
+        Timestamp nowTimestamp = UtilDateTime.nowTimestamp()
+        newEntity.fromDate  = nowTimestamp
+    }
+
+    newEntity.create()
+
+    Map updateContent = dispatcher.getDispatchContext().makeValidContext("updateContent", ModelService.IN_PARAM, parameters)
+    run service: "updateContent", with: updateContent
+    Map result = success()
+    result.contentId = newEntity.contentId
+    result.productCategoryId = newEntity.productCategoryId
+    result.prodCatContentTypeId = newEntity.prodCatContentTypeId
+    return result
+}
+
+/**
+ * Update Content For Category
+ */
+def updateCategoryContent() {
+    GenericValue lookupPKMap = delegator.makeValue("ProductCategoryContent")
+    lookupPKMap.setPKFields(parameters, true)
+    Map lookedUpValue = from("ProductCategoryContent").where(lookupPKMap).queryOne()
+    lookedUpValue.setNonPKFields(parameters, true)
+    lookedUpValue.store()
+
+    Map updateContent = dispatcher.getDispatchContext().makeValidContext("updateContent", ModelService.IN_PARAM, parameters)
+    run service: "updateContent", with: updateContent
+}
+
+/**
+ * Create Simple Text Content For Product Category
+ */
+def createSimpleTextContentForCategory() {
+    Map createCategoryContentMap = dispatcher.getDispatchContext().makeValidContext("createCategoryContent", ModelService.IN_PARAM, parameters)
+    Map createSimpleTextMap = dispatcher.getDispatchContext().makeValidContext("createSimpleTextContent", ModelService.IN_PARAM, parameters)
+    Map cstcRes = run service: "createSimpleTextContent", with: createSimpleTextMap
+    createCategoryContentMap.contentId = cstcRes.contentId
+    run service: "createCategoryContent", with: createCategoryContentMap
+}
+
+/**
+ * Update SEO Content For Product Category
+ */
+def updateContentSEOForCategory() {
+    updateContent("title", "PAGE_TITLE")
+    updateContent("metaKeyword", "META_KEYWORD")
+    updateContent("metaDiscription", "META_DESCRIPTION")
+}
+
+/**
+ * This method updates the content for the parameters given
+ * @param param
+ * @param typeId
+ */
+def updateContent(param, typeId) {
+    if (parameters."${param}") {
+        List productCategoryContents = from("ProductCategoryContentAndInfo")
+            .where("productCategoryId", parameters.productCategoryId, "prodCatContentTypeId", typeId)
+            .queryList()
+        if (productCategoryContents) {
+            Map productCategoryContent = EntityUtil.getFirst(productCategoryContents)
+            Map electronicText = from("ElectronicText").where("dataResourceId", productCategoryContent).queryOne()
+            if (electronicText) {
+                electronicText.textData = parameters."${param}"
+                electronicText.store()
+            }
+        } else {
+            Map createTextContentMap = [
+                productCategoryId: parameters.productCategoryId,
+                prodCatContentTypeId: typeId,
+                text: parameters."${param}"
+            ]
+            run service: "createSimpleTextContentForCategory", with: createTextContentMap
+        }
+    }
+}
+
+/**
+ * Create Related URL Content For Product Category
+ */
+def createRelatedUrlContentForCategory() {
+    String url = parameters.url
+    url = url.trim()
+    if (url.indexOf("&quot;http://&quot;") != 0) {
+        url = "&quot;http://&quot;" + url
+    }
+    Map dataResource = [
+        dataRescourceName: parameters.title,
+        dataRescourceTypeId: "URL_RESOURCE",
+        mimeTypeId: "text/plain",
+        objectInfo: url,
+        localeString: parameters.localeString
+    ]
+    Map rescRes = run service: "createDataResource", with: dataResource
+    parameters.dataResourceId = rescRes.dataResourceId
+    Map content = [
+        contentTypeId:"DOCUMENT",
+        dataResourceId: parameters.dataResourceId,
+        contentName: parameters.title,
+        description: parameters.description,
+        localeString: parameters.localeString,
+        createdByUserLogin: parameters.userLogin.userLoginId
+    ]
+    Map contRes = run service: "createContent", with: content
+    parameters.contentId = contRes.contentId
+    Map createCategoryContentMap = dispatcher.getDispatchContext().makeValidContext("createCategoryContent", ModelService.IN_PARAM, parameters)
+    run service: "createContentCategory", with: createCategoryContentMap
+}
+
+/**
+ * Update Related URL Content For Product Category
+ */
+def updateRelatedUrlContentForCategory() {
+    Map updateCategoryContent = dispatcher.getDispatchContext().makeValidContext("updateCategoryContent", ModelService.IN_PARAM, parameters)
+    run service: "updateCategoryContent", with: updateCategoryContent
+    Map dataResource = [
+        dataResourceId: parameters.dataResourceId,
+        dataResourceName: parameters.title,
+        objectInfo: parameters.url,
+        localeString: parameters.localeString
+    ]
+    run service: "updateDataResource", with: dataResource
+    Map updateContent = [
+        contentId: parameters.contentId,
+        contentName: parameters.title,
+        description: parameters.description,
+        localeString: parameters.localeString
+    ]
+    run service: "updateContent", with: updateContent
+}
+
+/**
+ * Create Download Content For Category
+ */
+def createDownloadContentForCategory() {
+    Map createCategoryContent = dispatcher.getDispatchContext().makeValidContext("createCategoryContent", ModelService.IN_PARAM, parameters)
+    // create data resource
+    Map data = [
+        dataResourceTypeId: parameters.dataResourceTypeId,
+        dataResourceName: parameters._uploadedFile_fileName,
+        mimeTypeId: parameters._uploadedFile_contentType,
+        uploadedFile: parameters.uploadedFile
+    ]
+    Map creDatRes = run service: "createDataResource", with: data
+    parameters.dataResourceId = creDatRes.dataResourceId
+    // create attach upload to data resource
+    Map attachMap = dispatcher.getDispatchContext().makeValidContext("attachUploadToDataResource", ModelService.IN_PARAM, parameters)
+    attachMap = [
+        uploadedFile: parameters.uploadedFile,
+        _uploadedFile_fileName: parameters._uploadedFile_fileName,
+        _uploadedFile_contentType: parameters._uploadedFile_contentType
+    ]
+    run service: "attachUploadToDataResource", with: attachMap
+    // create content from dataResource
+    Map contentMap = dispatcher.getDispatchContext().makeValidContext("createContentFromDataResource", ModelService.IN_PARAM, parameters)
+    contentMap.contentTypeId = "DOCUMENT"
+    Map creConRes = run service: "createContentFromDataResource", with: contentMap
+    createCategoryContent.contentId = creConRes.contentId
+
+    createCategoryContent.contentId = parameters.contentId
+    run service: "createCategoryContent", with: createCategoryContent
+}
+
+/**
+ * Update Download Content For Category
+ */
+def updateDownloadContentForCategory() {
+    Map attachMap = [
+        uploadedFile: parameters.uploadedFile,
+        _uploadedFile_fileName: parameters._uploadedFile_fileName,
+        _uploadedFile_contentType: parameters._uploadedFile_contentType,
+        mimeTypeId: parameters._uploadedFile_contentType,
+        dataResourceId: parameters.fileDataResourceId
+    ]
+    run service: "attachUploadToDataResource", with: attachMap
+
+    Map updateCategoryContent = dispatcher.getDispatchContext().makeValidContext("updateCategoryContent", ModelService.IN_PARAM, parameters)
+    run sevrice: "updateCategoryContent", with: updateCategoryContent
+}
\ No newline at end of file
diff --git a/applications/product/minilang/product/category/CategoryContentServices.xml b/applications/product/minilang/product/category/CategoryContentServices.xml
deleted file mode 100644
index 39a36b6..0000000
--- a/applications/product/minilang/product/category/CategoryContentServices.xml
+++ /dev/null
@@ -1,222 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
-
-<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
-    <!-- ProductCategoryContent -->
-    <simple-method method-name="createCategoryContent" short-description="Create Content For Product Category">
-        <make-value entity-name="ProductCategoryContent" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-
-        <if-empty field="newEntity.fromDate">
-            <now-timestamp field="nowTimestamp"/>
-            <set field="newEntity.fromDate" from-field="nowTimestamp"/>
-        </if-empty>
-
-        <create-value value-field="newEntity"/>
-
-        <set-service-fields service-name="updateContent" map="parameters" to-map="updateContent"/>
-        <call-service service-name="updateContent" in-map-name="updateContent"/>
-
-        <field-to-result field="newEntity.contentId" result-name="contentId"/>
-        <field-to-result field="newEntity.productCategoryId" result-name="productCategoryId"/>
-        <field-to-result field="newEntity.prodCatContentTypeId" result-name="prodCatContentTypeId"/>
-    </simple-method>
-    <simple-method method-name="updateCategoryContent" short-description="Update Content For Category">
-        <make-value entity-name="ProductCategoryContent" value-field="lookupPKMap"/>
-        <set-pk-fields map="parameters" value-field="lookupPKMap"/>
-        <find-by-primary-key entity-name="ProductCategoryContent" map="lookupPKMap" value-field="lookedUpValue"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <store-value value-field="lookedUpValue"/>
-
-        <set-service-fields service-name="updateContent" map="parameters" to-map="updateContent"/>
-        <call-service service-name="updateContent" in-map-name="updateContent"/>
-    </simple-method>
-
-    <simple-method method-name="createSimpleTextContentForCategory" short-description="Create Simple Text Content For Product Category">
-        <set-service-fields service-name="createCategoryContent" map="parameters" to-map="createCategoryContentMap"/>
-        <set-service-fields service-name="createSimpleTextContent" map="parameters" to-map="createSimpleTextMap"/>
-        <call-service service-name="createSimpleTextContent" in-map-name="createSimpleTextMap">
-            <result-to-field result-name="contentId" field="createCategoryContentMap.contentId"/>
-        </call-service>
-        <call-service service-name="createCategoryContent" in-map-name="createCategoryContentMap"/>
-    </simple-method>
-    <simple-method method-name="updateSimpleTextContentForCategory" short-description="Update Simple Text Content For Product Category">
-        <set-service-fields service-name="updateCategoryContent" map="parameters" to-map="updateCategoryContent"/>
-        <call-service service-name="updateCategoryContent" in-map-name="updateCategoryContent"/>
-        <set-service-fields service-name="updateSimpleTextContent" map="parameters" to-map="updateSimpleText"/>
-        <call-service service-name="updateSimpleTextContent" in-map-name="updateSimpleText"/>
-    </simple-method>
-
-    <simple-method method-name="updateContentSEOForCategory" short-description="Update SEO Content For Product Category">
-        <if-not-empty field="parameters.title">
-            <entity-and entity-name="ProductCategoryContentAndInfo" list="productCategoryContents">
-                <field-map field-name="productCategoryId" from-field="parameters.productCategoryId"/>
-                <field-map field-name="prodCatContentTypeId" value="PAGE_TITLE"/>
-            </entity-and>
-            <if-not-empty field="productCategoryContents">
-                <first-from-list entry="productCategoryContent" list="productCategoryContents"/>
-                <entity-one entity-name="ElectronicText" value-field="electronicText">
-                    <field-map field-name="dataResourceId" from-field="productCategoryContent.dataResourceId"/>
-                </entity-one>
-                <if-not-empty field="electronicText">
-                    <set field="electronicText.textData" from-field="parameters.title"/>
-                    <store-value value-field="electronicText"/>
-                </if-not-empty>
-            <else>
-                <set field="createTextContentMap.productCategoryId" from-field="parameters.productCategoryId"/>
-                <set field="createTextContentMap.prodCatContentTypeId" value="PAGE_TITLE"/>
-                <set field="createTextContentMap.text" from-field="parameters.title"/>
-                <call-service service-name="createSimpleTextContentForCategory" in-map-name="createTextContentMap"/>
-            </else>
-            </if-not-empty>
-        </if-not-empty>
-        <if-not-empty field="parameters.metaKeyword">
-            <entity-and entity-name="ProductCategoryContentAndInfo" list="productCategoryContents">
-                <field-map field-name="productCategoryId" from-field="parameters.productCategoryId"/>
-                <field-map field-name="prodCatContentTypeId" value="META_KEYWORD"/>
-            </entity-and>
-            <if-not-empty field="productCategoryContents">
-                <first-from-list entry="productCategoryContent" list="productCategoryContents"/>
-                <entity-one entity-name="ElectronicText" value-field="electronicText">
-                    <field-map field-name="dataResourceId" from-field="productCategoryContent.dataResourceId"/>
-                </entity-one>
-                <if-not-empty field="electronicText">
-                    <set field="electronicText.textData" from-field="parameters.metaKeyword"/>
-                    <store-value value-field="electronicText"/>
-                </if-not-empty>
-            <else>
-                <set field="createTextContentMap.productCategoryId" from-field="parameters.productCategoryId"/>
-                <set field="createTextContentMap.prodCatContentTypeId" value="META_KEYWORD"/>
-                <set field="createTextContentMap.text" from-field="parameters.metaKeyword"/>
-                <call-service service-name="createSimpleTextContentForCategory" in-map-name="createTextContentMap"/>
-            </else>
-            </if-not-empty>
-        </if-not-empty>
-        <if-not-empty field="parameters.metaDescription">
-            <entity-and entity-name="ProductCategoryContentAndInfo" list="productCategoryContents">
-                <field-map field-name="productCategoryId" from-field="parameters.productCategoryId"/>
-                <field-map field-name="prodCatContentTypeId" value="META_DESCRIPTION"/>
-            </entity-and>
-            <if-not-empty field="productCategoryContents">
-                <first-from-list entry="productCategoryContent" list="productCategoryContents"/>
-                <entity-one entity-name="ElectronicText" value-field="electronicText">
-                    <field-map field-name="dataResourceId" from-field="productCategoryContent.dataResourceId"/>
-                </entity-one>
-                <if-not-empty field="electronicText">
-                    <set field="electronicText.textData" from-field="parameters.metaDescription"/>
-                    <store-value value-field="electronicText"/>
-                </if-not-empty>
-            <else>
-                <set field="createTextContentMap.productCategoryId" from-field="parameters.productCategoryId"/>
-                <set field="createTextContentMap.prodCatContentTypeId" value="META_DESCRIPTION"/>
-                <set field="createTextContentMap.text" from-field="parameters.metaDescription"/>
-                <call-service service-name="createSimpleTextContentForCategory" in-map-name="createTextContentMap"/>
-            </else>
-            </if-not-empty>
-        </if-not-empty>
-    </simple-method>
-
-    <simple-method method-name="createRelatedUrlContentForCategory" short-description="Create Related URL Content For Product Category">
-        <set field="dataResource.dataResourceName" from-field="parameters.title"/>
-        <set field="dataResource.dataResourceTypeId" value="URL_RESOURCE"/>
-        <set field="dataResource.mimeTypeId" value="text/plain"/>
-        <set field="url" value="${groovy: temp = parameters.url;
-            temp = temp.trim();
-            if(temp.indexOf(&quot;http://&quot;) == 0) return temp;
-            if(temp.indexOf(&quot;https://&quot;) == 0) return temp;
-            if(temp.indexOf(&quot;http://&quot;) != 0) return &quot;http://&quot; + temp;
-        }" type="String"/>
-        <set field="dataResource.objectInfo" from-field="url"/>
-        <set field="dataResource.localeString" from-field="parameters.localeString"/>
-        <call-service service-name="createDataResource" in-map-name="dataResource">
-            <result-to-field result-name="dataResourceId" field="parameters.dataResourceId"/>
-        </call-service>
-        
-        <set field="content.contentTypeId" value="DOCUMENT"/>
-        <set field="content.dataResourceId" from-field="parameters.dataResourceId"/>
-        <set field="content.contentName" from-field="parameters.title"/>
-        <set field="content.description" from-field="parameters.description"/>
-        <set field="content.localeString" from-field="parameters.localeString"/>
-        <set field="content.createdByUserLogin" from-field="userLogin.userLoginId"/>
-        <call-service service-name="createContent" in-map-name="content">
-            <result-to-field result-name="contentId" field="parameters.contentId"/>
-        </call-service>
-
-        <set-service-fields service-name="createCategoryContent" map="parameters" to-map="createCategoryContentMap"/>
-        <call-service service-name="createCategoryContent" in-map-name="createCategoryContentMap"/>
-    </simple-method>
-    <simple-method method-name="updateRelatedUrlContentForCategory" short-description="Update Related URL Content For Product Category">
-        <set-service-fields service-name="updateCategoryContent" map="parameters" to-map="updateCategoryContent"/>
-        <call-service service-name="updateCategoryContent" in-map-name="updateCategoryContent"/>
-
-        <set field="dataResource.dataResourceId" from-field="parameters.dataResourceId"/>
-        <set field="dataResource.dataResourceName" from-field="parameters.title"/>
-        <set field="dataResource.objectInfo" from-field="parameters.url"/>
-        <set field="dataResource.localeString" from-field="parameters.localeString"/>
-        <call-service service-name="updateDataResource" in-map-name="dataResource"/>
-
-        <set field="updateContent.contentId" from-field="parameters.contentId"/>
-        <set field="updateContent.contentName" from-field="parameters.title"/>
-        <set field="updateContent.description" from-field="parameters.description"/>
-        <set field="updateContent.localeString" from-field="parameters.localeString"/>
-        <call-service service-name="updateContent" in-map-name="updateContent"/>
-    </simple-method>
-
-    <simple-method method-name="createDownloadContentForCategory" short-description="Create Download Content For Category">
-        <set-service-fields service-name="createCategoryContent" map="parameters" to-map="createCategoryContent"/>
-        <!-- Create Data Resource -->
-        <set field="data.dataResourceTypeId" from-field="parameters.dataResourceTypeId"/>
-        <set field="data.dataResourceName" from-field="parameters._imageData_fileName"/>
-        <set field="data.mimeTypeId" from-field="parameters._imageData_contentType"/>
-        <set field="data.uploadedFile" from-field="parameters.imageData"/>
-        <call-service service-name="createDataResource" in-map-name="data">
-            <result-to-field result-name="dataResourceId" field="parameters.dataResourceId"/>
-        </call-service>
-        <!-- Create attach upload to data resource -->
-        <set-service-fields service-name="attachUploadToDataResource" map="parameters" to-map="attachMap"/>
-        <set field="attachMap.uploadedFile" from-field="parameters.imageData"/>
-        <set field="attachMap._uploadedFile_fileName" from-field="parameters._imageData_fileName"/>
-        <set field="attachMap._uploadedFile_contentType" from-field="parameters._imageData_contentType"/>
-        <call-service service-name="attachUploadToDataResource" in-map-name="attachMap"/>
-        <!-- Create content from dataResource -->
-        <set-service-fields service-name="createContentFromDataResource" map="parameters" to-map="contentMap"/>
-        <set field="contentMap.contentTypeId" value="DOCUMENT"/>
-        <call-service service-name="createContentFromDataResource" in-map-name="contentMap">
-            <result-to-field result-name="contentId" field="createCategoryContent.contentId"/>
-        </call-service>
-
-        <set field="createCategoryContent.contentId" from-field="parameters.contentId"/>
-        <call-service service-name="createCategoryContent" in-map-name="createCategoryContent"/>
-    </simple-method>
-
-    <simple-method method-name="updateDownloadContentForCategory" short-description="Update Download Content For Category">
-        <set field="attachMap.uploadedFile" from-field="parameters.imageData"/>
-        <set field="attachMap._uploadedFile_fileName" from-field="parameters._imageData_fileName"/>
-        <set field="attachMap._uploadedFile_contentType" from-field="parameters._imageData_contentType"/>
-        <set field="attachMap.mimeTypeId" from-field="parameters._imageData_contentType"/>
-        <set field="attachMap.dataResourceId" from-field="parameters.fileDataResourceId"/>
-        <call-service service-name="attachUploadToDataResource" in-map-name="attachMap"/>
-
-        <set-service-fields service-name="updateCategoryContent" map="parameters" to-map="updateCategoryContent"/>
-        <call-service service-name="updateCategoryContent" in-map-name="updateCategoryContent"/>
-    </simple-method>
-</simple-methods>
diff --git a/applications/product/servicedef/services.xml b/applications/product/servicedef/services.xml
index b44cba7..249750a 100644
--- a/applications/product/servicedef/services.xml
+++ b/applications/product/servicedef/services.xml
@@ -914,8 +914,8 @@ under the License.
 
 
     <!-- Category content services -->
-    <service name="createCategoryContent" default-entity-name="ProductCategoryContent" engine="simple"
-            location="component://product/minilang/product/category/CategoryContentServices.xml" invoke="createCategoryContent" auth="true">
+    <service name="createCategoryContent" default-entity-name="ProductCategoryContent" engine="groovy"
+            location="component://product/groovyScripts/product/category/CategoryContentServices.groovy" invoke="createCategoryContent" auth="true">
         <description>Add Content To Category</description>
         <auto-attributes include="pk" mode="INOUT" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
@@ -923,8 +923,8 @@ under the License.
         <override name="fromDate" optional="true"/>
         <!--<override name="contentId" optional="true" mode="INOUT"/>-->
     </service>
-    <service name="updateCategoryContent" default-entity-name="ProductCategoryContent" engine="simple"
-            location="component://product/minilang/product/category/CategoryContentServices.xml" invoke="updateCategoryContent" auth="true">
+    <service name="updateCategoryContent" default-entity-name="ProductCategoryContent" engine="groovy"
+            location="component://product/groovyScripts/product/category/CategoryContentServices.groovy" invoke="updateCategoryContent" auth="true">
         <description>Update Content To Category</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
@@ -935,8 +935,8 @@ under the License.
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
 
-    <service name="createSimpleTextContentForCategory" default-entity-name="ProductCategoryContent" engine="simple"
-            location="component://product/minilang/product/category/CategoryContentServices.xml" invoke="createSimpleTextContentForCategory" auth="true">
+    <service name="createSimpleTextContentForCategory" default-entity-name="ProductCategoryContent" engine="groovy"
+            location="component://product/groovyScripts/product/category/CategoryContentServices.groovy" invoke="createSimpleTextContentForCategory" auth="true">
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
@@ -944,13 +944,12 @@ under the License.
         <override name="contentId" optional="true"/>
         <override name="fromDate" optional="true"/>
     </service>
-    <service name="updateSimpleTextContentForCategory" default-entity-name="ProductCategoryContent" engine="simple"
-            location="component://product/minilang/product/category/CategoryContentServices.xml" invoke="updateSimpleTextContentForCategory" auth="true">
-        <auto-attributes include="pk" mode="IN" optional="false"/>
-        <auto-attributes include="nonpk" mode="IN" optional="true"/>
-        <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
-        <attribute name="textDataResourceId" type="String" mode="IN" optional="true"/>
-        <attribute name="text" type="String" mode="IN" optional="true" allow-html="safe"/>
+    <service name="updateSimpleTextContentForCategory" engine="group" auth="true">
+        <description>Update Simple Text Content For Product Category</description>
+        <group>
+            <invoke name="updateCategoryContent"/>
+            <invoke name="updateSimpleTextContent"/>
+        </group>
     </service>
 
     <service name="updateContentSEOForCategory" engine="simple"
@@ -962,8 +961,8 @@ under the License.
         <attribute name="metaDescription" mode="IN" type="String" optional="true"/>
     </service>
 
-    <service name="createRelatedUrlContentForCategory" engine="simple" default-entity-name="ProductCategoryContent"
-            location="component://product/minilang/product/category/CategoryContentServices.xml" invoke="createRelatedUrlContentForCategory" auth="true">
+    <service name="createRelatedUrlContentForCategory" engine="groovy" default-entity-name="ProductCategoryContent"
+            location="component://product/groovyScripts/product/category/CategoryContentServices.groovy" invoke="createRelatedUrlContentForCategory" auth="true">
         <description>Create Related URL Content For Product Category</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
@@ -974,8 +973,8 @@ under the License.
         <override name="contentId" optional="true"/>
         <override name="fromDate" optional="true"/>
     </service>
-    <service name="updateRelatedUrlContentForCategory" engine="simple" default-entity-name="ProductCategoryContent"
-            location="component://product/minilang/product/category/CategoryContentServices.xml" invoke="updateRelatedUrlContentForCategory" auth="true">
+    <service name="updateRelatedUrlContentForCategory" engine="groovy" default-entity-name="ProductCategoryContent"
+            location="component://product/groovyScripts/product/category/CategoryContentServices.groovy" invoke="updateRelatedUrlContentForCategory" auth="true">
         <description>Update Related URL Content For Product Category</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
@@ -987,25 +986,21 @@ under the License.
         <attribute name="localeString" type="String" mode="IN" optional="true"/>
     </service>
 
-    <service name="createDownloadContentForCategory" default-entity-name="ProductCategoryContent" engine="simple"
-        location="component://product/minilang/product/category/CategoryContentServices.xml" invoke="createDownloadContentForCategory" auth="true">
+    <service name="createDownloadContentForCategory" default-entity-name="ProductCategoryContent" engine="groovy"
+        location="component://product/groovyScripts/product/category/CategoryContentServices.groovy" invoke="createDownloadContentForCategory" auth="true">
+        <implements service="uploadFileInterface"/>
         <auto-attributes include="pk" mode="IN" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" entity-name="Content" optional="true"/>
-        <attribute mode="IN" name="imageData" optional="true" type="java.nio.ByteBuffer"/>
-        <attribute mode="IN" name="_imageData_contentType" optional="true" type="String"/>
-        <attribute mode="IN" name="_imageData_fileName" optional="true" type="String"/>
         <attribute name="dataResourceTypeId" type="String" mode="IN" optional="true"/>
         <override name="prodCatContentTypeId" optional="false"/>
     </service>
-    <service name="updateDownloadContentForCategory" default-entity-name="ProductCategoryContent" engine="simple"
-        location="component://product/minilang/product/category/CategoryContentServices.xml" invoke="updateDownloadContentForCategory" auth="true">
+    <service name="updateDownloadContentForCategory" default-entity-name="ProductCategoryContent" engine="groovy"
+        location="component://product/groovyScripts/product/category/CategoryContentServices.groovy" invoke="updateDownloadContentForCategory" auth="true">
+        <implements service="uploadFileInterface"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <auto-attributes mode="IN" entity-name="Content" optional="true"/>
-        <attribute mode="IN" name="imageData" optional="true" type="java.nio.ByteBuffer"/>
-        <attribute mode="IN" name="_imageData_contentType" optional="true" type="String"/>
-        <attribute mode="IN" name="_imageData_fileName" optional="true" type="String"/>
         <attribute name="fileDataResourceId" type="String" mode="IN" optional="true"/>
     </service>