Consistency on the attribute order for make-value element as : entity-name, value-field Thanks to Ankush Upadhyay and Devanshu Vyas for the issue and the corrective patch git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805956 13f79535-47bb-0310-9956-ffa450edef68
254 lines
16 KiB
XML
254 lines
16 KiB
XML
<?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">
|
|
|
|
|
|
<!-- WebSite Path Alias -->
|
|
<simple-method method-name="getWebSitePathAlias" short-description="Returns a WebSite Path Alias">
|
|
<make-value entity-name="WebSitePathAlias" value-field="lookupPKMap"/>
|
|
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
|
|
<find-by-primary-key entity-name="WebSitePathAlias" map="lookupPKMap" value-field="alias" use-cache="true"/>
|
|
<field-to-result field="alias.pathTo" result-name="pathTo"/>
|
|
</simple-method>
|
|
|
|
<!-- quick create website CMS content -->
|
|
<simple-method method-name="quickCreateWebSiteContent" short-description="Auto-Create WebSite CMS Content">
|
|
<entity-one entity-name="WebSite" value-field="webSite">
|
|
<field-map field-name="webSiteId" from-field="parameters.webSiteId"/>
|
|
</entity-one>
|
|
<now-timestamp field="now"/>
|
|
|
|
<if-instance-of field="parameters.webSiteContentTypeId" class="String">
|
|
<!-- just one checked -->
|
|
<entity-one entity-name="WebSiteContentType" value-field="wct">
|
|
<field-map field-name="webSiteContentTypeId" from-field="parameters.webSiteContentTypeId"/>
|
|
</entity-one>
|
|
|
|
<set field="cnt.contentName" value="${webSite.siteName} ${wct.description}"/>
|
|
<set field="cnt.contentTypeId" value="WEB_SITE_PUB_PT"/>
|
|
<call-service service-name="createContent" in-map-name="cnt">
|
|
<result-to-field result-name="contentId" field="wcc.contentId"/>
|
|
</call-service>
|
|
|
|
<set field="wcc.webSiteId" from-field="webSite.webSiteId"/>
|
|
<set field="wcc.webSiteContentTypeId" from-field="type.webSiteContentTypeId"/>
|
|
<set field="wcc.fromDate" from-field="now"/>
|
|
<call-service service-name="createWebSiteContent" in-map-name="wcc"/>
|
|
|
|
<else>
|
|
<!-- multi-checked -->
|
|
<iterate list="parameters.webSiteContentTypeId" entry="thisType">
|
|
<entity-one entity-name="WebSiteContentType" value-field="wct">
|
|
<field-map field-name="webSiteContentTypeId" from-field="thisType"/>
|
|
</entity-one>
|
|
|
|
<set field="cnt.contentName" value="${webSite.siteName} ${wct.description}"/>
|
|
<set field="cnt.contentTypeId" value="WEB_SITE_PUB_PT"/>
|
|
<call-service service-name="createContent" in-map-name="cnt">
|
|
<result-to-field result-name="contentId" field="wcc.contentId"/>
|
|
</call-service>
|
|
|
|
<set field="wcc.webSiteId" from-field="webSite.webSiteId"/>
|
|
<set field="wcc.webSiteContentTypeId" from-field="thisType"/>
|
|
<set field="wcc.fromDate" from-field="now"/>
|
|
<call-service service-name="createWebSiteContent" in-map-name="wcc"/>
|
|
</iterate>
|
|
</else>
|
|
</if-instance-of>
|
|
</simple-method>
|
|
|
|
<!-- Generate Missing Seo URL's Services -->
|
|
<simple-method method-name="generateMissingSeoUrlForWebsite" short-description="Generate Missing Seo URL's for Website">
|
|
<set field="totalCategoriesNotUpdated" value="0" type="Integer"/>
|
|
<set field="totalCategoriesUpdated" value="0" type="Integer"/>
|
|
<set field="totalProductsNotUpdated" value="0" type="Integer"/>
|
|
<set field="totalProductsUpdated" value="0" type="Integer"/>
|
|
<set field="totalContentsNotUpdated" value="0" type="Integer"/>
|
|
<set field="totalContentsUpdated" value="0" type="Integer"/>
|
|
<entity-one entity-name="WebSite" value-field="webSite">
|
|
<field-map field-name="webSiteId" from-field="parameters.webSiteId"/>
|
|
</entity-one>
|
|
<!-- Create Missing Category and Product Alternative URL's -->
|
|
<if-compare operator="equals" value="all" field="parameters.prodCatalogId">
|
|
<entity-and entity-name="ProductStoreCatalog" list="productStoreCatalogs" filter-by-date="true">
|
|
<field-map field-name="productStoreId" from-field="webSite.productStoreId"/>
|
|
</entity-and>
|
|
<if-not-empty field="productStoreCatalogs">
|
|
<iterate list="productStoreCatalogs" entry="productStoreCatalog">
|
|
<iterate list="parameters.typeGenerate" entry="typeGenerate">
|
|
<if-compare operator="equals" value="category" field="typeGenerate">
|
|
<set field="createMissingCategoryAltUrlsMap.prodCatalogId" from-field="productStoreCatalog.prodCatalogId"/>
|
|
<set field="createMissingCategoryAltUrlsMap.category" value="category"/>
|
|
<call-service service-name="createMissingCategoryAndProductAltUrls" in-map-name="createMissingCategoryAltUrlsMap">
|
|
<result-to-field result-name="categoriesNotUpdated" field="categoriesNotUpdated"/>
|
|
<result-to-field result-name="categoriesUpdated" field="categoriesUpdated"/>
|
|
</call-service>
|
|
<calculate field="totalCategoriesNotUpdated" type="Integer">
|
|
<calcop operator="add" field="totalCategoriesNotUpdated">
|
|
<calcop operator="get" field="categoriesNotUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
<calculate field="totalCategoriesUpdated" type="Integer">
|
|
<calcop operator="add" field="totalCategoriesUpdated">
|
|
<calcop operator="get" field="categoriesUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
</if-compare>
|
|
<if-compare operator="equals" value="product" field="typeGenerate">
|
|
<set field="createMissingProductAltUrlsMap.prodCatalogId" from-field="productStoreCatalog.prodCatalogId"/>
|
|
<set field="createMissingProductAltUrlsMap.product" value="product"/>
|
|
<call-service service-name="createMissingCategoryAndProductAltUrls" in-map-name="createMissingProductAltUrlsMap">
|
|
<result-to-field result-name="productsNotUpdated" field="productsNotUpdated"/>
|
|
<result-to-field result-name="productsUpdated" field="productsUpdated"/>
|
|
</call-service>
|
|
<calculate field="totalProductsNotUpdated" type="Integer">
|
|
<calcop operator="add" field="totalProductsNotUpdated">
|
|
<calcop operator="get" field="productsNotUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
<calculate field="totalProductsUpdated" type="Integer">
|
|
<calcop operator="add" field="totalProductsUpdated">
|
|
<calcop operator="get" field="productsUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
</if-compare>
|
|
<if-compare operator="equals" value="content" field="typeGenerate">
|
|
<set field="createMissingContentAltUrlsMap.webSiteId" from-field="parameters.webSiteId"/>
|
|
<set field="createMissingContentAltUrlsMap.prodCatalogId" from-field="productStoreCatalog.prodCatalogId"/>
|
|
<call-service service-name="createMissingContentAltUrls" in-map-name="createMissingContentAltUrlsMap">
|
|
<result-to-field result-name="contentsNotUpdated" field="contentsNotUpdated"/>
|
|
<result-to-field result-name="contentsUpdated" field="contentsUpdated"/>
|
|
</call-service>
|
|
<calculate field="totalContentsNotUpdated" type="Integer">
|
|
<calcop operator="add" field="contentsNotUpdated">
|
|
<calcop operator="get" field="productsNotUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
<calculate field="totalContentsUpdated" type="Integer">
|
|
<calcop operator="add" field="totalContentsUpdated">
|
|
<calcop operator="get" field="contentsUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
</if-compare>
|
|
</iterate>
|
|
</iterate>
|
|
<else>
|
|
<iterate list="parameters.typeGenerate" entry="typeGenerate">
|
|
<if-compare operator="equals" value="content" field="typeGenerate">
|
|
<set field="createMissingContentAltUrlsMap.webSiteId" from-field="parameters.webSiteId"/>
|
|
<call-service service-name="createMissingContentAltUrls" in-map-name="createMissingContentAltUrlsMap">
|
|
<result-to-field result-name="contentsNotUpdated" field="contentsNotUpdated"/>
|
|
<result-to-field result-name="contentsUpdated" field="contentsUpdated"/>
|
|
</call-service>
|
|
<calculate field="totalContentsNotUpdated" type="Integer">
|
|
<calcop operator="add" field="contentsNotUpdated">
|
|
<calcop operator="get" field="productsNotUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
<calculate field="totalContentsUpdated" type="Integer">
|
|
<calcop operator="add" field="totalContentsUpdated">
|
|
<calcop operator="get" field="contentsUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
</if-compare>
|
|
</iterate>
|
|
</else>
|
|
</if-not-empty>
|
|
<else>
|
|
<iterate list="parameters.typeGenerate" entry="typeGenerate">
|
|
<if-compare operator="equals" value="category" field="typeGenerate">
|
|
<set field="createMissingCategoryAltUrlsMap.prodCatalogId" from-field="parameters.prodCatalogId"/>
|
|
<set field="createMissingCategoryAltUrlsMap.category" value="category"/>
|
|
<call-service service-name="createMissingCategoryAndProductAltUrls" in-map-name="createMissingCategoryAltUrlsMap">
|
|
<result-to-field result-name="categoriesNotUpdated" field="categoriesNotUpdated"/>
|
|
<result-to-field result-name="categoriesUpdated" field="categoriesUpdated"/>
|
|
</call-service>
|
|
<calculate field="totalCategoriesNotUpdated" type="Integer">
|
|
<calcop operator="add" field="totalCategoriesNotUpdated">
|
|
<calcop operator="get" field="categoriesNotUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
<calculate field="totalCategoriesUpdated" type="Integer">
|
|
<calcop operator="add" field="totalCategoriesUpdated">
|
|
<calcop operator="get" field="categoriesUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
</if-compare>
|
|
<if-compare operator="equals" value="product" field="typeGenerate">
|
|
<set field="createMissingProductAltUrlsMap.prodCatalogId" from-field="parameters.prodCatalogId"/>
|
|
<set field="createMissingProductAltUrlsMap.product" value="product"/>
|
|
<call-service service-name="createMissingCategoryAndProductAltUrls" in-map-name="createMissingProductAltUrlsMap">
|
|
<result-to-field result-name="productsNotUpdated" field="productsNotUpdated"/>
|
|
<result-to-field result-name="productsUpdated" field="productsUpdated"/>
|
|
</call-service>
|
|
<calculate field="totalProductsNotUpdated" type="Integer">
|
|
<calcop operator="add" field="totalProductsNotUpdated">
|
|
<calcop operator="get" field="productsNotUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
<calculate field="totalProductsUpdated" type="Integer">
|
|
<calcop operator="add" field="totalProductsUpdated">
|
|
<calcop operator="get" field="productsUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
</if-compare>
|
|
<if-compare operator="equals" value="content" field="typeGenerate">
|
|
<set field="createMissingContentAltUrlsMap.webSiteId" from-field="parameters.webSiteId"/>
|
|
<set field="createMissingContentAltUrlsMap.prodCatalogId" from-field="parameters.prodCatalogId"/>
|
|
<call-service service-name="createMissingContentAltUrls" in-map-name="createMissingContentAltUrlsMap">
|
|
<result-to-field result-name="contentsNotUpdated" field="contentsNotUpdated"/>
|
|
<result-to-field result-name="contentsUpdated" field="contentsUpdated"/>
|
|
</call-service>
|
|
<calculate field="totalContentsNotUpdated" type="Integer">
|
|
<calcop operator="add" field="totalContentsNotUpdated">
|
|
<calcop operator="get" field="contentsNotUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
<calculate field="totalContentsUpdated" type="Integer">
|
|
<calcop operator="add" field="totalContentsUpdated">
|
|
<calcop operator="get" field="contentsUpdated"/>
|
|
</calcop>
|
|
</calculate>
|
|
</if-compare>
|
|
</iterate>
|
|
</else>
|
|
</if-compare>
|
|
|
|
<set field="generateMissingSeoUrlMessage" value="Generate missing seo url's successfully"/>
|
|
<field-to-list list="successMessageList" field="generateMissingSeoUrlMessage"/>
|
|
<iterate list="parameters.typeGenerate" entry="typeGenerate">
|
|
<if-compare operator="equals" value="category" field="typeGenerate">
|
|
<set field="categoriesMessage" value="Categories already having seo url's: ${totalCategoriesNotUpdated}, Categories with url added: ${totalCategoriesUpdated}"/>
|
|
<field-to-list list="successMessageList" field="categoriesMessage"/>
|
|
</if-compare>
|
|
<if-compare operator="equals" value="product" field="typeGenerate">
|
|
<set field="productMessage" value="Products already having seo url's: ${totalProductsNotUpdated}, Products with url added: ${totalProductsUpdated}"/>
|
|
<field-to-list list="successMessageList" field="productMessage"/>
|
|
</if-compare>
|
|
<if-compare operator="equals" value="content" field="typeGenerate">
|
|
<set field="contentMessage" value="Contents already having seo url's: ${totalContentsNotUpdated}, Contents with url added: ${totalContentsUpdated}"/>
|
|
<field-to-list list="successMessageList" field="contentMessage"/>
|
|
</if-compare>
|
|
</iterate>
|
|
</simple-method>
|
|
</simple-methods>
|