Author: jleroux
Date: Tue Oct 28 08:56:02 2014 New Revision: 1634818 URL: http://svn.apache.org/r1634818 Log: Keeps in sync with OFBiz trunk HEAD Removed: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/projectmgr/servicedef/secas.xml Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/ (props changed) ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/script/org/ofbiz/accounting/test/InvoicePerShipmentTests.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/data/ContentHelpData.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/data/ContentTypeData.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/entitydef/entitymodel.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementEvents.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementWorker.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ConvertTree.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/cms/CmsEvents.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/content/ContentEvents.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/content/ContentKeywordIndex.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/content/ContentPermissionServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/content/ContentSearch.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/content/ContentServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/content/ContentWorker.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/data/DataEvents.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/data/DataServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/CategoryServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/config/log4j2.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/ofbiz-component.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/container/ComponentContainer.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/container/JustLoadComponentsContainer.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/src/org/ofbiz/common/CommonServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/webcommon/WEB-INF/common-controller.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityConditionBase.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityConditionListBase.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/datasource/GenericHelper.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/datasource/GenericHelperDAO.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/security/src/org/ofbiz/security/SecurityFactory.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/job/JobManager.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/Config.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/Start.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/both.properties ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/install.properties ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/jetty.properties ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/pos.properties ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/rmi.properties ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/setup.properties ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/start.properties ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/test.properties ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/start/src/org/ofbiz/base/start/testlist.properties ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/ContentDocument.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/projectmgr/ofbiz-component.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java Propchange: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1633086-1634817 Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/script/org/ofbiz/accounting/test/InvoicePerShipmentTests.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/script/org/ofbiz/accounting/test/InvoicePerShipmentTests.xml?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/script/org/ofbiz/accounting/test/InvoicePerShipmentTests.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/script/org/ofbiz/accounting/test/InvoicePerShipmentTests.xml Tue Oct 28 08:56:02 2014 @@ -128,7 +128,6 @@ under the License. <set field="packInput.prdInfo._1" value="GZ-1000"/> <set field="packInput.iteInfo._1" value="00001"/> <set field="packInput.wgtInfo._1" value="0"/> - <set field="packInput.boxTypeInfo._1" value="FX10KGBOX"/> <set field="packInput.numPackagesInfo._1" value="1"/> <call-service service-name="packBulkItems" in-map-name="packInput"> <result-to-field result-name="responseMessage"/> @@ -255,7 +254,6 @@ under the License. <set field="packInput.prdInfo._1" value="GZ-1000"/> <set field="packInput.iteInfo._1" value="00001"/> <set field="packInput.wgtInfo._1" value="0"/> - <set field="packInput.boxTypeInfo._1" value="FX10KGBOX"/> <set field="packInput.numPackagesInfo._1" value="1"/> <call-service service-name="packBulkItems" in-map-name="packInput"> <result-to-field result-name="responseMessage"/> @@ -381,7 +379,6 @@ under the License. <set field="packInput.prdInfo._1" value="GZ-2644"/> <set field="packInput.iteInfo._1" value="00001"/> <set field="packInput.wgtInfo._1" value="0"/> - <set field="packInput.boxTypeInfo._1" value="FX10KGBOX"/> <set field="packInput.numPackagesInfo._1" value="1"/> <call-service service-name="packBulkItems" in-map-name="packInput"> <result-to-field result-name="responseMessage"/> @@ -507,7 +504,6 @@ under the License. <set field="packInput.prdInfo._1" value="GZ-2644"/> <set field="packInput.iteInfo._1" value="00001"/> <set field="packInput.wgtInfo._1" value="0"/> - <set field="packInput.boxTypeInfo._1" value="FX10KGBOX"/> <set field="packInput.numPackagesInfo._1" value="1"/> <call-service service-name="packBulkItems" in-map-name="packInput"> <result-to-field result-name="responseMessage"/> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java Tue Oct 28 08:56:02 2014 @@ -40,11 +40,8 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.condition.EntityConditionList; -import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.util.EntityQuery; -import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.order.order.OrderReadHelper; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.LocalDispatcher; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java Tue Oct 28 08:56:02 2014 @@ -33,12 +33,10 @@ import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.collections.ResourceBundleMapWrapper; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; -import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.order.finaccount.FinAccountHelper; import org.ofbiz.order.order.OrderReadHelper; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java Tue Oct 28 08:56:02 2014 @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.ofbiz.base.util.UtilMisc; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.service.ServiceUtil; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java Tue Oct 28 08:56:02 2014 @@ -30,7 +30,6 @@ import org.ofbiz.accounting.payment.Paym import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.StringUtil; -import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilNumber; import org.ofbiz.base.util.UtilProperties; @@ -39,7 +38,6 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; -import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java Tue Oct 28 08:56:02 2014 @@ -61,7 +61,6 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.HttpClient; import org.ofbiz.base.util.HttpClientException; import org.ofbiz.base.util.StringUtil; -import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java Tue Oct 28 08:56:02 2014 @@ -37,7 +37,6 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; -import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.order.order.OrderReadHelper; import org.ofbiz.product.store.ProductStoreWorker; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java Tue Oct 28 08:56:02 2014 @@ -19,14 +19,11 @@ package org.ofbiz.accounting.util; -import java.math.BigDecimal; import java.util.List; import javolution.util.FastList; import org.ofbiz.accounting.AccountingException; -import org.ofbiz.base.util.Debug; -import org.ofbiz.base.util.UtilMisc; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/data/ContentHelpData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/data/ContentHelpData.xml?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/data/ContentHelpData.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/data/ContentHelpData.xml Tue Oct 28 08:56:02 2014 @@ -25,10 +25,11 @@ under the License. <DataResource dataResourceId="HELP_TEMPL"/><!-- further defined in the content application --> <Content contentId="DOCUMENTS" contentTypeId="DOCUMENT" contentName="Documents"/> - <ContentAssoc contentId="TREE_ROOT" contentIdTo="DOCUMENTS" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum=""/> <!-- system document root used in content -> navigate --> <Content contentId="TREE_ROOT" contentTypeId="DOCUMENT" contentName="ROOT" dataResourceId=""/> + <ContentAssoc contentId="TREE_ROOT" contentIdTo="DOCUMENTS" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum=""/> + <!-- show help on the system document root --> <ContentAssoc contentId="TREE_ROOT" contentIdTo="HELP_ROOT" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01"/> <DataResource dataResourceId="HELP_ROOT" localeString="en" dataResourceTypeId="OFBIZ_FILE" objectInfo="applications/content/data/helpdata/HELP_ROOT.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Help system root" mimeTypeId="text/xml" isPublic="Y" /> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/data/ContentTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/data/ContentTypeData.xml?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/data/ContentTypeData.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/data/ContentTypeData.xml Tue Oct 28 08:56:02 2014 @@ -253,7 +253,6 @@ under the License. </div>]]></textData> </ElectronicText> <Content contentId="STDWRAP001" contentTypeId="DOCUMENT" dataResourceId="STDWRAP001" contentName="Standard SubContent Wrapper" description="Standard SubContent Wrapper" mimeTypeId="text/html"/> - <Content contentId="TREE_ROOT"/> <WebAnalyticsType description="Web Analytics" hasTable="N" parentTypeId="" webAnalyticsTypeId="WEB_ANALYTICS"/> <WebAnalyticsType webAnalyticsTypeId="GOOGLE_ANALYTICS" parentTypeId="WEB_ANALYTICS" hasTable="N" description="Google Analytics"/> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/entitydef/entitymodel.xml?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/entitydef/entitymodel.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/entitydef/entitymodel.xml Tue Oct 28 08:56:02 2014 @@ -520,7 +520,6 @@ under the License. <field name="dataSourceId" type="id"></field> <prim-key field="contentId"/> <prim-key field="metaDataPredicateId"/> - <prim-key field="metaDataValue"/> <relation type="one" fk-name="CONTENTMD_CNTNT" rel-entity-name="Content"> <key-map field-name="contentId"/> </relation> @@ -893,7 +892,6 @@ under the License. <field name="dataSourceId" type="id"></field> <prim-key field="dataResourceId"/> <prim-key field="metaDataPredicateId"/> - <prim-key field="metaDataValue"/> <relation type="one" fk-name="DATA_MD_DATREC" rel-entity-name="DataResource"> <key-map field-name="dataResourceId"/> </relation> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementEvents.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementEvents.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementEvents.java Tue Oct 28 08:56:02 2014 @@ -40,6 +40,7 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.security.Security; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -194,7 +195,7 @@ public class ContentManagementEvents { List<Object []> origPublishedLinkList = null; try { // TODO: this needs to be given author userLogin - delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", authorId), true); + EntityQuery.use(delegator).from("UserLogin").where("userLoginId", authorId).cache().queryOne(); origPublishedLinkList = ContentManagementWorker.getPublishedLinks(delegator, targContentId, webSiteId, userLogin, security, permittedAction, permittedOperations, roles); } catch (GenericEntityException e) { request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); @@ -254,7 +255,12 @@ public class ContentManagementEvents { if (!currentSubContentId.equals(origSubContentId)) { // disable existing link if (UtilValidate.isNotEmpty(origSubContentId) && origFromDate != null) { - List<GenericValue> oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", origSubContentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null), null, false); + List<GenericValue> oldActiveValues = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentId", targContentId, + "contentIdTo", origSubContentId, + "contentAssocTypeId", "PUBLISH_LINK", + "thruDate", null) + .queryList(); for (GenericValue cAssoc : oldActiveValues) { cAssoc.set("thruDate", nowTimestamp); cAssoc.store(); @@ -295,7 +301,7 @@ public class ContentManagementEvents { //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, results(3b):" + results , module); if (!statusIdUpdated) { try { - GenericValue targContent = delegator.findOne("Content", UtilMisc.toMap("contentId", targContentId), false); + GenericValue targContent = EntityQuery.use(delegator).from("Content").where("contentId", targContentId).queryOne(); targContent.set("statusId", "CTNT_PUBLISHED"); targContent.store(); statusIdUpdated = true; @@ -308,12 +314,12 @@ public class ContentManagementEvents { } } else if (UtilValidate.isNotEmpty(origSubContentId)) { // if no current link is passed in, look to see if there is an existing link(s) that must be disabled - List<GenericValue> oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", origSubContentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null), null, false); - for (GenericValue cAssoc : oldActiveValues) { - cAssoc.set("thruDate", nowTimestamp); - cAssoc.store(); - } - oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", contentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null), null, false); + List<GenericValue> oldActiveValues = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentId", targContentId, + "contentIdTo", origSubContentId, + "contentAssocTypeId", "PUBLISH_LINK", + "thruDate", null) + .queryList(); for (GenericValue cAssoc : oldActiveValues) { cAssoc.set("thruDate", nowTimestamp); cAssoc.store(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementServices.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementServices.java Tue Oct 28 08:56:02 2014 @@ -44,10 +44,9 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.condition.EntityConditionList; -import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.model.ModelUtil; +import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.security.Security; import org.ofbiz.service.DispatchContext; @@ -292,7 +291,7 @@ public class ContentManagementServices { contentExists = false; } else { try { - GenericValue val = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); + GenericValue val = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); if (val == null) contentExists = false; } catch (GenericEntityException e) { return ServiceUtil.returnError(e.toString()); @@ -382,7 +381,7 @@ public class ContentManagementServices { contentAssocContext.put("skipPermissionCheck", context.get("skipPermissionCheck")); Map<String, Object> thisResult = null; try { - GenericValue contentAssocExisting = delegator.findOne("ContentAssoc", contentAssoc.getPrimaryKey(), false); + GenericValue contentAssocExisting = EntityQuery.use(delegator).from("ContentAssoc").where(contentAssoc.getPrimaryKey()).queryOne(); if (contentAssocExisting == null) { ModelService contentAssocModel = dispatcher.getDispatchContext().getModelService("createContentAssoc"); Map<String, Object> ctx = contentAssocModel.makeValid(contentAssoc, "IN"); @@ -465,7 +464,7 @@ public class ContentManagementServices { List<GenericValue> siteRoles = null; try { - siteRoles = delegator.findByAnd("RoleType", UtilMisc.toMap("parentTypeId", "BLOG"), null, true); + siteRoles = EntityQuery.use(delegator).from("RoleType").where("parentTypeId", "BLOG").cache().queryList(); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.toString()); } @@ -556,7 +555,7 @@ public class ContentManagementServices { Locale locale = (Locale) context.get("locale"); Map<String, Object> result = FastMap.newInstance(); try { - //GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); + //GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); ModelService checkPermModel = dispatcher.getDispatchContext().getModelService("checkContentPermission"); Map<String, Object> ctx = checkPermModel.makeValid(context, "IN"); Map<String, Object> thisResult = dispatcher.runSync("checkContentPermission", ctx); @@ -613,7 +612,7 @@ public class ContentManagementServices { dataResourceExists = false; } else { try { - GenericValue val = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); + GenericValue val = EntityQuery.use(delegator).from("DataResource").where("dataResourceId", dataResourceId).queryOne(); if (val == null) { dataResourceExists = false; } @@ -765,9 +764,7 @@ public class ContentManagementServices { } public static void addRoleToUser(Delegator delegator, LocalDispatcher dispatcher, Map<String, Object> serviceContext) throws GenericServiceException, GenericEntityException { - String partyId = (String)serviceContext.get("partyId"); - Map<String, Object> findMap = UtilMisc.<String, Object>toMap("partyId", partyId); - List<GenericValue> userLoginList = delegator.findByAnd("UserLogin", findMap, null, false); + List<GenericValue> userLoginList = EntityQuery.use(delegator).from("UserLogin").where("partyId", serviceContext.get("partyId")).queryList(); for (GenericValue partyUserLogin : userLoginList) { String partyUserLoginId = partyUserLogin.getString("userLoginId"); serviceContext.put("contentId", partyUserLoginId); // author contentId @@ -794,7 +791,7 @@ public class ContentManagementServices { List<GenericValue> siteRoles = null; try { - siteRoles = delegator.findByAnd("RoleType", UtilMisc.toMap("parentTypeId", "BLOG"), null, true); + siteRoles = EntityQuery.use(delegator).from("RoleType").where("parentTypeId", "BLOG").cache().queryList(); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.toString()); } @@ -876,7 +873,7 @@ public class ContentManagementServices { if (Debug.infoOn()) { Debug.logInfo("in updateOrRemove, entityValuePK:" + entityValuePK, module); } - GenericValue entityValueExisting = delegator.findOne(entityName, entityValuePK, true); + GenericValue entityValueExisting = EntityQuery.use(delegator).from(entityName).where(entityValuePK).cache().queryOne(); if (Debug.infoOn()) { Debug.logInfo("in updateOrRemove, entityValueExisting:" + entityValueExisting, module); } @@ -925,14 +922,16 @@ public class ContentManagementServices { EntityCondition conditionType = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList); EntityCondition conditionMain = EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("contentIdTo", EntityOperator.EQUALS, contentIdTo), conditionType), EntityOperator.AND); try { - List<GenericValue> listAll = delegator.findList("ContentAssoc", conditionMain, null, UtilMisc.toList("sequenceNum", "fromDate", "createdDate"), null, false); - List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll); + List<GenericValue> listAll = EntityQuery.use(delegator).from("ContentAssoc") + .where(conditionMain) + .orderBy("sequenceNum", "fromDate", "createdDate") + .filterByDate().queryList(); String contentId = (String)context.get("contentId"); String dir = (String)context.get("dir"); int seqNum = seqIncrement; String thisContentId = null; - for (int i=0; i < listFiltered.size(); i++) { - GenericValue contentAssoc = listFiltered.get(i); + for (int i=0; i < listAll.size(); i++) { + GenericValue contentAssoc = listAll.get(i); if (UtilValidate.isNotEmpty(contentId) && UtilValidate.isNotEmpty(dir)) { // move targeted entry up or down thisContentId = contentAssoc.getString("contentId"); @@ -941,7 +940,7 @@ public class ContentManagementServices { if (i > 0) { // Swap with previous entry try { - GenericValue prevValue = listFiltered.get(i-1); + GenericValue prevValue = listAll.get(i-1); Long prevSeqNum = (Long)prevValue.get("sequenceNum"); prevValue.put("sequenceNum", Long.valueOf(seqNum)); prevValue.store(); @@ -952,9 +951,9 @@ public class ContentManagementServices { } } } else { - if (i < listFiltered.size()) { + if (i < listAll.size()) { // Swap with next entry - GenericValue nextValue = listFiltered.get(i+1); + GenericValue nextValue = listAll.get(i+1); nextValue.put("sequenceNum", Long.valueOf(seqNum)); nextValue.store(); seqNum += seqIncrement; @@ -990,7 +989,7 @@ public class ContentManagementServices { Locale locale = (Locale) context.get("locale"); //int seqNum = 9999; try { - GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); + GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); if (content == null) { Debug.logError("content was null", module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", ""), locale)); @@ -1075,7 +1074,7 @@ public class ContentManagementServices { String contentId = (String)context.get("contentId"); try { - GenericValue thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); + GenericValue thisContent = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); if (thisContent == null) throw new RuntimeException("No entity found for id=" + contentId); @@ -1092,13 +1091,12 @@ public class ContentManagementServices { EntityCondition conditionType = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList); EntityCondition conditionMain = EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("contentId", EntityOperator.EQUALS, thisContentId), conditionType), EntityOperator.AND); - List listAll = delegator.findByConditionCache("ContentAssoc", conditionMain, null, null); - List listFiltered = EntityUtil.filterByDate(listAll); + List listFiltered = EntityQuery.use(delegator).from("ContentAssoc").where(mainCondition).cache().filterByDate().queryList(); Iterator iter = listFiltered.iterator(); while (iter.hasNext()) { GenericValue contentAssoc = (GenericValue)iter.next(); String subContentId = contentAssoc.getString("contentId"); - GenericValue contentTo = delegator.findOne("Content", UtilMisc.toMap("contentId", subContentId), true); + GenericValue contentTo = EntityQuery.use(delegator).from("Content").where("contentId", subContentId).cache().queryOne(); Integer childBranchCount = (Integer)contentTo.get("childBranchCount"); int branchCount = (childBranchCount == null) ? 1 : childBranchCount.intValue(); if (mode != null && mode.equalsIgnoreCase("remove")) @@ -1146,7 +1144,7 @@ public class ContentManagementServices { contentTypeId = "OUTLINE_NODE"; GenericValue thisContent = null; try { - thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); + thisContent = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); if (thisContent == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); } @@ -1186,7 +1184,7 @@ public class ContentManagementServices { } GenericValue thisContent = null; try { - thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); + thisContent = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); if (thisContent == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); @@ -1324,16 +1322,13 @@ public class ContentManagementServices { Map<String, Object> results = FastMap.newInstance(); Delegator delegator = dctx.getDelegator(); String contentIdTo = (String)context.get("contentId"); - List<EntityExpr> condList = FastList.newInstance(); - EntityExpr expr = EntityCondition.makeCondition("caContentIdTo", EntityOperator.EQUALS, contentIdTo); - condList.add(expr); - expr = EntityCondition.makeCondition("caContentAssocTypeId", EntityOperator.EQUALS, "SUB_CONTENT"); - condList.add(expr); - expr = EntityCondition.makeCondition("caThruDate", EntityOperator.EQUALS, null); - condList.add(expr); - EntityConditionList<EntityExpr> entityCondList = EntityCondition.makeCondition(condList, EntityOperator.AND); - try { - List<GenericValue> lst = delegator.findList("ContentAssocDataResourceViewFrom", entityCondList, null, UtilMisc.toList("caSequenceNum", "caFromDate", "createdDate"), null, false); + try { + List<GenericValue> lst = EntityQuery.use(delegator).from("ContentAssocDataResourceViewFrom") + .where("caContentIdTo", contentIdTo, + "caContentAssocTypeId", "SUB_CONTENT", + "caThruDate", null) + .orderBy("caSequenceNum", "caFromDate", "createdDate") + .queryList(); results.put("_LIST_", lst); } catch (GenericEntityException e) { Debug.logError(e, module); @@ -1387,7 +1382,7 @@ public class ContentManagementServices { String contentAssocTypeId = (String)context.get("contentAssocTypeId"); try { - GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); + GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).cache().queryOne(); if (content == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); } @@ -1413,7 +1408,7 @@ public class ContentManagementServices { String contentAssocTypeId = (String)context.get("contentAssocTypeId"); try { - GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); + GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).cache().queryOne(); if (content == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); } @@ -1467,11 +1462,12 @@ public class ContentManagementServices { boolean hasExistingContentRole = false; GenericValue contentRole = null; try { - List<GenericValue> contentRoleList = delegator.findByAnd("ContentRole", UtilMisc.toMap("partyId", partyId, "contentId", webPubPt, "roleTypeId", roleTypeId), null, true); - List<GenericValue> listFiltered = EntityUtil.filterByDate(contentRoleList, true); - List<GenericValue> listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("fromDate DESC")); - if (listOrdered.size() > 0) { - contentRole = listOrdered.get(0); + contentRole = EntityQuery.use(delegator).from("ContentRole") + .where("partyId", partyId, "contentId", webPubPt, "roleTypeId", roleTypeId) + .orderBy("fromDate DESC") + .cache().filterByDate() + .queryFirst(); + if (contentRole != null) { hasExistingContentRole = true; } } catch (GenericEntityException e) { @@ -1548,14 +1544,16 @@ public class ContentManagementServices { } GenericValue productContent = null; try { - List<GenericValue> lst = delegator.findByAnd("ProductContent", UtilMisc.toMap("productId", productId, "productContentTypeId", "ONLINE_ACCESS"), null, true); - List<GenericValue> listFiltered = EntityUtil.filterByDate(lst, orderCreatedDate, "purchaseFromDate", "purchaseThruDate", true); - List<GenericValue> listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("purchaseFromDate", "purchaseThruDate")); - List<GenericValue> listThrusOnly = EntityUtil.filterOutByCondition(listOrdered, EntityCondition.makeCondition("purchaseThruDate", EntityOperator.EQUALS, null)); + List<GenericValue> lst = EntityQuery.use(delegator).from("ProductContent") + .where("productId", productId, "productContentTypeId", "ONLINE_ACCESS") + .orderBy("purchaseFromDate", "purchaseThruDate") + .filterByDate("purchaseFromDate", "purchaseThruDate") + .cache().queryList(); + List<GenericValue> listThrusOnly = EntityUtil.filterOutByCondition(lst, EntityCondition.makeCondition("purchaseThruDate", EntityOperator.EQUALS, null)); if (listThrusOnly.size() > 0) { productContent = listThrusOnly.get(0); - } else if (listOrdered.size() > 0) { - productContent = listOrdered.get(0); + } else if (lst.size() > 0) { + productContent = lst.get(0); } } catch (GenericEntityException e) { Debug.logError(e.toString(), module); @@ -1592,9 +1590,10 @@ public class ContentManagementServices { GenericValue orderHeader = null; try { - List<GenericValue> orderRoleList = delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "END_USER_CUSTOMER"), null, false); - if (orderRoleList.size() > 0) { - GenericValue orderRole = orderRoleList.get(0); + GenericValue orderRole = EntityQuery.use(delegator).from("OrderRole") + .where("orderId", orderId, "roleTypeId", "END_USER_CUSTOMER") + .queryFirst(); + if (orderRole != null) { String partyId = (String) orderRole.get("partyId"); context.put("partyId", partyId); } else { @@ -1602,7 +1601,7 @@ public class ContentManagementServices { return ServiceUtil.returnFailure(msg); } - orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); + orderHeader = EntityQuery.use(delegator).from("OrderHeader").where("orderId", orderId).queryOne(); if (orderHeader == null) { String msg = "No OrderHeader found for orderId:" + orderId; return ServiceUtil.returnError(msg); @@ -1614,9 +1613,10 @@ public class ContentManagementServices { for (GenericValue orderItem : orderItemList) { BigDecimal qty = orderItem.getBigDecimal("quantity"); String productId = (String) orderItem.get("productId"); - List<GenericValue> productContentList = delegator.findByAnd("ProductContent", UtilMisc.toMap("productId", productId, "productContentTypeId", "ONLINE_ACCESS"), null, false); - List<GenericValue> productContentListFiltered = EntityUtil.filterByDate(productContentList); - if (productContentListFiltered.size() > 0) { + long productContentCount = EntityQuery.use(delegator).from("ProductContent") + .where("productId", productId, "productContentTypeId", "ONLINE_ACCESS") + .filterByDate().queryCount(); + if (productContentCount > 0) { context.put("productId", productId); context.put("quantity", Integer.valueOf(qty.intValue())); Map<String, Object> ctx = subscriptionModel.makeValid(context, "IN"); @@ -1655,7 +1655,7 @@ public class ContentManagementServices { ctx.put("contentAssocTypeIdList", contentAssocTypeIdList); try { - GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); + GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); result = followNodeChildrenMethod(content, dispatcher, serviceName, ctx); } catch (GenericEntityException e) { Debug.logError(e.toString(), module); @@ -1705,7 +1705,7 @@ public class ContentManagementServices { } if (UtilValidate.isNotEmpty(oldDataResourceId)) { try { - dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", oldDataResourceId), false); + dataResource = EntityQuery.use(delegator).from("DataResource").where("dataResourceId", oldDataResourceId).queryOne(); } catch (GenericEntityException e) { Debug.logError(e.toString(), module); return ServiceUtil.returnError(e.toString()); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementWorker.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementWorker.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementWorker.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ContentManagementWorker.java Tue Oct 28 08:56:02 2014 @@ -19,6 +19,7 @@ package org.ofbiz.content; import java.sql.Timestamp; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Iterator; @@ -47,6 +48,7 @@ import org.ofbiz.entity.GenericPK; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.condition.EntityOperator; +import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.entityext.permission.EntityPermissionChecker; import org.ofbiz.minilang.MiniLangException; @@ -265,7 +267,7 @@ public class ContentManagementWorker { request.setAttribute("currentPK", currentPK); GenericValue currentValue = null; try { - currentValue = delegator.findOne(currentPK.getEntityName(), currentPK, false); + currentValue = EntityQuery.use(delegator).from(currentPK.getEntityName()).where(currentPK).queryOne(); } catch (GenericEntityException e) { } request.setAttribute("currentValue", currentValue); @@ -315,7 +317,9 @@ public class ContentManagementWorker { public static List<GenericValue> getAllPublishPoints(Delegator delegator, String parentPubPt) throws GeneralException { List<GenericValue> relatedPubPts = null; try { - relatedPubPts = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentIdTo", parentPubPt, "contentAssocTypeId", "SUBSITE"), null, true); + relatedPubPts = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentIdTo", parentPubPt, "contentAssocTypeId", "SUBSITE") + .cache().queryList(); } catch (GenericEntityException e) { throw new GeneralException(e.getMessage()); } @@ -323,7 +327,7 @@ public class ContentManagementWorker { GenericValue webSitePublishPoint = null; for (GenericValue contentAssoc : relatedPubPts) { String pub = (String)contentAssoc.get("contentId"); - //webSitePublishPoint = delegator.findOne("WebSitePublishPoint", UtilMisc.toMap("contentId", pub), true); + //webSitePublishPoint = EntityQuery.use(delegator).from("WebSitePublishPoint").where("contentId", pub).cache().queryOne(); webSitePublishPoint = getWebSitePublishPoint(delegator, pub, false); allPublishPoints.add(webSitePublishPoint); } @@ -362,7 +366,7 @@ public class ContentManagementWorker { public static List<Map<String, Object>> getStaticValues(Delegator delegator, String parentPlaceholderId, List<String []> permittedPublishPointList) throws GeneralException { List<GenericValue> assocValueList = null; try { - assocValueList = delegator.findByAnd("Content", UtilMisc.toMap("contentTypeId", parentPlaceholderId), null, true); + assocValueList = EntityQuery.use(delegator).from("Content").where("contentTypeId", parentPlaceholderId).cache().queryList(); } catch (GenericEntityException e) { throw new GeneralException(e.getMessage()); } @@ -406,7 +410,7 @@ public class ContentManagementWorker { webSitePublishPoint = cachedWebSitePublishPoints.get(contentId); if (webSitePublishPoint == null) { - webSitePublishPoint = delegator.findOne("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId), false); + webSitePublishPoint = EntityQuery.use(delegator).from("WebSitePublishPoint").where("contentId", contentId).queryOne(); // If no webSitePublishPoint exists, still try to look for parent by making a dummy value if (webSitePublishPoint == null) { webSitePublishPoint = delegator.makeValue("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId)); @@ -425,7 +429,7 @@ public class ContentManagementWorker { //if (Debug.infoOn()) Debug.logInfo("in overrideWebSitePublishPoint, contentIdTo:" + contentIdTo, module); if (contentIdTo != null) { //webSitePublishPoint = getWebSitePublishPoint(delegator, contentIdTo, false); - webSitePublishPoint = delegator.findOne("WebSitePublishPoint", UtilMisc.toMap("contentId", contentIdTo), true); + webSitePublishPoint = EntityQuery.use(delegator).from("WebSitePublishPoint").where("contentId", contentIdTo).cache().queryOne(); if (webSitePublishPoint != null) { webSitePublishPoint = GenericValue.create(webSitePublishPoint); webSitePublishPoint = overrideWebSitePublishPoint(delegator, webSitePublishPoint); @@ -440,18 +444,17 @@ public class ContentManagementWorker { public static GenericValue getParentWebSitePublishPointValue(Delegator delegator, String contentId) throws GenericEntityException { String contentIdTo = getParentWebSitePublishPointId(delegator, contentId); - GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentIdTo), true); + GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", contentIdTo).cache().queryOne(); return content; } public static String getParentWebSitePublishPointId(Delegator delegator, String contentId) throws GenericEntityException { String contentIdTo = null; - List<GenericValue> contentAssocList = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentAssocTypeId", "SUBSITE"), null, true); - List<GenericValue> filteredContentAssocList = EntityUtil.filterByDate(contentAssocList); - if (filteredContentAssocList.size() > 0) { - GenericValue contentAssoc = filteredContentAssocList.get(0); - if (contentAssoc != null) - contentIdTo = contentAssoc.getString("contentIdTo"); + GenericValue contentAssoc = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentId", contentId, "contentAssocTypeId", "SUBSITE") + .filterByDate().cache().queryFirst(); + if (contentAssoc != null) { + contentIdTo = contentAssoc.getString("contentIdTo"); } return contentIdTo; } @@ -470,7 +473,7 @@ public class ContentManagementWorker { /* if (webSitePublishPoint == null) { - webSitePublishPoint = delegator.findOne("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId), false); + webSitePublishPoint = EntityQuery.use(delegator).from("WebSitePublishPoint").where("contentId", contentId).queryOne(); // If no webSitePublishPoint exists, still try to look for parent by making a dummy value if (webSitePublishPoint == null) { webSitePublishPoint = delegator.makeValue("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId)); @@ -517,8 +520,9 @@ public class ContentManagementWorker { /* */ List<GenericValue> assocValueList = null; try { - List<GenericValue> rawAssocValueList = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentAssocTypeId", "PUBLISH_LINK"), null, true); - assocValueList = EntityUtil.filterByDate(rawAssocValueList); + assocValueList = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentId", targContentId, "contentAssocTypeId", "PUBLISH_LINK") + .filterByDate().cache().queryList(); } catch (GenericEntityException e) { throw new GeneralException(e.getMessage()); } @@ -616,7 +620,9 @@ public class ContentManagementWorker { public static List<GenericValue> getAllDepartmentContent(Delegator delegator, String parentPubPt) throws GeneralException { List<GenericValue> relatedPubPts = null; try { - relatedPubPts = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentIdTo", parentPubPt, "contentAssocTypeId", "DEPARTMENT"), null, true); + relatedPubPts = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentIdTo", parentPubPt, "contentAssocTypeId", "DEPARTMENT") + .cache().queryList(); } catch (GenericEntityException e) { throw new GeneralException(e.getMessage()); @@ -625,7 +631,7 @@ public class ContentManagementWorker { GenericValue departmentContent = null; for (GenericValue contentAssoc : relatedPubPts) { String pub = (String)contentAssoc.get("contentId"); - departmentContent = delegator.findOne("Content", UtilMisc.toMap("contentId", pub), true); + departmentContent = EntityQuery.use(delegator).from("Content").where("contentId", pub).cache().queryOne(); allDepartmentPoints.add(departmentContent); } return allDepartmentPoints; @@ -634,7 +640,7 @@ public class ContentManagementWorker { public static String getUserName(HttpServletRequest request, String userLoginId) throws GenericEntityException { String userName = null; Delegator delegator = (Delegator)request.getAttribute("delegator"); - GenericValue userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", userLoginId), true); + GenericValue userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", userLoginId).cache().queryOne(); GenericValue person = userLogin.getRelatedOne("Person", true); userName = person.getString("firstName") + " " + person.getString("lastName"); return userName; @@ -642,28 +648,26 @@ public class ContentManagementWorker { public static int updateStatsTopDown(Delegator delegator, String contentId, List<String> typeList) throws GenericEntityException { int subLeafCount = 0; - GenericValue thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); + GenericValue thisContent = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); if (thisContent == null) throw new RuntimeException("No entity found for id=" + contentId); - EntityCondition conditionMain = null; + List<EntityCondition> conditionMain = new ArrayList<EntityCondition>(); + conditionMain.add(EntityCondition.makeCondition("contentIdTo", contentId)); if (typeList.size() > 0) { - EntityCondition conditionType = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList); - conditionMain = EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("contentIdTo", EntityOperator.EQUALS, contentId), conditionType), EntityOperator.AND); - } else { - conditionMain = EntityCondition.makeCondition("contentIdTo", EntityOperator.EQUALS, contentId); + conditionMain.add(EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList)); + } + List<GenericValue> contentAssocs = EntityQuery.use(delegator).from("ContentAssoc").where(conditionMain) + .filterByDate().cache().queryList(); + for (GenericValue contentAssoc : contentAssocs) { + String subContentId = contentAssoc.getString("contentId"); + subLeafCount += updateStatsTopDown(delegator, subContentId, typeList); } - List<GenericValue> listAll = delegator.findList("ContentAssoc", conditionMain, null, null, null, true); - List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll); - for (GenericValue contentAssoc : listFiltered) { - String subContentId = contentAssoc.getString("contentId"); - subLeafCount += updateStatsTopDown(delegator, subContentId, typeList); - } // If no children, count this as a leaf if (subLeafCount == 0) subLeafCount = 1; - thisContent.put("childBranchCount", Long.valueOf(listFiltered.size())); + thisContent.put("childBranchCount", Long.valueOf(contentAssocs.size())); thisContent.put("childLeafCount", Long.valueOf(subLeafCount)); thisContent.store(); @@ -671,17 +675,17 @@ public class ContentManagementWorker { } public static void updateStatsBottomUp(Delegator delegator, String contentId, List<String> typeList, int branchChangeAmount, int leafChangeAmount) throws GenericEntityException { - GenericValue thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); + GenericValue thisContent = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); if (thisContent == null) throw new RuntimeException("No entity found for id=" + contentId); - EntityCondition conditionType = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList); - EntityCondition conditionMain = EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("contentId", EntityOperator.EQUALS, contentId), conditionType), EntityOperator.AND); - List<GenericValue> listAll = delegator.findList("ContentAssoc", conditionMain, null, null, null, true); - List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll); - for (GenericValue contentAssoc : listFiltered) { + List<GenericValue> contentAssocs = EntityQuery.use(delegator).from("ContentAssoc") + .where(EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList), + EntityCondition.makeCondition("contentId", EntityOperator.EQUALS, contentId)) + .cache().filterByDate().queryList(); + for (GenericValue contentAssoc : contentAssocs) { String contentIdTo = contentAssoc.getString("contentIdTo"); - GenericValue contentTo = delegator.findOne("Content", UtilMisc.toMap("contentId", contentIdTo), false); + GenericValue contentTo = EntityQuery.use(delegator).from("Content").where("contentId", contentIdTo).queryOne(); int intLeafCount = 0; Long leafCount = (Long)contentTo.get("childLeafCount"); if (leafCount != null) { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ConvertTree.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ConvertTree.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ConvertTree.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/ConvertTree.java Tue Oct 28 08:56:02 2014 @@ -34,6 +34,7 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -123,7 +124,6 @@ In order ta make this service active add String check = "\\", checkSubContent = ",", contentName = "", contentNameInprogress = "", data = line.substring(3, size); //Debug.logInfo("======Data======"+data); size = data.length(); - List<GenericValue> contents = null; for (int index = 0; index< size; index++) {//start character in line boolean contentNameMatch = false; @@ -135,21 +135,21 @@ In order ta make this service active add contentName = contentName.substring(0, 100); } //check duplicate folder - contents = delegator.findByAnd("Content", UtilMisc.toMap("contentName", contentName), null, false); - if (contents.size() > 0) { - GenericValue contentResult = contents.get(0); - contentId = contentResult.get("contentId").toString(); + GenericValue content = EntityQuery.use(delegator).from("Content").where("contentName", contentName).queryFirst(); + if (content != null) { + contentId = content.getString("contentId"); } - if (contents.size() > 0 && hasFolder==true) { - GenericValue contentResult = contents.get(0); - contentId = contentResult.get("contentId").toString(); + if (content != null && hasFolder==true) { if (rootContent != null) { - contentAssocs = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", rootContent), null, false); - List<GenericValue> contentAssocCheck = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentIdTo", rootContent), null, false); + contentAssocs = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentId", contentId, "contentIdTo", rootContent) + .queryList(); + List<GenericValue> contentAssocCheck = EntityQuery.use(delegator).from("ContentAssoc").where("contentIdTo", rootContent).queryList(); + Iterator<GenericValue> contentAssChecks = contentAssocCheck.iterator(); while (contentAssChecks.hasNext() && contentNameMatch == false) { GenericValue contentAss = contentAssChecks.next(); - GenericValue contentcheck = delegator.findOne("Content", UtilMisc.toMap("contentId", contentAss.get("contentId")), false); + GenericValue contentcheck = EntityQuery.use(delegator).from("Content").where("contentId", contentAss.get("contentId")).queryOne(); if (contentcheck!=null) { if (contentcheck.get("contentName").equals(contentName) && contentNameMatch == false) { contentNameMatch = true; @@ -159,7 +159,9 @@ In order ta make this service active add } } else { rootContent = "HOME_DUCUMENT"; - contentAssocs = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", rootContent), null, false); + contentAssocs = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentId", contentId, "contentIdTo", rootContent) + .queryList(); } contentAssocSize = contentAssocs.size(); } @@ -174,10 +176,6 @@ In order ta make this service active add Entity.set("createdByUserLogin", userLogin.get("userLoginId")); Entity.set("lastModifiedByUserLogin", userLogin.get("userLoginId")); Entity.set("createdDate", UtilDateTime.nowTimestamp()); - Entity.set("lastUpdatedStamp", UtilDateTime.nowTimestamp()); - Entity.set("lastUpdatedTxStamp", UtilDateTime.nowTimestamp()); - Entity.set("createdStamp", UtilDateTime.nowTimestamp()); - Entity.set("createdTxStamp", UtilDateTime.nowTimestamp()); delegator.create(Entity); hasFolder = false; } else { @@ -188,7 +186,12 @@ In order ta make this service active add if (rootContent == null) { rootContent = "HOME_DUCUMENT"; } - contentAssocs = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", rootContent, "contentAssocTypeId", "TREE_CHILD"), null, false); + contentAssocs = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentId", contentId, + "contentIdTo", rootContent, + "contentAssocTypeId", "TREE_CHILD") + .queryList(); + if (contentAssocs.size() == 0) { contentAssoc = FastMap.newInstance(); contentAssoc.put("contentId", contentId); @@ -263,13 +266,15 @@ In order ta make this service active add if (contentName.length()>100) { contentName = contentName.substring(0,100); } - List<GenericValue> contents = delegator.findByAnd("Content", UtilMisc.toMap("contentName", contentName), UtilMisc.toList("-contentId"), false); + List<GenericValue> contents = EntityQuery.use(delegator).from("Content").where("contentName", contentName).orderBy("-contentId").queryList(); if (contents != null) { Iterator<GenericValue> contentCheck = contents.iterator(); while (contentCheck.hasNext() && contentNameMatch == false) { GenericValue contentch = contentCheck.next(); if (contentch != null) { - List<GenericValue> contentAssocsChecks = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentch.get("contentId"), "contentIdTo", rootContent), null, false); + List<GenericValue> contentAssocsChecks = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentId", contentch.get("contentId"), "contentIdTo", rootContent) + .queryList(); if (contentAssocsChecks.size() > 0) { contentNameMatch = true; } @@ -323,14 +328,16 @@ In order ta make this service active add //lastItem if (index == size - 1) { contentNameMatch = false; - List<GenericValue> contents = delegator.findByAnd("Content", UtilMisc.toMap("contentName", contentName), null, false); + List<GenericValue> contents = EntityQuery.use(delegator).from("Content").where("contentName", contentName).queryList(); if (contents != null) { Iterator<GenericValue> contentCheck = contents.iterator(); while (contentCheck.hasNext() && contentNameMatch == false) { GenericValue contentch = contentCheck.next(); if (contentch != null) { - List<GenericValue> contentAssocsChecks = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentch.get("contentId"), "contentIdTo", rootContent), null, false); - if (contentAssocsChecks.size() > 0) { + long contentAssocCount = EntityQuery.use(delegator).from("ContentAssoc") + .where("contentId", contentch.get("contentId"), "contentIdTo", rootContent) + .queryCount(); + if (contentAssocCount > 0) { contentNameMatch = true; } } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java?rev=1634818&r1=1634817&r2=1634818&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java Tue Oct 28 08:56:02 2014 @@ -35,7 +35,7 @@ import org.ofbiz.content.content.Content import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; -import org.ofbiz.entity.condition.EntityCondition; +import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; @@ -74,7 +74,7 @@ public class BlogRssServices { // get the main blog content GenericValue content = null; try { - content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); + content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne(); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -101,14 +101,14 @@ public class BlogRssServices { public static List<SyndEntry> generateEntryList(LocalDispatcher dispatcher, Delegator delegator, String contentId, String entryLink, Locale locale, GenericValue userLogin) { List<SyndEntry> entries = FastList.newInstance(); - List<EntityCondition> exprs = FastList.newInstance(); - exprs.add(EntityCondition.makeCondition("contentIdStart", contentId)); - exprs.add(EntityCondition.makeCondition("caContentAssocTypeId", "PUBLISH_LINK")); - exprs.add(EntityCondition.makeCondition("statusId", "CTNT_PUBLISHED")); List<GenericValue> contentRecs = null; try { - contentRecs = delegator.findList("ContentAssocViewTo", EntityCondition.makeCondition(exprs), null, UtilMisc.toList("-caFromDate"), null, false); + contentRecs = EntityQuery.use(delegator).from("ContentAssocViewTo") + .where("contentIdStart", contentId, + "caContentAssocTypeId", "PUBLISH_LINK", + "statusId", "CTNT_PUBLISHED") + .orderBy("-caFromDate").queryList(); } catch (GenericEntityException e) { Debug.logError(e, module); } |
Free forum by Nabble | Edit this page |