Ofbiz研究第二天:一些总体认识

这个第一天和第二天隔得时间可长啊,中间也有一些事情耽误了!

对ofbiz的研究仍然没有松懈,继上一次对一些简单的helloworld分析,也能自己做一些简单的,但对于一个完整的模块,这次可能比较清楚一些~

主要认识了一些目录的作用:
build:编译使用的文件夹
data:演示数据
entitydef:实体定义
servicedef:服务定义
src:源代码
webapp:网站部署程序
wedget:screen定义

不知道以上可对啊,呵呵~

目前的侧重点在页面显示上,即Freemarker的使用:

初步理解:将一个页面分解为若干个模板(ftl文件),然后通过screen去拼接各个ftl。比如一个页面分为页眉页脚和内容,这是三个ftl文件,然后可以用screen去拼接,可以保证每个页面的页眉和页脚都是一样的。

看一下代码:

<screen name="CommonDecorator">
<section>
<actions>
<!-- base/top/specific map first, then more common map added for shared labels -->
<property-map resource="EcommerceUiLabels" map-name="uiLabelMap" global="true"/> <!-- many checkout pages use these -->
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>

<set field="layoutSettings.styleSheets[+0]" value="/images/maincss.css" global="true"/>
</actions>
<widgets>
<platform-specific>
<html><html-template location="component://hello/webapp/hello/includes/header.ftl"/></html>
</platform-specific>
<decorator-section-include name="body"/>
<platform-specific>
<html><html-template location="component://hello/webapp/hello/includes/footer.ftl"/></html>
</platform-specific>
</widgets>
</section>
</screen>

中间的body就是替代的内容部分,看如下:

<screen name="main">
<section>
<widgets>
<decorator-screen name="CommonDecorator">
<decorator-section name="body">
<platform-specific>
<html><html-template location="component://hello/webapp/hello/main.ftl"/></html>
</platform-specific>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>

我想这就是screen的基本意思吧,也许有错误,以后再来修正...


Freemarker也是挺好玩的,其实我现在只是觉得它就是一个具有其他功能的html页面,Freemarker的编辑也是相当麻烦,没有很好用的编辑器,全靠代码,在这里有联想起一个美工的基本能力,html,css,javascript等,而不是全权依赖与图形化设计器,在这里我想了一个不是很完美的解决办法,至少写代码可以简单一些:
[b]hudson.freemarker_ide_0.9.14
tk.eclipse.plugin.htmleditor_2.0.6.1[/b]
懂的人自然明白...

Freemarker的编码问题一直不好解决,一般是用utf-8的,但是输出到页面就是乱码了,不是说它不能支持,只是我还没有找到这个问题的解决方案~

切入Freemarker,继续研究...
下个目标:“[b]<#[/b]”这样的东西啦!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值