...
Anchor | ||||
---|---|---|---|---|
|
How to Extend an
...
Existing Component
Scenario: For any customized application under hot-deploy if it is needed to extend the existing component then changes in following files are required.(For instance You can extend any of the existing applications via a custom component in the hot-deploy directory. In the following example we are extending the Marketing component via our custom component called mycomponent.)
First we need to create a new WEB-INF folder inside your custom component's webapp directory ($OFBIZ_HOME/hot-deploy/mycomponent/webapp). To create
Inside webapp of your customize application create the followingfolders for the component you want to extend,
using it's component name. (marketing/WEB-INF)use the name of the component you want to extend: ( OFBIZ_HOME is the location of the root directory of OFBiz)
Code Block language bash $ cd $OFBIZ_HOME/hot-deploy/mycomponent/webapp $ mkdir -p marketing/WEB-INF
You should have the a new WEB-INF directory: $OFBIZ_HOME/hot-deploy/mycomponent/webapp/marketing/WEB-INF
Create an empty controller.xml file in this new WEB-INF folder:
Code Block language bash $ touch $OFBIZ_HOME/hot-deploy/mycomponent/webapp/marketing/WEB-INF/controller.xml
In
controller.xml file include the <includethis new controller.xml file include the controller.xml file from the marketing component:
Code Block language xml <?xml version="1.0" encoding="UTF-8"?> <site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd"> <include location="component://marketing/webapp/marketing/WEB-INF/controller.xml"/> </site-conf>
Copy the marketing component's web.xml from the
component you want to extends WEB-INF folder into thismarketing component's WEB-INF directory ($OFBIZ_HOME/applications/marketing/webapp/marketing/WEB-INF) into the new WEB-INF folder:
Code Block language bash $ cp $OFBIZ_HOME/applications/marketing/webapp/marketing/WEB-INF/web.xml $OFBIZ_HOME/hot-deploy/mycomponent/webapp/marketing/WEB-INF/
In you custom component's ofbiz-component.xml ($OFBIZ_HOME/hot-deploy/customize_projectmycomponent/) add following code:
Code Block language xml title extending marketing component here <webapp name="marketing" title="Marketing-Customized" server="default-server" location="webapp/marketing" base-permission="OFBTOOLS,MARKETING" mount-point="/marketing"/>
The basic setup for extend extending the component is completed. You can add your custom component specific request and view in controller.xml. You can add other items such as SECAs in secas.xml and have them triggered on services in the component you want to extend. You can also create screens in the extended component.Note : Please add if some of the information is missing here.
Anchor | ||||
---|---|---|---|---|
|
...