首页
随机
最近更改
特殊页面
社群首页
参数设置
关于WHY42
免责声明
WHY42
搜索
用户菜单
登录
欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。
查看“︁Ofbiz:创建一个组件”︁的源代码
←
Ofbiz:创建一个组件
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
=创建组件= 已经ant load-demo并能跑起来之后,可以尝试创建一个新的应用。 <source lang="bash"> ant create-component </source> 可能是下面这样的输出:都输入hello好了: <pre> 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 </pre> 创建完了,刷新下eclipse,可以在hot-deploy中看到刚才创建的组件。然后,加点什么信息吧,好像这样就是我们做的了。找到hello/widget/helloScreens.xml,在body的部分中间加入点信息吧: <source lang="xml"> <decorator-section name="body"> <label text="hello riguz!"/> </decorator-section> </source> OK,启动ofbiz,登录我们创建的组件: *https://127.0.0.1:8443/hello [[Image:Ofbiz-hello-error.png|400px|left|thumb]] 呀,提示登录?登录不进去?别急,继续看。 =权限配置= 刚才创建组件的时候,我们设置了权限为HELLO,然后可以看到ofbiz-component.xml中有这样的信息: <source lang="xml"> <webapp name="hello" title="hello" server="default-server" location="webapp/hello" base-permission="OFBTOOLS,HELLO" mount-point="/hello"/> </source> 以及CommonScreens.xml中有: <source lang="xml"> <condition> <if-has-permission permission="HELLO" action="_VIEW"/> </condition> </source> 这样其实我们定义了一个新的权限HELLO。可以删掉这个试试。在菜单中找到团体->安全,然后找到admin用户所属的安全组(查找用户登录->选择admin->选择安全组->选择FULLADMIN),然后看看这个安全组的权限,添加一个HELLO_VIEW的权限: [[Image:Ofbiz-hello-addPermission.png]] 然后再访问就好了: [[Image:Ofbiz-hello-ok.png]] [[Category:Programe]]
返回
Ofbiz:创建一个组件
。