1,在applications文件夹下新建一个数据模块meetingroom
2, 要让ofbiz加载这个数据模块就需要在applications下的配置文件里修改参数
(1)在applications下有一个component-load.xml模块加载配置文件,加入新建的模块
<load-component component-location="meetingroom"/>
如上图所示:<load-component component-location="meetingroom"/>里定义了要加载的模块。
(2)在applications文件夹下还有一个build.xml配置文件,在这个文件的<filelist />将新建的模块下的build.xml文件加进来
<filelist id="application-builds" dir="." files="content/build.xml,party/build.xml, workeffort/build.xml,product/build.xml,marketing/build.xml, order/build.xml,manufacturing/build.xml, accounting/build.xml, securityext/build.xml, humanres/build.xml meetingroom/build.xml "/> 总结:这样做只是让ofbiz运行时加载meetingroom模块,但是ofbiz并不知道接下来要做什么。
(1)配置meetingroom模块下的ofbiz-componet.xml配置文件
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
//先定义模块名
<ofbiz-component name="meetingroom"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
//
<resource-loader name="main" type="component"/>
// 将配置文件放在指定的路径下
<classpath type="jar" location="build/lib/*"/>
<classpath type="dir" location="config"/>
//entity resource
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_old.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/PartyTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/PartySecurityData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/PartyGeoPointData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/PartyPortletData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/PartyDemoData.xml"/>
<entity-resource type="data" reader-name="seed-initial" loader="main" location="data/ScheduledJobs.xml"/>
//service resource
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<service-resource type="model" loader="main" location="servicedef/services_view.xml"/>
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<service-resource type="mca" loader="main" location="servicedef/mcas.xml"/>
<test-suite loader="main" location="testdef/PartyTests.xml"/>
<test-suite loader="main" location="testdef/PartyContactMechTests.xml"/>
//在导航中显示meetingroom
<webapp name="meetingroom"
title="meetingroom"
server="default-server"
location="webapp/partymgr"
base-permission="OFBTOOLS,PARTYMGR"
mount-point="/partymgr"/>
</ofbiz-component>