Ofbiz:创建一个组件
创建组件
已经ant load-demo并能跑起来之后,可以尝试创建一个新的应用。
ant create-component
可能是下面这样的输出:都输入hello好了:
Buildfile: /Users/UserName/sandbox/ofbiz1307/build.xml create-component: [input] Component name: (e.g. mycomponent) [Mandatory] hello [input] Component resource name: (e.g. MyComponent) [Mandatory] hello [input] Webapp name: (e.g. mycomponent) [Mandatory] hello [input] Base permission: (e.g. MYCOMPONENT) [Mandatory] HELLO [echo] The following hot-deploy component will be created: [echo] Name: hello [echo] Resource Name: hello [echo] Webapp Name: hello [echo] Base permission: HELLO [echo] Folder: /Users/UserName/sandbox/ofbiz1307/hot-deploy/ofbizdemo [echo] [input] Confirm: (Y, [N], y, n) y
创建完了,刷新下eclipse,可以在hot-deploy中看到刚才创建的组件。然后,加点什么信息吧,好像这样就是我们做的了。找到hello/widget/helloScreens.xml,在body的部分中间加入点信息吧:
<decorator-section name="body">
<label text="hello riguz!"/>
</decorator-section>
OK,启动ofbiz,登录我们创建的组件:
呀,提示登录?登录不进去?别急,继续看。