blob: daea503b8e4afcdc257432947600eb0e7269de03 [file] [log] [blame]
<?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"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods-v2.xsd">
<!-- WebSite Services -->
<simple-method method-name="createWebSite" short-description="Create a WebSite">
<make-value value-field="newEntity" entity-name="WebSite"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<set-pk-fields map="parameters" value-field="newEntity"/>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateWebSite" short-description="Update a WebSite">
<entity-one entity-name="WebSite" value-field="webSite"/>
<set-nonpk-fields map="parameters" value-field="webSite"/>
<store-value value-field="webSite"/>
</simple-method>
<simple-method method-name="removeWebSite" short-description="Remove a WebSite">
<make-value value-field="lookupKeyValue" entity-name="WebSite"/>
<set-pk-fields map="parameters" value-field="lookupKeyValue"/>
<find-by-primary-key entity-name="WebSite" map="lookupKeyValue" value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<!-- WebSite Content -->
<simple-method method-name="createWebSiteContent" short-description="Create WebSite Content">
<make-value value-field="newEntity" entity-name="WebSiteContent"/>
<set-pk-fields value-field="newEntity" map="parameters"/>
<set-nonpk-fields value-field="newEntity" map="parameters"/>
<if-empty field="newEntity.fromDate">
<now-timestamp field="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp"/>
</if-empty>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateWebSiteContent" short-description="Update WebSite Content">
<make-value value-field="lookupPKMap" entity-name="WebSiteContent"/>
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
<find-by-primary-key entity-name="WebSiteContent" map="lookupPKMap" value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="removeWebSiteContent" short-description="Remove WebSite Content">
<make-value value-field="lookupPKMap" entity-name="WebSiteContent"/>
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
<find-by-primary-key entity-name="WebSiteContent" map="lookupPKMap" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
<!-- WebSite Content Type Services -->
<simple-method method-name="createWebSiteContentType" short-description="Create WebSite Content Type">
<make-value value-field="newEntity" entity-name="WebSiteContentType"/>
<set-pk-fields value-field="newEntity" map="parameters"/>
<set-nonpk-fields value-field="newEntity" map="parameters"/>
<if-empty field="newEntity.webSiteContentTypeId">
<sequenced-id sequence-name="WebSiteContentTypeId" field="webSiteContentTypeId"/>
<set field="newEntity.webSiteContentTypeId" from-field="webSiteContentTypeId"/>
</if-empty>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateWebSiteContentType" short-description="Update WebSite Content Type">
<make-value value-field="lookupPKMap" entity-name="WebSiteContentType"/>
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
<find-by-primary-key entity-name="WebSiteContentType" map="lookupPKMap" value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="removeWebSiteContentType" short-description="Remove WebSite Content Type">
<make-value value-field="lookupPKMap" entity-name="WebSiteContentType"/>
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
<find-by-primary-key entity-name="WebSiteContentType" map="lookupPKMap" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
<!-- WebSite Path Alias -->
<simple-method method-name="createWebSitePathAlias" short-description="Create WebSite Path Alias">
<make-value value-field="newEntity" entity-name="WebSitePathAlias"/>
<set-pk-fields value-field="newEntity" map="parameters"/>
<set-nonpk-fields value-field="newEntity" map="parameters"/>
<create-value value-field="newEntity"/>
</simple-method>
<simple-method method-name="updateWebSitePathAlias" short-description="Update WebSite Path Alias">
<make-value value-field="lookupPKMap" entity-name="WebSitePathAlias"/>
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
<find-by-primary-key entity-name="WebSitePathAlias" map="lookupPKMap" value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="removeWebSitePathAlias" short-description="Remove WebSite Path Alias">
<make-value value-field="lookupPKMap" entity-name="WebSitePathAlias"/>
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
<find-by-primary-key entity-name="WebSitePathAlias" map="lookupPKMap" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="getWebSitePathAlias" short-description="Returns a WebSite Path Alias">
<make-value value-field="lookupPKMap" entity-name="WebSitePathAlias"/>
<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>
<!-- WebSite Role Services -->
<simple-method method-name="createWebSiteRole" short-description="Create WebSite Role">
<make-value value-field="newEntity" entity-name="WebSiteRole"/>
<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"/>
</simple-method>
<simple-method method-name="updateWebSiteRole" short-description="Update WebSite Role">
<make-value value-field="lookupPKMap" entity-name="WebSiteRole"/>
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
<find-by-primary-key entity-name="WebSiteRole" map="lookupPKMap" value-field="lookedUpValue"/>
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
<store-value value-field="lookedUpValue"/>
</simple-method>
<simple-method method-name="removeWebSiteRole" short-description="Remove WebSite Role">
<make-value value-field="lookupPKMap" entity-name="WebSiteRole"/>
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
<find-by-primary-key entity-name="WebSiteRole" map="lookupPKMap" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</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"/>
<log level="always" message="Parameters: ${parameters}"/>
<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 entry="thisType" list="parameters.webSiteContentTypeId">
<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 list="productStoreCatalogs" entity-name="ProductStoreCatalog" filter-by-date="true">
<field-map field-name="productStoreId" from-field="webSite.productStoreId"/>
</entity-and>
<if-not-empty field="productStoreCatalogs">
<iterate entry="productStoreCatalog" list="productStoreCatalogs">
<iterate entry="typeGenerate" list="parameters.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 entry="typeGenerate" list="parameters.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 entry="typeGenerate" list="parameters.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 entry="typeGenerate" list="parameters.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>