OFBiz进阶-OFBiz开发之[ant create-component]创办模块
OFBiz进阶--OFBiz开发之[ant create-component]创建模块
(How to create a new component)
目录的生成方式
1.仿照已有模块, 手工构建目录及相关必须文件和内容.
好处: 可以快速理解文件及目录结构;
坏处: 容易编写错误, 纠错比较困难.
2. 使用 ant 指令生成
此目录在项目中一般是由 ant指令[create-component]创建的, 创建成功将在 OFBIZ_HOME/hot-deploy 目录下生成
创建步骤分析: 执行指令[ant create-component]
Component name: (e.g. mycomponent) [Mandatory]
-- 模块名称, 一般多个单词的全小写(如: mycomponent)
Component resource name: (e.g. MyComponent) [Mandatory]
-- 模块资源名, 一般多个单词按[驼峰式(单词首字母大写)]编写(如: MyComponent)
Webapp name: (e.g. mycomponent) [Mandatory]
-- 建站的站点地址名, 一般多个单词的全小写(如: mycomponent)
Base permission: (e.g. MYCOMPONENT) [Mandatory]
-- 一般多个单词的全大写(如: MYCOMPONENT)
Confirm: N/Y/n/y
-- 确认生成吗? 否/是/否/是, 在确认生成后,
将在 OFBIZ_HOME/hot-deploy 目录下生成所有被模板设定好的模块及文件
至此, 单个模块创建成功,
在 hot-deploy 目录的模块不需要手动配置,
现在 启动/重启 项目,
直接访问 [http://localhost:8080/mycomponent] 即可访问此模块
--这里提到了模块生成的模板: 源文件在 framework/resources/templates 目录下
可根据需要调整: 内部变量(
[@component-name@ 模块名],
[@component-resource-name@ 模块资源名],
[@webapp-name@ 站点地址名],
[@base-permission@ 基本权限名])
==================================关于本文===================================
作者: mf1389004071
Ofbiz超级群(71700661)...上海_香飘飘
博客: http://ofbizer.iteye.com/
邮箱: mf1389004071@163.com
有此标记, 均为原创, 禁止盗用, 转载请注明来源
技术无上限, 能力有上限, 欢迎参与交流讨论和提出建议
本文永久地址: http://ofbizer.iteye.com/blog/2034823