工作框架各种使用整理---使用Cache
<service verb="get" noun="Products">
<implements service="sang.product.ProductServices.get#ProductsWithPagination"/>
<in-parameters>
<parameter name="productCategoryId" required="true"/>
<parameter name="geoId" required="true"/>
<parameter name="level" type="Integer" default-value="1"/>
</in-parameters>
<actions>
<set field="cacheKeyName" from="productCategoryId + '_' + level + '_' + geoId + '_' + pageIndex + '_' + pageSize + '_' + pageNoLimit + '_' + orderByField"/>
<script>
def categoryGeoProductCache = ec.cache.getCache('Product_List_By_Category_Geo')
productList = (List) categoryGeoProductCache.get(cacheKeyName)
</script>
<if condition="productList != null"><return/></if>
<service-call name="sang.moqui.extend.BasicServices.get#ChildGeoIds" in-map="[ geoId: geoId, level: 20 ]" out-map="context"/>
<set field="geoIds" from="geoIds + [geoId]"/>
<service-call name="sang.product.CategoryServices.get#ChildProductCategoryIds" out-map="context"
in-map="[ productCategoryId: productCategoryId, level: level ]"/> <set field="paginateMap" from="[pageIndex: pageIndex, pageSize: pageSize, pageNoLimit: pageNoLimit, orderByField: orderByField]"/>
<entity-find entity-name="sang.product.ProductAndCategoryAndGeo" list="pList" distinct="true" cache="true">
<search-form-inputs input-fields-map="paginateMap"/>
<date-filter/>
<econdition field-name="statusId" value="ProductOnShelf"/>
<econdition field-name="geoId" operator="in" from="geoIds"/>
<econdition field-name="productCategoryId" operator="in" from="productCategoryIds"/>
<select-field field-name="productId"/>
</entity-find> <service-call name="sang.product.ProductServices.get#ProductsByIds" in-map="[productIds: pList.productId]" out-map="context"/>
<service-call name="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>
<?xml version="1.0" encoding="UTF-8" ?>
<moqui-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/moqui-conf-2.0.xsd"> <cache-list warm-on-start="false">
<cache name="Product_List_By_Category_Geo" expire-time-live="60" value-type="List"/>
</cache-list>
<webapp-list>
<webapp name="webroot" https-enabled="false" require-session-token="false">
<after-login><actions>
</actions></after-login>
</webapp>
</webapp-list>
</moqui-conf>
工作框架各种使用整理---使用Cache的更多相关文章
- 工作框架各种使用整理 -- 展示数据列表并做update
<!--ProductCategory.xml--> <?xml version="1.0" encoding="UTF-8"?> &l ...
- myBatis+Spring+SpringMVC框架面试题整理
myBatis+Spring+SpringMVC框架面试题整理(一) 2018年09月06日 13:36:01 新新许愿树 阅读数 14034更多 分类专栏: SSM 版权声明:本文为博主原创文章 ...
- C\C++ 框架和库整理(转)
[本文系外部转贴,原文地址:http://coolshell.info/c/c++/2014/12/13/c-open-project.htm]留作存档 下次造轮子前先看看现有的轮子吧 值得学习的C语 ...
- 最全各种系统版本的XPosed框架资料下载整理
由于XPosed在不同安卓系统版本中对应的版本不同,给很多新手造成极大困扰,本文作者经过几番努力,给大家整理了各个版本对应的xposed框架版本以及相关资料,并附上相关下载链接,希望对大伙有所帮助. ...
- Java集合框架 面试问题整理
简介 java集合类是java.util 包中的重要内容.java集合框架包含了大量集合接口以及这些接口的实现类和操作他们的算法. java集合框架图 主要提供的数据结构 List 又称有序的Coll ...
- js页面跳转(含框架跳转)整理
js方式的页面跳转1.window.location.href方式 <script language="javascript" type="text/java ...
- 一些站点使用的服务器软件、js 框架大收集 [ 整理中 ]
Chrome 的扩展应用 ChromeSnifferPlus ( 开源中国地址:http://www.oschina.net/p/chromesnifferplus,GitHub 地址:https:/ ...
- Koa 框架常用知识点整理
简介 Koa 就是一种简单好用的 Web 框架.它的特点是优雅.简洁.表达力强.自由度高.本身代码只有1000多行,所有功能都通过插件实现. 学前准备 检查Nodejs版本 打开cmd命令行窗口nod ...
- Java集合框架相关知识整理
1.常见的集合有哪些? Collection接口和Map接口是所有集合框架的父接口 Collection接口的子接口包括:Set接口和List接口 Map接口的实现类主要有:HashMap ...
随机推荐
- Linux 下从头再走 GTK+-3.0 (一)
原本由于项目需求在 Linux 下学习过一段时间的 GTK+2.0 图形开发,时隔一段时间,想真正深入学习一下 GTK . 这次直接从头学习 GTK+-3.0 ,并写下博文便于日后查看,也方便新手入门 ...
- Linux软件安装-yum安装
虽然RPM包安装软件很方便.快捷,但是还是需要现有安装包才能安装.为了更为方便的安装软件,发展出了利用网络自动安装的方式--yum安装. 使用yum安装的前提是机器可以上网. 1.配置yum源 在/e ...
- mysql 将列值转变为列的方法(转)
转自http://www.jb51.net/article/36497.htm -- 创建库CREATE TABLE `rate` ( `uname` VARCHAR (300), `object` ...
- AWS国际版的Route 53和CloudFront
注册AWS国际版账号后,却发现Route 53和CloudFront功能是无法使用的.于是提交了一个Service Request,得到的答复是这两个功能需要验证后才能激活. 在控制台中点击进入Rou ...
- hdu5269 Chip Factory
地址:http://acm.split.hdu.edu.cn/showproblem.php?pid=5536 题目: Chip Factory Time Limit: 18000/9000 MS ( ...
- Appium学习实践(三)测试用例脚本以及测试报告输出
之前Appium学习实践(二)Python简单脚本以及元素的属性设置中的脚本,会有一个问题,就是在每个测试用例完成之后都会执行tearDown,然后重新setUp,这样导致脚本的执行效率偏低,而且会有 ...
- POJ1742 Coins[多重背包可行性]
Coins Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 34814 Accepted: 11828 Descripti ...
- mysql中char与varchar的区别分析
char 固定长度,所以在处理速度上要比varchar快速很多,但是对费存储空间,所以对存储不大,但在速度上有要求的可以使用char类型,反之可以用varchar类型来实例 建意: myisam 存储 ...
- 在JAVA中ArrayList如何保证线程安全
[b]保证线程安全的三种方法:[/b]不要跨线程访问共享变量使共享变量是final类型的将共享变量的操作加上同步一开始就将类设计成线程安全的, 比在后期重新修复它,更容易.编写多线程程序, 首先保证它 ...
- jmeter 中的 HTTP URL Re-writing Modifier
URL rewriting modifier,因为tomcat的session实现不是通过cookie的,而是通过session id的,就是说,用户登录有了session之后,tomcat就会维护一 ...