工作框架各种使用整理---使用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 ...
随机推荐
- dos2unix用法
windows下编写的脚本,上传到linux上执行,有时会出现莫名其妙的结果,也是折腾了半天才找出原因,windows和linux有些编码不同,经dos2unix处理后,结果一切正常man dos2u ...
- JAVA插入sql代码
插入数据 import java.sql.*; /** * @version 2012-02-22 * @author */ public class InsertDemo { public stat ...
- 解决android中Layout文件下的xml文件配好后,R类中不能自动生成相应代码
不能更新的原因: 1.在xml文件中代码错误或者格式错误 2.eclipse 编译器是老版本 3.布局文件的文件名有大写字母 4.含有相同文件名.格式的xml文件 解决方法: 1.找到出错的xml文件 ...
- CleanBlog(个人博客+源码)
CleanBlog是一个高端(低调).大气(简洁)的个人博客系统,之前在网上看到了好多个人博客网站,感觉很酷的,自己也想搭建一个,最近 刚学完SSM(Spring/SpringMVC/MyBatis) ...
- IntelliJ IDEA 将 Maven 构建的 Java 项目打包
前言 IntelliJ IDEA 编译生成 Jar 包的方式与 Eclipse 不同,如何将此 Maven 构建 Java 推荐引擎项目生成 Jar 包确实搜索了不少资料,有成功的有失败的,特将此验证 ...
- USACO1.5Superprime Rid[附带关于素数算法时间测试]
题目描述 农民约翰的母牛总是产生最好的肋骨.你能通过农民约翰和美国农业部标记在每根肋骨上的数字认出它们.农民约翰确定他卖给买方的是真正的质数肋骨,是因为从右边开始切下肋骨,每次还剩下的肋骨上的数字都组 ...
- [IPA]IOS In App Purchase(内购)验证
参考我之前的笔记 苹果内购笔记,在客户端向苹果购买成功之后,我们需要进行二次验证. 二次验证 IOS在沙箱环境下购买成功之后,向苹果进行二次验证,确认用户是否购买成功. 当应用向Apple服务器请求购 ...
- git删除远程仓库的文件或目录
git rm -r --cached a/2.txt //删除a目录下的2.txt文件 删除a目录git rm -r --cached a git commit -m "删除a目录下的2 ...
- http协议(六)报文首部
http请求和响应报文内容比较多,会分为大概四部分更新,最近比较忙,没太多时间整理- - 首先来看看报文结构吧 1.http请求报文 http请求报文由方法.URI.http版本.http首部字段等构 ...
- avalon.js路由
之前自己写了一个AJAX加载页面的方法:有时候一个页面里面会分区域加载不同的东西(div,html),但是IE的回退按钮,就失去任何意义了: 这两天研究了一下avalon.js的路由: 需要准备: 1 ...