工作框架各种使用整理---使用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下使用Apache+php实现留言板功能的网站
一.首先我们的linux服务器上要安装Apache和php 请参考:http://www.cnblogs.com/dagege/p/5949620.html 二.关闭防火墙服务,关闭selinux 请 ...
- CentOS6.5搭建LNMP
1:查看环境: ? 1 2 [root@10-4-14-168 html]# cat /etc/redhat-release CentOS release 6.5 (Final) 2:关掉防火墙 ...
- MAC OSX通过Terminal命令行控制蓝牙状态开关
defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0 #关闭蓝牙服务 default ...
- maven项目下jsp文件中el表达式失效问题
本来是为了写个springmvc的小demo,雏形搭建起来后想起来做成maven的好了,就重新建的maven项目,坑就从这里开始了... maven创建web项目默认使用的是web 2.3版本,web ...
- git错误:Target branch can't be blank
一.问题描述 遇到一个问题:Target branch can't be blank 因为问题再没有重现,所以拿一张网上的图: 情况是,比如a是项目的owner,有一个项目a/Project. b从a ...
- [Top-Down Approach]My First C/S Program [Python]
These days I was learning from Computer Networking --A Top-Down Approach by Kurose Ross. I modified ...
- NOIP2002矩形覆盖[几何DFS]
题目描述 在平面上有 n 个点(n <= 50),每个点用一对整数坐标表示.例如:当 n=4 时,4个点的坐标分另为:p1(1,1),p2(2,2),p3(3,6),P4(0,7),见图一. 这 ...
- bzoj1787 [Ahoi2008]Meet 紧急集合
1787: [Ahoi2008]Meet 紧急集合 Time Limit: 20 Sec Memory Limit: 162 MB Submit: 2272 Solved: 1029 [Submi ...
- jQuery $.each用法
以下内容非原创,来自百度文库http://wenku.baidu.com/view/4796b6145f0e7cd18425368e.html 好文要顶 关注我 收藏该文 mabel_on_lin ...
- 获取assemblies信息in .net core
using System; using System.Linq; using System.Reflection; using System.Runtime.Loader; using Microso ...