- 浏览: 946471 次
- 性别:
- 来自: 江西上饶
文章分类
- 全部博客 (460)
- p.spring (56)
- p.maven (20)
- p.ant (17)
- p.jee (18)
- p.jse (33)
- p.ofbiz (31)
- p.软件工程 (8)
- p.struts2 (5)
- p.hibernate (5)
- linux (25)
- 设计模式 (2)
- p.javascript (11)
- 硬件 (1)
- p.jsp (2)
- p.windows批处理 (1)
- 操作系统问题 (5)
- 算法 (1)
- p.mysql (7)
- p.sql (5)
- p.c (1)
- google产品 (0)
- 内存 (1)
- p.struts (1)
- p.freemarker (7)
- p.css (4)
- p.log4j (10)
- p.html (3)
- 淘宝产品 (0)
- 其他 (3)
- 编译器 (0)
- svn (4)
- p.spring.security (11)
- 图形 (0)
- p.xml (1)
- p.ssh (0)
- p.jquery (4)
- p.jdbc (3)
- p.flex (0)
- p.c++ (0)
- p.c#Net (0)
- p.assembly (0)
- p.sqlserver (0)
- p.其他 (3)
- p.webwork (21)
- p.wap (12)
- p.cglib (1)
- p.jee服务器 (11)
- windows (2)
- p.iphone (1)
- p.java.分布式与集群 (2)
- p.ibatis (16)
- p.eclipse (5)
- 架构 (2)
- http协议 (5)
- 我的个人标准 (2)
- 多线程 (1)
- 奇怪问题 (5)
- p.jira (13)
- p.httpclient (1)
- 服务器.apache (11)
- 安全防范 (1)
- p.PODAM (1)
- p.junit (16)
- fop (2)
- 硬盘安装 (1)
- powerdesigner (0)
- 单元测试 (1)
- apache commons (4)
- tomcat+apache集群 (10)
- 各类诡辩 (1)
- 安卓 (8)
- qvod (1)
- java编程基础知识考试考点及答案 (0)
- 工作总结 (4)
- oracle (0)
- spring的util工具 (3)
- json (2)
- maven (3)
- jms (19)
- p.bat (3)
- hadoop (2)
- git (3)
- nginx (1)
- p.移动开发 (1)
- shiro (3)
- 游戏破解 (1)
- react-native (7)
- ios开发 (1)
- webmagic (6)
- socks5 (1)
最新评论
-
weituotian:
说的不好,没人看的
公司系统中的菜单功能和权限功能 -
石不易:
非常详细的注解~
绑定端口和IP,Listen 与VirtualHost指令 -
spring_springmvc:
spring mvc demo教程源代码下载,地址:http: ...
spring mvc -
liyixing1:
PandaDONG 写道谢谢你啊,我已经下下来了,只是还有很多 ...
jira war安装 -
liyixing1:
PandaDONG 写道谢谢你啊,我已经下下来了,只是还有很多 ...
jira war安装
以screen为例
其他类似
screen的action内容是由
ModelScreenAction负责处理的。
其他类似的还有
ModelFormAction
ModelMenuAction
ModelTreeAction
其方法
是读取每个子元素,并初始化处理方式的。
先看
property-map的处理是由 actions.add(new PropertyMap(modelScreen, actionElement));
PropertyMap负责处理的。
public static List<ModelScreenAction> readSubActions(ModelScreen modelScreen, Element parentElement) {
List<ModelScreenAction> actions = FastList.newInstance();
List<? extends Element> actionElementList = UtilXml.childElementList(parentElement);
for (Element actionElement: actionElementList) {
if ("set".equals(actionElement.getNodeName())) {
actions.add(new SetField(modelScreen, actionElement));
} else if ("property-map".equals(actionElement.getNodeName())) {
actions.add(new PropertyMap(modelScreen, actionElement));
} else if ("property-to-field".equals(actionElement.getNodeName())) {
actions.add(new PropertyToField(modelScreen, actionElement));
} else if ("script".equals(actionElement.getNodeName())) {
actions.add(new Script(modelScreen, actionElement));
} else if ("service".equals(actionElement.getNodeName())) {
actions.add(new Service(modelScreen, actionElement));
} else if ("entity-one".equals(actionElement.getNodeName())) {
actions.add(new EntityOne(modelScreen, actionElement));
} else if ("entity-and".equals(actionElement.getNodeName())) {
actions.add(new EntityAnd(modelScreen, actionElement));
} else if ("entity-condition".equals(actionElement.getNodeName())) {
actions.add(new EntityCondition(modelScreen, actionElement));
} else if ("get-related-one".equals(actionElement.getNodeName())) {
actions.add(new GetRelatedOne(modelScreen, actionElement));
} else if ("get-related".equals(actionElement.getNodeName())) {
actions.add(new GetRelated(modelScreen, actionElement));
} else {
throw new IllegalArgumentException("Action element not supported with name: " + actionElement.getNodeName());
}
}
return actions;
}
PropertyMap 是ModelScreenAction的子类,它的实现如下
@Override
public void runAction(Map<String, Object> context) {
String globalStr = this.globalExdr.expandString(context);
// default to false
boolean global = "true".equals(globalStr);
Locale locale = (Locale) context.get("locale");
String resource = this.resourceExdr.expandString(context, locale);
ResourceBundleMapWrapper existingPropMap = this.mapNameAcsr.get(context);
if (existingPropMap == null) {
this.mapNameAcsr.put(context, UtilProperties.getResourceBundleMap(resource, locale, context));
} else {
try {
existingPropMap.addBottomResourceBundle(resource);
} catch (IllegalArgumentException e) {
// log the error, but don't let it kill everything just for a typo or bad char in an l10n file
Debug.logError(e, "Error adding resource bundle [" + resource + "]: " + e.toString(), module);
}
}
if (global) {
Map<String, Object> globalCtx = UtilGenerics.checkMap(context.get("globalContext"));
if (globalCtx != null) {
ResourceBundleMapWrapper globalExistingPropMap = this.mapNameAcsr.get(globalCtx);
if (globalExistingPropMap == null) {
this.mapNameAcsr.put(globalCtx, UtilProperties.getResourceBundleMap(resource, locale, context));
} else {
// is it the same object? if not add it in here too...
if (existingPropMap != globalExistingPropMap) {
try {
globalExistingPropMap.addBottomResourceBundle(resource);
} catch (IllegalArgumentException e) {
// log the error, but don't let it kill everything just for a typo or bad char in an l10n file
Debug.logError(e, "Error adding resource bundle [" + resource + "]: " + e.toString(), module);
}
}
}
}
}
}
}
这里顺带提下
最后会调用UtilProperties的resolvePropertiesUrl方法来生成实际的资源名字。
这个方法有代码
url = FlexibleLocation.resolveLocation(resourceName + ".properties");
if (url != null) {
return url;
}
// Check for Java XML properties file
url = FlexibleLocation.resolveLocation(resourceName + ".xml");
if (url != null) {
return url;
}
可见ofbiz10.4是先查询properties文件是否存在,再检查xml文件是否存在。
其他类似
screen的action内容是由
ModelScreenAction负责处理的。
其他类似的还有
ModelFormAction
ModelMenuAction
ModelTreeAction
其方法
是读取每个子元素,并初始化处理方式的。
先看
property-map的处理是由 actions.add(new PropertyMap(modelScreen, actionElement));
PropertyMap负责处理的。
public static List<ModelScreenAction> readSubActions(ModelScreen modelScreen, Element parentElement) {
List<ModelScreenAction> actions = FastList.newInstance();
List<? extends Element> actionElementList = UtilXml.childElementList(parentElement);
for (Element actionElement: actionElementList) {
if ("set".equals(actionElement.getNodeName())) {
actions.add(new SetField(modelScreen, actionElement));
} else if ("property-map".equals(actionElement.getNodeName())) {
actions.add(new PropertyMap(modelScreen, actionElement));
} else if ("property-to-field".equals(actionElement.getNodeName())) {
actions.add(new PropertyToField(modelScreen, actionElement));
} else if ("script".equals(actionElement.getNodeName())) {
actions.add(new Script(modelScreen, actionElement));
} else if ("service".equals(actionElement.getNodeName())) {
actions.add(new Service(modelScreen, actionElement));
} else if ("entity-one".equals(actionElement.getNodeName())) {
actions.add(new EntityOne(modelScreen, actionElement));
} else if ("entity-and".equals(actionElement.getNodeName())) {
actions.add(new EntityAnd(modelScreen, actionElement));
} else if ("entity-condition".equals(actionElement.getNodeName())) {
actions.add(new EntityCondition(modelScreen, actionElement));
} else if ("get-related-one".equals(actionElement.getNodeName())) {
actions.add(new GetRelatedOne(modelScreen, actionElement));
} else if ("get-related".equals(actionElement.getNodeName())) {
actions.add(new GetRelated(modelScreen, actionElement));
} else {
throw new IllegalArgumentException("Action element not supported with name: " + actionElement.getNodeName());
}
}
return actions;
}
PropertyMap 是ModelScreenAction的子类,它的实现如下
@Override
public void runAction(Map<String, Object> context) {
String globalStr = this.globalExdr.expandString(context);
// default to false
boolean global = "true".equals(globalStr);
Locale locale = (Locale) context.get("locale");
String resource = this.resourceExdr.expandString(context, locale);
ResourceBundleMapWrapper existingPropMap = this.mapNameAcsr.get(context);
if (existingPropMap == null) {
this.mapNameAcsr.put(context, UtilProperties.getResourceBundleMap(resource, locale, context));
} else {
try {
existingPropMap.addBottomResourceBundle(resource);
} catch (IllegalArgumentException e) {
// log the error, but don't let it kill everything just for a typo or bad char in an l10n file
Debug.logError(e, "Error adding resource bundle [" + resource + "]: " + e.toString(), module);
}
}
if (global) {
Map<String, Object> globalCtx = UtilGenerics.checkMap(context.get("globalContext"));
if (globalCtx != null) {
ResourceBundleMapWrapper globalExistingPropMap = this.mapNameAcsr.get(globalCtx);
if (globalExistingPropMap == null) {
this.mapNameAcsr.put(globalCtx, UtilProperties.getResourceBundleMap(resource, locale, context));
} else {
// is it the same object? if not add it in here too...
if (existingPropMap != globalExistingPropMap) {
try {
globalExistingPropMap.addBottomResourceBundle(resource);
} catch (IllegalArgumentException e) {
// log the error, but don't let it kill everything just for a typo or bad char in an l10n file
Debug.logError(e, "Error adding resource bundle [" + resource + "]: " + e.toString(), module);
}
}
}
}
}
}
}
这里顺带提下
最后会调用UtilProperties的resolvePropertiesUrl方法来生成实际的资源名字。
这个方法有代码
url = FlexibleLocation.resolveLocation(resourceName + ".properties");
if (url != null) {
return url;
}
// Check for Java XML properties file
url = FlexibleLocation.resolveLocation(resourceName + ".xml");
if (url != null) {
return url;
}
可见ofbiz10.4是先查询properties文件是否存在,再检查xml文件是否存在。
发表评论
-
EL表达式,ognl表达式对集合过滤和投影
2013-11-23 11:48 1177GONL<s:property value=" ... -
整站国际化方案
2012-11-28 17:46 1088当前常见的实现方式,主要由两种方案实现 1.通过locale ... -
form Display元素
2011-09-15 14:46 1312对于display元素,在代码 MacroFormRender ... -
tomcat中运行ofbiz
2011-09-07 17:09 1104http://blog.csdn.net/kongqz/art ... -
string-map-prefix string-list-suffix
2011-08-31 00:54 1637一般service都是用在event ... -
ofbiz文档
2011-08-29 18:07 1176http://ofbiz.apache.org/docs/ -
关于ofbiz-component.xml文件中的resource-loader
2011-08-28 19:44 1310寻找文件的方式最后是通过ComponentConfig.jav ... -
ofbiz中几个占位符
2011-08-28 19:04 1072OFBiz认为一些键名为反馈消息的占位符。 进入Screen ... -
ofbiz中各类安全代码解析
2011-08-28 18:49 1739security.hasPermission方法 publi ... -
OFBizCMS
2011-08-28 17:01 1314OFBizCMS是基于OFBiz框架的CMS系统,集合了邮件, ... -
UserLogin Party Person PartyGroup四个model关系
2011-08-27 00:05 1902只需从userloginmodel入手 其model定义是 & ... -
通过jdbc sql调用,并将结果转化成GenericValue
2011-08-26 23:48 18651.查看GenericDelegator的代码,发现代码最后是 ... -
EntityUtil
2011-08-26 23:13 1223排序,通常有的时候我们不希望通过order by来排序查询。而 ... -
关于实体过期快捷方式
2011-08-26 22:40 1267在java代码中查询实体未过期的快捷方式是 EntityCon ... -
ofbiz各类问题
2011-08-26 10:58 11251.eclipse下面运行出现 Exception in th ... -
controlservlet
2011-08-24 22:19 1749control servlet 需要为他在web.xml中指定 ... -
MultiForm表单后台处理方式
2011-08-24 15:06 1729首先确定下的是MultiForm的表单命名是FieldName ... -
event java
2011-08-24 12:32 1052controller.xml <handler nam ... -
scree 中的几个内置对象
2011-08-24 12:27 1198· screens是一个org.ofbiz.widget. ... -
ofbiz处理流程
2011-08-23 18:36 1296关于control servlet和请求处理,在OFBiz中有 ...
相关推荐
FormScreen.rarFormScreen.rarFormScreen.rar
usd screen usd screen usd screen usd screenusd screen usd screen usd screen usd screenusd screen usd screen usd screen usd screen
Splash Screen with an animated ROUND FORM.
1.QNX screen系统是一个...2.其中使用screen_create_context、screen_create_window、screen_read_display和screen_post_window等基本screen接口,对接口的理解很有帮助。 3.需根据代码,自行适配编译以及运行环境。
sap abap selection screen 与 dialog screen的区别
Moves a form around the screen just by dragging it.
Screen
QNX操作系统的Screen开发帮助文档,包含OpenGL,EGL等的操作
I developed this screen cam component with delphi (captures the activity on a screen or delphi form and writes it into an AVI file; it supports all compressors; the program contains code derived from ...
Easy Main Menu is your one stop solution for all the things you want to have in a menu : - Start Game * New Game * Save/Load Game - Options * Game Options * Graphics Options * Control ...
screen
全屏菜单
Greenshot screen shot toolGreenshot screen shot toolGreenshot screen shot tool
Tantra launcher screenform source
Android12 SplashScreen使用举例代码下载,运行效果 与 相关API使用介绍请参考博文: Android12适配指南——SplashScreen: https://xiaxl.blog.csdn.net/article/details/123522277 Android 12(API 31)引入了 ...
C#实现SplashScreen,不同于VB.NET,需要在MAIN中控制加载界面的顺序。
screen下载、linux后台运行程序非常实用、后台任务、screen linux redhat 、CentOs系统screen下载、linux后台运行程序、screen linux redhat 、CentOs系统screen下载、linux后台运行程序、screen linux redhat 、...
screen 多终端软件,操作服务器神器screen centos7 rpm
Quick Screen Recorder v1.5 注册机