- 浏览: 959269 次
- 性别:
- 来自: 江西上饶
文章分类
- 全部博客 (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 1205GONL<s:property value=" ... -
整站国际化方案
2012-11-28 17:46 1111当前常见的实现方式,主要由两种方案实现 1.通过locale ... -
form Display元素
2011-09-15 14:46 1338对于display元素,在代码 MacroFormRender ... -
tomcat中运行ofbiz
2011-09-07 17:09 1123http://blog.csdn.net/kongqz/art ... -
string-map-prefix string-list-suffix
2011-08-31 00:54 1663一般service都是用在event ... -
ofbiz文档
2011-08-29 18:07 1197http://ofbiz.apache.org/docs/ -
关于ofbiz-component.xml文件中的resource-loader
2011-08-28 19:44 1328寻找文件的方式最后是通过ComponentConfig.jav ... -
ofbiz中几个占位符
2011-08-28 19:04 1099OFBiz认为一些键名为反馈消息的占位符。 进入Screen ... -
ofbiz中各类安全代码解析
2011-08-28 18:49 1765security.hasPermission方法 publi ... -
OFBizCMS
2011-08-28 17:01 1335OFBizCMS是基于OFBiz框架的CMS系统,集合了邮件, ... -
UserLogin Party Person PartyGroup四个model关系
2011-08-27 00:05 1932只需从userloginmodel入手 其model定义是 & ... -
通过jdbc sql调用,并将结果转化成GenericValue
2011-08-26 23:48 18841.查看GenericDelegator的代码,发现代码最后是 ... -
EntityUtil
2011-08-26 23:13 1247排序,通常有的时候我们不希望通过order by来排序查询。而 ... -
关于实体过期快捷方式
2011-08-26 22:40 1293在java代码中查询实体未过期的快捷方式是 EntityCon ... -
ofbiz各类问题
2011-08-26 10:58 11501.eclipse下面运行出现 Exception in th ... -
controlservlet
2011-08-24 22:19 1775control servlet 需要为他在web.xml中指定 ... -
MultiForm表单后台处理方式
2011-08-24 15:06 1759首先确定下的是MultiForm的表单命名是FieldName ... -
event java
2011-08-24 12:32 1081controller.xml <handler nam ... -
scree 中的几个内置对象
2011-08-24 12:27 1225· screens是一个org.ofbiz.widget. ... -
ofbiz处理流程
2011-08-23 18:36 1323关于control servlet和请求处理,在OFBiz中有 ...
相关推荐
(Screen Shot) * Menu Usage Tracking (Just like MS Office®) (Screen Shot) * Comprehensive MRU support * Menu Animation * Full Control Over Bar Caption Orientation * Action List ...
Quick set up, color option, curor change, good for beginners, small projects <END><br>30 , OpacityForm.zip Opacity Form Effect<END><br>31 , MoveForm.zip Moves a form around the screen just by ...
<menuitem action="odoo_action_amos_sale_views" id="menu_amos_sale_views" sequence="0"/> ``` 从以上内容中,我们可以看到如何通过XML来创建和修改ODOO10的菜单和界面,以及如何为菜单项命名、定义序列和...
<form action="/submit" method="post"> 姓名: 邮箱: 提交"> </form> ``` #### 4. 多媒体元素应用 - **音频与视频**:使用`<audio>`和`<video>`标签嵌入音频和视频文件。 - **Flash**:虽然...
7. **表单输入(Form Inputs)**:用于收集用户数据,如文本框、选择器、开关等。 8. **悬浮操作按钮(Floating Action Button, FAB)**:通常用于添加或创建新项目,位于屏幕右下角,易于触达。 9. **提示与...
Chapter 5, Lists, Cards, and Data, is where we see how the recycler view can be used to organize data in the form of a list, and how separate elds of mixed media can be applied to the card view widget...
Check Form 利用Check Form您可以真正检查表单填写的正确性,并且可以自定义报错信息! Animate Images 它可以使用JPG的格式也可以用动态的形式表现出来,并且您可以定义触发动作,获得最大的主动! Add Favourite...
* New splash screen and association icons * Improved installer * Many bug fixes Version 4.9.8.7 * Added support for GCC > 3.2 * Debug variables are now resent during next debug session * Watched ...
这些词汇是计算机专业人士在阅读技术文档、编程、系统管理等场合中不可或缺的语言元素。词汇表中包含动词、名词、形容词和介词等,涵盖了计算机科学的各个方面。以下是一些精选的词汇及其含义和在计算机专业中的应用...
on the menu bar. Nov. 4, 1995, v. 1.10: =========================================================================== New Features: + Previously undocumented logical functions can be used in ...
<END><br>78,ShutDnCtl.zip This has been tested on Windows 9x, me, NT and 2000 operating systems.The actual shutdown process will perform the type of action selected by the user. <END><br>79,Reboot...