工作框架各种使用整理---使用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 接口地址全部清除才清理从此接口发出的下一跳路由
接口地址全部清除才清理从此接口发出的下一跳路由 如: eth7配置两个地址 eth7: 192.168.1.1 10.1.1.1 添加一条路由: route add -net 2.2.2.0/24 g ...
- java报表工具finereport常用函数的用法总结(数组函数)
ADD2ARRAY ADDARRAY(array,insertArray, start):在数组第start个位置插入insertArray中的所有元素,再返回该数组. 示例: ADDARRAY([3 ...
- 从WinCE到Linux
到新的公司已经快两个月了,新的工作主要方向是Linux驱动移植和Android系统定制.由于项目还在立项的阶段,并没有分配具体的工作任务,所以找来一个Linux的开发板先玩一玩.它采用的处理器NUC9 ...
- Apache http Server 2.4 安装与配置
前言 Apache官网从2.2之后,不再提供windows的msi或exe安装版本,现在Apache http Server有两个分支2.2及2.4 注意事项 如果之前有安装2.2的版本,请先卸载 A ...
- ubuntu不能登录图形用户界面,游客身份可登陆,命令行可登陆
ubuntu是13.04版本,我猜其他的版本解决办法大概也一样.当开机进入登陆界面后我们输入密码后并没有进入应该进入的图形用户界面,而是进入一个命令行界面并且一闪而过又回到了登录界面,而已游客的身份却 ...
- sql 盲注之正则表达式攻击
-----------------------------------------MYSQL 5+----------------------------------------- 我们都已经知道,在 ...
- 加载cocos studio场景
今天尝试加载cocos studio的场景. 新版的cocos studio中,"导出"选项变成了"发布".发布之后会生成一个res文件夹,其中每个场景有一个. ...
- 在移动端如何选择字体大小和布局的单位,px或dp?
android开发中,文字大小的单位是sp,非文字的尺寸单位用dp,但是我们在设计稿用的单位是px.这些单位如何换算,是设计师.开发者需要了解的关键. 简单理解的话,px(像素)是我们UI设计师在PS ...
- 【点滴积累,厚积薄发】修改hosts,并刷新dns缓存
Windows系统下hosts位置 C:\Windows\System32\drivers\etc 修改hosts后,要想马上生效,需要运行命令来刷新DNS缓存:ipconfig /flushdns
- hadoop资料收集
大数据时代——为什么用hadoop hadoop应用场景 Hadoop一般用在哪些业务场景? Hadoop虽然强大,但不是万能的