<Serviceverb= "Get"noun= "Products"> <ImplementsService= "Sang.product.productservices.get#productswithpagination"/> <in-parameters> <parametername= "ProductCategoryID"Required= "true"/> <parametername= "GeoId"Required= "true"/> <parametername= "Level"type= "Integer"Default-value= "1"/> </in-parameters> <Actions> <SetField= "Cachekeyname" from= "ProductCategoryID + ' _ ' + level + ' _ ' + geoId + ' _ ' + PageIndex + ' _ ' + pageSize + ' _ ' + Pagenolimit + ' _ ' + Field "/> <Script>def categorygeoproductcache = Ec.cache.getCache (' Product_list_by_category_geo ') Product List = (list) categorygeoproductcache.get (cachekeyname)</Script> <ifcondition= "ProductList! = null"><return/></if> <Service-callname= "Sang.moqui.extend.basicservices.get#childgeoids"In-map= "[Geoid:geoid, Level:20]"Out-map= "Context"/> <SetField= "Geoids" from= "Geoids + [geoId]"/> <Service-callname= "Sang.product.categoryservices.get#childproductcategoryids"Out-map= "Context"In-map= "[Productcategoryid:productcategoryid, Level:level]"/> <SetField= "Paginatemap" from= "[Pageindex:pageindex, Pagesize:pagesize, Pagenolimit:pagenolimit, Orderbyfield:orderbyfield]"/> <Entity-findEntity-name= "Sang.product.ProductAndCategoryAndGeo"List= "PList"distinct= "true"Cache= "true"> <search-form-inputsInput-fields-map= "Paginatemap"/> <Date-filter/> <econditionField-name= "Statusid"value= "Productonshelf"/> <econditionField-name= "GeoId"operator= "in" from= "Geoids"/> <econditionField-name= "ProductCategoryID"operator= "in" from= "Productcategoryids"/> <Select-fieldField-name= "ProductId"/> </Entity-find> <Service-callname= "Sang.product.productservices.get#productsbyids"In-map= "[ProductIds:pList.productId]"Out-map= "Context"/> <Service-callname= "Sang.common.commonservices.add#paginateresponseheaders"In-map= "[Pageindex:pageindex, Pagesize:pagesize, Totalcount:plistcount, Pagemaxindex:plistpagemaxindex, Pagerangelow:plistpagerangelow, Pagerangehigh:plistpagerangehigh] "/> <Script>categorygeoproductcache.put (Cachekeyname, ProductList)</Script> </Actions> </Service>
Working framework various use sorting---using cache