Author: hansbak
Date: Tue Aug 2 05:56:47 2011
New Revision: 1153034
URL: http://svn.apache.org/viewvc?rev=1153034&view=rev
Log:
added an function on the website level: 'SEO' to generate missing seofiendly
url's on a catalog, category, product and content level. entities records which
have alread a seofriendly alternative url are not touched
Modified:
ofbiz/trunk/applications/content/config/ContentUiLabels.xml
ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
ofbiz/trunk/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml
ofbiz/trunk/applications/content/servicedef/services.xml
ofbiz/trunk/applications/content/servicedef/services_content.xml
ofbiz/trunk/applications/content/servicedef/services_website.xml
ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
ofbiz/trunk/applications/content/webapp/content/website/WebSiteForms.xml
ofbiz/trunk/applications/content/widget/CommonScreens.xml
ofbiz/trunk/applications/content/widget/WebSiteScreens.xml
ofbiz/trunk/applications/content/widget/content/ContentMenus.xml
ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml
ofbiz/trunk/applications/product/servicedef/services.xml
Modified: ofbiz/trunk/applications/content/config/ContentUiLabels.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/config/ContentUiLabels.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/config/ContentUiLabels.xml (original)
+++ ofbiz/trunk/applications/content/config/ContentUiLabels.xml Tue Aug 2
05:56:47 2011
@@ -1881,6 +1881,9 @@
<value xml:lang="zh">æåå°æç»</value>
<value xml:lang="zh_TW">æåå°æçµ</value>
</property>
+ <property key="ContentSEO">
+ <value xml:lang="en">SEO</value>
+ </property>
<property key="ContentStatusUpdateError">
<value xml:lang="en">Problem updating content Status:
${errorString}</value>
<value xml:lang="en">Problème lors de la mise à jour du statut du
document : ${errorString}</value>
@@ -2659,6 +2662,9 @@
<value xml:lang="zh">ç½ç«å
容</value>
<value xml:lang="zh_TW">ç¶²ç«å
§å®¹</value>
</property>
+ <property key="ContentWebSiteGenerateMissingSeoUrl">
+ <value xml:lang="en">Generate missing seo url's</value>
+ </property>
<property key="ContentWebSiteMenus">
<value xml:lang="da">Webside menuer</value>
<value xml:lang="de">Webseite Menüs</value>
@@ -5777,6 +5783,9 @@
<value xml:lang="zh">ç½ç«å
容</value>
<value xml:lang="zh_TW">ç¶²ç«å
§å®¹</value>
</property>
+ <property key="PageTitleWebSiteSEO">
+ <value xml:lang="en">Generate Missing SEO URL's</value>
+ </property>
<property key="ErrorLoadingContent">
<value xml:lang="de">Ein Fehler beim Laden des Inhaltes ist
aufgetrete!</value>
<value xml:lang="en">An error occured loading content!</value>
Modified:
ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
(original)
+++
ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
Tue Aug 2 05:56:47 2011
@@ -1345,9 +1345,124 @@
<set field="createContentAssocCtx.contentAssocTypeId"
value="ALTERNATIVE_URL"/>
<call-service service-name="createContentAssoc"
in-map-name="createContentAssocCtx" include-user-login="true"
break-on-error="false"/>
</if-not-empty>
+ <set field="contentCreated" value="Y"/>
+ <field-to-result field="contentCreated"
result-name="contentCreated"/>
</if-not-empty>
+ <else>
+ <set field="contentCreated" value="N"/>
+ <field-to-result field="contentCreated"
result-name="contentCreated"/>
+ </else>
</if-empty>
</iterate>
</simple-method>
+
+ <simple-method method-name="createMissingContentAltUrls"
short-description="create missing content alternative urls.">
+ <now-timestamp field="now"/>
+ <set field="contentsNotUpdated" value="0" type="Integer"/>
+ <set field="contentsUpdated" value="0" type="Integer"/>
+ <entity-and list="prodCatalogCategoryList"
entity-name="ProdCatalogCategory" filter-by-date="false">
+ <field-map field-name="prodCatalogId"
from-field="parameters.prodCatalogId"/>
+ </entity-and>
+
+ <!-- Get all categories -->
+ <call-class-method method-name="newInstance"
class-name="javolution.util.FastList" ret-field="parameters.productCategories"/>
+ <iterate entry="prodCatalogCategory" list="prodCatalogCategoryList">
+ <set field="rootProductCategoryId"
from-field="prodCatalogCategory.productCategoryId"/>
+ <entity-and list="productCategoryRollupList"
entity-name="ProductCategoryRollup" filter-by-date="true">
+ <field-map field-name="parentProductCategoryId"
from-field="rootProductCategoryId"/>
+ </entity-and>
+ <set field="parameters.parentProductCategoryId"
from-field="rootProductCategoryId"/>
+ <call-simple-method
method-name="createMissingCategoryContentAltUrlInline"/>
+ </iterate>
+
+ <iterate entry="productCategoryList"
list="parameters.productCategories">
+ <!-- Create Content Alternative URLs for Product Category -->
+ <entity-condition list="productCategoryContentAndInfoList"
entity-name="ProductCategoryContentAndInfo" filter-by-date="true"
use-cache="true">
+ <condition-list combine="and">
+ <condition-expr field-name="productCategoryId"
from-field="productCategoryList.productCategoryId"/>
+ <condition-expr field-name="prodCatContentTypeId"
operator="not-equals" value="ALTERNATIVE_URL"/>
+ </condition-list>
+ <order-by field-name="-fromDate"/>
+ </entity-condition>
+ <iterate entry="productCategoryContentAndInfo"
list="productCategoryContentAndInfoList">
+ <set field="createMissingCategoryContentAltUrlsMap.contentId"
from-field="productCategoryContentAndInfo.contentId"/>
+ <call-service service-name="createContentAlternativeUrl"
in-map-name="createMissingCategoryContentAltUrlsMap">
+ <result-to-field result-name="contentCreated"
field="contentCreated"/>
+ </call-service>
+ <if-compare operator="equals" value="Y" field="contentCreated">
+ <calculate field="contentsUpdated" type="Integer">
+ <calcop operator="add" field="contentsUpdated">
+ <number value="1"/>
+ </calcop>
+ </calculate>
+ </if-compare>
+ <if-compare operator="equals" value="N" field="contentCreated">
+ <calculate field="contentsNotUpdated" type="Integer">
+ <calcop operator="add" field="contentsNotUpdated">
+ <number value="1"/>
+ </calcop>
+ </calculate>
+ </if-compare>
+ </iterate>
+
+ <!-- Create Content Alternative URLs for Product -->
+ <entity-condition list="productCategoryMemberList"
entity-name="ProductCategoryMember" filter-by-date="true" use-cache="true">
+ <condition-list combine="and">
+ <condition-expr field-name="productCategoryId"
from-field="productCategoryList.productCategoryId"/>
+ </condition-list>
+ <order-by field-name="-fromDate"/>
+ </entity-condition>
+ <iterate entry="productCategoryMember"
list="productCategoryMemberList">
+ <set field="product.productId"
from-field="productCategoryMember.productId"/>
+ <entity-condition list="productContentAndInfoList"
entity-name="ProductContentAndInfo" filter-by-date="true" use-cache="true">
+ <condition-list combine="and">
+ <condition-expr field-name="productId"
from-field="product.productId"/>
+ <condition-expr field-name="productContentTypeId"
operator="not-equals" value="ALTERNATIVE_URL"/>
+ </condition-list>
+ <order-by field-name="-fromDate"/>
+ </entity-condition>
+ <iterate entry="productContentAndInfo"
list="productContentAndInfoList">
+ <set
field="createMissingProductContentAltUrlsMap.contentId"
from-field="productContentAndInfo.contentId"/>
+ <call-service service-name="createContentAlternativeUrl"
in-map-name="createMissingProductContentAltUrlsMap">
+ <result-to-field result-name="contentCreated"
field="contentCreated"/>
+ </call-service>
+ <if-compare operator="equals" value="Y"
field="contentCreated">
+ <calculate field="contentsUpdated" type="Integer">
+ <calcop operator="add" field="contentsUpdated">
+ <number value="1"/>
+ </calcop>
+ </calculate>
+ </if-compare>
+ <if-compare operator="equals" value="N"
field="contentCreated">
+ <calculate field="contentsNotUpdated" type="Integer">
+ <calcop operator="add" field="contentsNotUpdated">
+ <number value="1"/>
+ </calcop>
+ </calculate>
+ </if-compare>
+ </iterate>
+ </iterate>
+ </iterate>
+ <field-to-result field="contentsNotUpdated"
result-name="contentsNotUpdated"/>
+ <field-to-result field="contentsUpdated"
result-name="contentsUpdated"/>
+ </simple-method>
+
+ <simple-method method-name="createMissingCategoryContentAltUrlInline"
short-description="create missing category alternative inline">
+ <entity-and list="productCategoryRollups"
entity-name="ProductCategoryRollup" filter-by-date="true">
+ <field-map field-name="parentProductCategoryId"
from-field="parameters.parentProductCategoryId"/>
+ </entity-and>
+ <iterate entry="productCategoryRollup" list="productCategoryRollups">
+ <!-- append product category to list -->
+ <entity-one value-field="productCategory"
entity-name="ProductCategory">
+ <field-map field-name="productCategoryId"
from-field="productCategoryRollup.productCategoryId"/>
+ </entity-one>
+ <field-to-list list="parameters.productCategories"
field="productCategory"/>
+
+ <!-- find rollup product categories -->
+ <set field="parameters.parentProductCategoryId"
from-field="productCategoryRollup.productCategoryId"/>
+ <call-simple-method
method-name="createMissingCategoryContentAltUrlInline"/>
+ <check-errors/>
+ </iterate>
+ </simple-method>
</simple-methods>
Modified:
ofbiz/trunk/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml
(original)
+++
ofbiz/trunk/applications/content/script/org/ofbiz/content/website/WebSiteServices.xml
Tue Aug 2 05:56:47 2011
@@ -192,4 +192,154 @@ under the License.
</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>
+ <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.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="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.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>
Modified: ofbiz/trunk/applications/content/servicedef/services.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services.xml Tue Aug 2
05:56:47 2011
@@ -1202,5 +1202,6 @@
location="component://content/script/org/ofbiz/content/content/ContentServices.xml"
invoke="createContentAlternativeUrl" auth="true" transaction-timeout="7200">
<description>Create Content Alternative URL</description>
<attribute name="contentId" mode="IN" type="String"
optional="true"></attribute>
+ <attribute name="contentCreated" mode="OUT" type="String"
optional="true"></attribute>
</service>
</services>
Modified: ofbiz/trunk/applications/content/servicedef/services_content.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services_content.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services_content.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services_content.xml Tue Aug 2
05:56:47 2011
@@ -324,4 +324,13 @@
<permission-service service-name="genericContentPermission"
main-action="UPDATE"/>
<auto-attributes entity-name="ContentRole" include="pk" mode="IN"
optional="false"/>
</service>
+
+ <!-- Alternative URLs services -->
+ <service name="createMissingContentAltUrls" engine="simple"
+
location="component://content/script/org/ofbiz/content/content/ContentServices.xml"
invoke="createMissingContentAltUrls" auth="true" use-transaction="false">
+ <description>Create missing Content Alternative URLs</description>
+ <attribute name="prodCatalogId" mode="IN" type="String"
optional="false"/>
+ <attribute name="contentsNotUpdated" mode="OUT" type="Integer"
optional="true"/>
+ <attribute name="contentsUpdated" mode="OUT" type="Integer"
optional="true"/>
+ </service>
</services>
Modified: ofbiz/trunk/applications/content/servicedef/services_website.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services_website.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services_website.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services_website.xml Tue Aug 2
05:56:47 2011
@@ -154,4 +154,12 @@
<attribute name="webSiteId" type="String" mode="IN" optional="false"/>
<attribute name="webSiteContentTypeId" type="List" mode="IN"
optional="false"/>
</service>
+
+ <service name="generateMissingSeoUrlForWebsite" engine="simple" auth="true"
+
location="component://content/script/org/ofbiz/content/website/WebSiteServices.xml"
invoke="generateMissingSeoUrlForWebsite" transaction-timeout="36000000">
+ <description>Generate Missing Seo URL's for Website</description>
+ <attribute name="webSiteId" type="String" mode="IN" optional="false"/>
+ <attribute name="prodCatalogId" type="String" mode="IN"
optional="false"/>
+ <attribute name="typeGenerate" type="List" mode="IN" optional="false"/>
+ </service>
</services>
Modified: ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
(original)
+++ ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml Tue
Aug 2 05:56:47 2011
@@ -1869,6 +1869,18 @@ under the License.
<response name="error" type="view" value="FindContent"/>
</request-map>
+ <!-- ================ Generate Missing Seo URL's Requests
================= -->
+ <request-map uri="WebSiteSeo">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="WebSiteSEO"/>
+ </request-map>
+ <request-map uri="generateMissingSeoUrlForWebsite">
+ <security https="true" auth="true"/>
+ <event type="service" invoke="generateMissingSeoUrlForWebsite"/>
+ <response name="success" type="view" value="WebSiteSEO"/>
+ <response name="error" type="view" value="WebSiteSEO"/>
+ </request-map>
+
<!-- View Mappings -->
<view-map name="main" type="screen"
page="component://content/widget/CommonScreens.xml#main"/>
<view-map name="fonts.fo" type="screenfop"
page="component://content/widget/CommonScreens.xml#fonts.fo"
content-type="application/pdf" encoding="none"/>
@@ -1907,6 +1919,7 @@ under the License.
<view-map name="WebSiteCMSPathAlias"
page="component://content/widget/WebSiteScreens.xml#WebSiteCMSPathAlias"
type="screen"/>
<view-map name="WebSiteCMSNav"
page="component://content/widget/WebSiteScreens.xml#WebSiteCMSNav"
type="screen"/>
<view-map name="EditWebSiteParties"
page="component://content/widget/WebSiteScreens.xml#EditWebSiteParties"
type="screen"/>
+ <view-map name="WebSiteSEO"
page="component://content/widget/WebSiteScreens.xml#WebSiteSEO" type="screen"/>
<view-map name="EditContentPurpose"
page="component://content/widget/content/ContentScreens.xml#EditContentPurpose"
type="screen"/>
<view-map name="EditContentRole"
page="component://content/widget/content/ContentScreens.xml#EditContentRole"
type="screen"/>
Modified:
ofbiz/trunk/applications/content/webapp/content/website/WebSiteForms.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/website/WebSiteForms.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/website/WebSiteForms.xml
(original)
+++ ofbiz/trunk/applications/content/webapp/content/website/WebSiteForms.xml
Tue Aug 2 05:56:47 2011
@@ -220,4 +220,26 @@ under the License.
</field>
<field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit
button-type="button"/></field>
</form>
+
+ <!-- WebSite SEO Form -->
+ <form name="CreateWebsiteSEO" type="single"
target="generateMissingSeoUrlForWebsite" title=""
+ header-row-style="header-row" default-table-style="basic-table">
+ <field name="webSiteId"><hidden/></field>
+ <field name="prodCatalogId" title="${uiLabelMap.Catalog}">
+ <drop-down>
+ <option key="all" description="All"/>
+ <entity-options description="${prodCatalogId}"
entity-name="ProductStoreCatalog">
+ <entity-constraint name="productStoreId"
value="${webSite.productStoreId}"/>
+ </entity-options>
+ </drop-down>
+ </field>
+ <field name="typeGenerate" title="Generate Type">
+ <check all-checked="false">
+ <option key="category" description="Category"/>
+ <option key="product" description="Product"/>
+ <option key="content" description="Content"/>
+ </check>
+ </field>
+ <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit
button-type="button"/></field>
+ </form>
</forms>
Modified: ofbiz/trunk/applications/content/widget/CommonScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/CommonScreens.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/content/widget/CommonScreens.xml Tue Aug 2
05:56:47 2011
@@ -332,10 +332,13 @@ under the License.
<if-has-permission permission="CONTENTMGR"
action="_VIEW"/>
</condition>
<widgets>
- <label style="h1"
text="${uiLabelMap[labelTitleProperty]} ${uiLabelMap.CommonFor}:
${webSite.siteName} [${webSite.webSiteId}] ${${extraFunctionName}}"/>
- <container style="button-bar">
+ <!--<container style="button-bar">
<link
text="${uiLabelMap.ContentCreateNewWebSite}" target="EditWebSite"
style="buttontext create"/>
+ </container>-->
+ <container>
+ <include-menu name="websiteMenu"
location="component://content/widget/content/ContentMenus.xml"/>
</container>
+ <label style="h1"
text="${uiLabelMap[labelTitleProperty]} ${uiLabelMap.CommonFor}:
${webSite.siteName} [${webSite.webSiteId}] ${${extraFunctionName}}"/>
<decorator-section-include name="body"/>
</widgets>
<fail-widgets>
Modified: ofbiz/trunk/applications/content/widget/WebSiteScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/WebSiteScreens.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/widget/WebSiteScreens.xml (original)
+++ ofbiz/trunk/applications/content/widget/WebSiteScreens.xml Tue Aug 2
05:56:47 2011
@@ -367,4 +367,29 @@ under the License.
</widgets>
</section>
</screen>
+
+ <screen name="WebSiteSEO">
+ <section>
+ <actions>
+ <set field="titleProperty" value="PageTitleWebSiteSEO"/>
+ <set field="tabButtonItem" value="WebSiteSEO"/>
+ <set field="labelTitleProperty" value="PageTitleWebSiteSEO"/>
+ <set field="webSiteId" from-field="parameters.webSiteId"/>
+ <entity-one entity-name="WebSite" value-field="webSite"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonWebSiteDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <section>
+ <widgets>
+ <screenlet
title="${uiLabelMap.PageTitleWebSiteSEO}">
+ <include-form name="CreateWebsiteSEO"
location="component://content/webapp/content/website/WebSiteForms.xml"/>
+ </screenlet>
+ </widgets>
+ </section>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
</screens>
Modified: ofbiz/trunk/applications/content/widget/content/ContentMenus.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/content/ContentMenus.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/widget/content/ContentMenus.xml (original)
+++ ofbiz/trunk/applications/content/widget/content/ContentMenus.xml Tue Aug 2
05:56:47 2011
@@ -169,6 +169,11 @@ under the License.
<parameter param-name="webSiteId"
from-field="parameters.webSiteId"/>
</link>
</menu-item>
+ <menu-item name="WebSiteSEO" title="${uiLabelMap.ContentSEO}">
+ <link target="WebSiteSeo">
+ <parameter param-name="webSiteId"
from-field="parameters.webSiteId"/>
+ </link>
+ </menu-item>
</menu>
<menu name="blog" menu-container-style="button-bar tab-bar"
default-selected-style="selected" default-menu-item-name="content"
default-permission-operation="CONTENT_ADMIN"
default-permission-entity-action="_ADMIN"
default-associated-content-id="${userLogin.userLoginId}"
selected-menuitem-context-field-name="tabButtonItem"
@@ -271,4 +276,9 @@ under the License.
<link target="updateContentAllKeywords"/>
</menu-item>
</menu>
+ <menu name="websiteMenu" menu-container-style="button-bar button-style-2"
default-selected-style="selected">
+ <menu-item name="EditWebSite"
title="${uiLabelMap.ContentCreateNewWebSite}" widget-style="buttontext create">
+ <link target="EditWebSite"/>
+ </menu-item>
+ </menu>
</menus>
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml
(original)
+++
ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml
Tue Aug 2 05:56:47 2011
@@ -523,7 +523,9 @@ under the License.
<simple-method method-name="createMissingCategoryAndProductAltUrls"
short-description="create missing category and product alternative urls.">
<now-timestamp field="now"/>
<field-to-result field="parameters.prodCatalogId"
result-name="prodCatalogId"/>
+ <set field="categoriesNotUpdated" value="0" type="Integer"/>
<set field="categoriesUpdated" value="0" type="Integer"/>
+ <set field="productsNotUpdated" value="0" type="Integer"/>
<set field="productsUpdated" value="0" type="Integer"/>
<entity-and list="prodCatalogCategoryList"
entity-name="ProdCatalogCategory" filter-by-date="false">
<field-map field-name="prodCatalogId"
from-field="parameters.prodCatalogId"/>
@@ -543,101 +545,119 @@ under the License.
<iterate entry="productCategoryList"
list="parameters.productCategories">
<!-- Create Product Category Alternative URLs -->
- <entity-condition list="productCategoryContentAndInfoList"
entity-name="ProductCategoryContentAndInfo" filter-by-date="true"
use-cache="true">
- <condition-list combine="and">
- <condition-expr field-name="productCategoryId"
from-field="productCategoryList.productCategoryId"/>
- <condition-expr field-name="prodCatContentTypeId"
value="ALTERNATIVE_URL"/>
- </condition-list>
- <order-by field-name="-fromDate"/>
- </entity-condition>
-
- <if-empty field="productCategoryContentAndInfoList">
- <set field="createSimpleTextContentForCategoryCtx.fromDate"
from-field="now"/>
- <set
field="createSimpleTextContentForCategoryCtx.prodCatContentTypeId"
value="ALTERNATIVE_URL"/>
- <set
field="createSimpleTextContentForCategoryCtx.localeString" value="en"/>
- <set
field="createSimpleTextContentForCategoryCtx.productCategoryId"
from-field="productCategoryList.productCategoryId"/>
-
- <if-empty field="productCategoryList.categoryName">
- <entity-condition list="productCategoryContentList"
entity-name="ProductCategoryContentAndInfo" filter-by-date="true"
use-cache="true">
- <condition-list combine="and">
- <condition-expr field-name="productCategoryId"
from-field="productCategoryList.productCategoryId"/>
- <condition-expr field-name="prodCatContentTypeId"
value="CATEGORY_NAME"/>
- </condition-list>
- <order-by field-name="-fromDate"/>
- </entity-condition>
- <if-not-empty field="productCategoryContentList">
- <first-from-list entry="productCategoryContent"
list="productCategoryContentList"/>
- <set field="getContentAndDataResourceCtx.contentId"
from-field="productCategoryContent.contentId"/>
- <call-service service-name="getContentAndDataResource"
in-map-name="getContentAndDataResourceCtx">
- <result-to-field result-name="resultData"
field="resultMap"/>
- </call-service>
-
- <set field="electronicText"
from-field="resultMap.electronicText"/>
- <set
field="createSimpleTextContentForCategoryCtx.text"
from-field="electronicText.textData"/>
+ <if-empty field="category">
+ <entity-condition list="productCategoryContentAndInfoList"
entity-name="ProductCategoryContentAndInfo" filter-by-date="true"
use-cache="true">
+ <condition-list combine="and">
+ <condition-expr field-name="productCategoryId"
from-field="productCategoryList.productCategoryId"/>
+ <condition-expr field-name="prodCatContentTypeId"
value="ALTERNATIVE_URL"/>
+ </condition-list>
+ <order-by field-name="-fromDate"/>
+ </entity-condition>
+ <if-empty field="productCategoryContentAndInfoList">
+ <set
field="createSimpleTextContentForCategoryCtx.fromDate" from-field="now"/>
+ <set
field="createSimpleTextContentForCategoryCtx.prodCatContentTypeId"
value="ALTERNATIVE_URL"/>
+ <set
field="createSimpleTextContentForCategoryCtx.localeString" value="en"/>
+ <set
field="createSimpleTextContentForCategoryCtx.productCategoryId"
from-field="productCategoryList.productCategoryId"/>
+ <if-empty field="productCategoryList.categoryName">
+ <entity-condition list="productCategoryContentList"
entity-name="ProductCategoryContentAndInfo" filter-by-date="true"
use-cache="true">
+ <condition-list combine="and">
+ <condition-expr field-name="productCategoryId"
from-field="productCategoryList.productCategoryId"/>
+ <condition-expr
field-name="prodCatContentTypeId" value="CATEGORY_NAME"/>
+ </condition-list>
+ <order-by field-name="-fromDate"/>
+ </entity-condition>
+ <if-not-empty field="productCategoryContentList">
+ <first-from-list entry="productCategoryContent"
list="productCategoryContentList"/>
+ <set
field="getContentAndDataResourceCtx.contentId"
from-field="productCategoryContent.contentId"/>
+ <call-service
service-name="getContentAndDataResource"
in-map-name="getContentAndDataResourceCtx">
+ <result-to-field result-name="resultData"
field="resultMap"/>
+ </call-service>
+
+ <set field="electronicText"
from-field="resultMap.electronicText"/>
+ <set
field="createSimpleTextContentForCategoryCtx.text"
from-field="electronicText.textData"/>
+ </if-not-empty>
+ <else>
+ <set
field="createSimpleTextContentForCategoryCtx.text"
from-field="productCategoryList.categoryName"/>
+ </else>
+ </if-empty>
+ <if-not-empty
field="createSimpleTextContentForCategoryCtx.text">
+ <call-service
service-name="createSimpleTextContentForCategory"
in-map-name="createSimpleTextContentForCategoryCtx"/>
+ <calculate field="categoriesUpdated" type="Integer">
+ <calcop operator="add" field="categoriesUpdated">
+ <number value="1"/>
+ </calcop>
+ </calculate>
</if-not-empty>
+ <check-errors/>
<else>
- <set field="createSimpleTextContentForCategoryCtx.text"
from-field="productCategoryList.categoryName"/>
- </else>
- </if-empty>
- <if-not-empty
field="createSimpleTextContentForCategoryCtx.text">
- <call-service
service-name="createSimpleTextContentForCategory"
in-map-name="createSimpleTextContentForCategoryCtx"/>
- <calculate field="categoriesUpdated">
- <calcop operator="add" field="categoriesUpdated">
+ <calculate field="categoriesNotUpdated" type="Integer">
+ <calcop operator="add" field="categoriesNotUpdated">
<number value="1"/>
</calcop>
</calculate>
- </if-not-empty>
- <check-errors/>
+ </else>
+ </if-empty>
</if-empty>
<!-- Create Product Alternative URLs -->
- <entity-condition list="productCategoryMemberList"
entity-name="ProductCategoryMember" filter-by-date="true" use-cache="true">
- <condition-list combine="and">
- <condition-expr field-name="productCategoryId"
from-field="productCategoryList.productCategoryId"/>
- </condition-list>
- <order-by field-name="-fromDate"/>
- </entity-condition>
-
- <iterate entry="productCategoryMember"
list="productCategoryMemberList">
- <set field="product.productId"
from-field="productCategoryMember.productId"/>
- <entity-condition list="ProductContentAndInfoList"
entity-name="ProductContentAndInfo" filter-by-date="true" use-cache="true">
+ <if-empty field="product">
+ <entity-condition list="productCategoryMemberList"
entity-name="ProductCategoryMember" filter-by-date="true" use-cache="true">
<condition-list combine="and">
- <condition-expr field-name="productId"
from-field="product.productId"/>
- <condition-expr field-name="productContentTypeId"
value="ALTERNATIVE_URL"/>
+ <condition-expr field-name="productCategoryId"
from-field="productCategoryList.productCategoryId"/>
</condition-list>
<order-by field-name="-fromDate"/>
</entity-condition>
-
- <if-empty field="ProductContentAndInfoList">
- <entity-one value-field="productMap" entity-name="Product">
- <field-map field-name="productId"
from-field="product.productId"/>
- </entity-one>
- <set field="createSimpleTextContentForProductCtx.fromDate"
from-field="now"/>
- <set
field="createSimpleTextContentForProductCtx.productContentTypeId"
value="ALTERNATIVE_URL"/>
- <set
field="createSimpleTextContentForProductCtx.localeString" value="en"/>
- <set
field="createSimpleTextContentForProductCtx.productId"
from-field="product.productId"/>
- <if-empty field="productMap.internalName">
- <set field="createSimpleTextContentForProductCtx.text"
from-field="productMap.productName"/>
+ <iterate entry="productCategoryMember"
list="productCategoryMemberList">
+ <set field="product.productId"
from-field="productCategoryMember.productId"/>
+ <entity-condition list="ProductContentAndInfoList"
entity-name="ProductContentAndInfo" filter-by-date="true" use-cache="true">
+ <condition-list combine="and">
+ <condition-expr field-name="productId"
from-field="product.productId"/>
+ <condition-expr field-name="productContentTypeId"
value="ALTERNATIVE_URL"/>
+ </condition-list>
+ <order-by field-name="-fromDate"/>
+ </entity-condition>
+ <if-empty field="ProductContentAndInfoList">
+ <entity-one value-field="productMap"
entity-name="Product">
+ <field-map field-name="productId"
from-field="product.productId"/>
+ </entity-one>
+ <set
field="createSimpleTextContentForProductCtx.fromDate" from-field="now"/>
+ <set
field="createSimpleTextContentForProductCtx.productContentTypeId"
value="ALTERNATIVE_URL"/>
+ <set
field="createSimpleTextContentForProductCtx.localeString" value="en"/>
+ <set
field="createSimpleTextContentForProductCtx.productId"
from-field="product.productId"/>
+ <if-empty field="productMap.internalName">
+ <set
field="createSimpleTextContentForProductCtx.text"
from-field="productMap.productName"/>
+ <else>
+ <set
field="createSimpleTextContentForProductCtx.text"
from-field="productMap.internalName"/>
+ </else>
+ </if-empty>
+ <if-not-empty
field="createSimpleTextContentForProductCtx.text">
+ <call-service
service-name="createSimpleTextContentForProduct"
in-map-name="createSimpleTextContentForProductCtx"/>
+ <calculate field="productsUpdated" type="Integer">
+ <calcop operator="add" field="productsUpdated">
+ <number value="1"/>
+ </calcop>
+ </calculate>
+ </if-not-empty>
+ <check-errors/>
<else>
- <set field="createSimpleTextContentForProductCtx.text"
from-field="productMap.internalName"/>
- </else>
- </if-empty>
- <if-not-empty
field="createSimpleTextContentForProductCtx.text">
- <call-service
service-name="createSimpleTextContentForProduct"
in-map-name="createSimpleTextContentForProductCtx"/>
- <calculate field="productsUpdated">
- <calcop operator="add" field="productsUpdated">
+ <calculate field="productsNotUpdated" type="Integer">
+ <calcop operator="add" field="productsNotUpdated">
<number value="1"/>
</calcop>
</calculate>
- </if-not-empty>
- <check-errors/>
- </if-empty>
- </iterate>
+ </else>
+ </if-empty>
+ </iterate>
+ </if-empty>
</iterate>
<set field="categoriesUpdatedMessage" value="Categories updated:
${categoriesUpdated}"/>
<field-to-list list="successMessageList"
field="categoriesUpdatedMessage"/>
<set field="productsUpdatedMessage" value="Products updated:
${productsUpdated}"/>
<field-to-list list="successMessageList"
field="productsUpdatedMessage"/>
+ <field-to-result field="categoriesNotUpdated"
result-name="categoriesNotUpdated"/>
+ <field-to-result field="productsNotUpdated"
result-name="productsNotUpdated"/>
+ <field-to-result field="categoriesUpdated"
result-name="categoriesUpdated"/>
+ <field-to-result field="productsUpdated"
result-name="productsUpdated"/>
</simple-method>
<simple-method method-name="createMissingCategoryAltUrlInline"
short-description="create missing category alternative inline">
<entity-and list="productCategoryRollups"
entity-name="ProductCategoryRollup" filter-by-date="true">
Modified: ofbiz/trunk/applications/product/servicedef/services.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services.xml?rev=1153034&r1=1153033&r2=1153034&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services.xml Tue Aug 2
05:56:47 2011
@@ -1634,5 +1634,11 @@ under the License.
location="component://product/script/org/ofbiz/product/catalog/CatalogServices.xml"
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"/>
+ <attribute name="product" mode="IN" type="String" optional="true"/>
+ <attribute name="categoriesNotUpdated" mode="OUT" type="Integer"
optional="true"/>
+ <attribute name="categoriesUpdated" mode="OUT" type="Integer"
optional="true"/>
+ <attribute name="productsNotUpdated" mode="OUT" type="Integer"
optional="true"/>
+ <attribute name="productsUpdated" mode="OUT" type="Integer"
optional="true"/>
</service>
</services>