Overview
This page is a work-in-progress to document my progress in separating the ofbiz core from the rest of the applications to allow users to focus on using ofbiz as a standalone development framework.
Why?
Ofbiz is a very productive framework for creating enterprise applications. However, installing ofbiz with all of it's OOTB functionality just to use ofbiz as a development framework is a waste of resources. Also, newcomers to ofbiz may be put off by the complexity of ofbiz OOTB.
Ofbiz
...
10.04
I have chosen to base my instructions on Ofbiz 9.04 and not trunk because 9Ofbiz 10.04 is stable. Learning a new technology is always easier when working in a stable environmentthe current stable release at the time of writing.
Download, install and setup
...
10.04.
If you are unsure how to proceed with this, I recommend reading the ofbiz beginners tutorial
Comment out the following components in $OFBIZ_HOME/applications/component-load.xml
Code Block |
---|
<component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/component-loader.xsd"> <!-- <load-component component-location="commonextparty"/><!-- common component used by most other components >--> <!-- <load-component component-location="partysecurityext"/>--> <!-- <load-component component-location="securityextcontent"/>--> <!-- <load-component component-location="contentworkeffort"/>--> <!-- <load-component component-location="workeffortproduct"/>--> <!-- <load-component component-location="productmanufacturing"/>--> <!-- <load-component component-location="manufacturingaccounting"/>--> <!-- <load-component component-location="accountinghumanres"/>--> <!-- <load-component component-location="humanresorder"/>--> <!-- <load-component component-location="order"/> marketing"/>--> <!-- common component used by most other components last because it uses info from most components--> <!-- <load-component component-location="marketingcommonext"/> --> </component-loader> |
Comment out the following components in $OFBIZ_HOME/specialpurpose/component-load.xml
Code Block |
---|
<component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/component-loader.xsd"> <!-- <load-component component-location="ecommerce"/> --> <!-- <load-component component-location="pos"/>--> <!-- <load-component component-location="hhfacility"/>--> <!-- <load-component component-location="assetmaint"/>--> <!-- <load-component component-location="cmssite"/>--> <!-- <load-component component-location="ofbizwebsite"/> --> <!-- <load-component component-location="projectmgr"/> --> <!-- <load-component component-location="oagis"/>--> <!-- <load-component component-location="googlebase"/> >--> <!-- <load-component component-location="googlecheckout"/>--> <!-- <load-component component-location="ebay"/>--> <!-- <load-component component-location="ebaystore"/>--> <!-- <load-component component-location="myportal"/> --> <!-- <load-component component-location="webpos"/>--> <!-- <load-component component-location="crowd"/>--> <!-- load-component component-location="ldap"/>--> <!-- <load-component component-location="workflow"/> --> <!-- <load-component component-location="shark"/> --> </component-loader> |
...
Code Block |
---|
<component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/component-loader.xsd"> <load-component component-location="geronimo"/> <load-component component-location="sql"/> <load-component component-location="entity"/> <load-component component-location="catalina"/> <!-- <load-component component-location="jetty"/> --> <load-component component-location="security"/> <load-component component-location="datafile"/> <load-component component-location="minilang"/> <load-component component-location="common"/> <load-component component-location="service"/> <load-component component-location="entityext"/> <load-component component-location="bi"/> <load-component component-location="birt"/> <load-component component-location="webapp"/> <load-component component-location="guiapp"/> <load-component component-location="widget"/> <load-component component-location="appserver"/> <load-component component-location="testtools"/> <load-component component-location="webtools"/> <load-component component-location="webslinger"/> <load-component component-location="images"/> <!-- <load-component component-location="example"/>--> <!-- <load-component component-location="exampleext"/>--> </component-loader> |
Comment out themes - see Bugs section below
Comment out theme preferences in $OFBIZ_HOME/themes/bizznesstime/includes/header.ftl
Code Block |
---|
<div id="preferences" style="display:none">
<a href="<@ofbizUrl>ListLocales</@ofbizUrl>" id="language">${uiLabelMap.CommonLanguageTitle} - ${locale.getDisplayName(locale)}</a>
<a href="<@ofbizUrl>ListTimezones</@ofbizUrl>" id="timezone">${nowTimestamp?datetime?string.short} - ${timeZone.getDisplayName(timeZone.useDaylightTime(), Static["java.util.TimeZone"].LONG, locale)}</a>
<!--
<a href="<@ofbizUrl>ListVisualThemes</@ofbizUrl>" id="theme">${uiLabelMap.CommonVisualThemes}</a>
-->
</div>
|
Comment out help link in $OFBIZ_HOME/themes/bizznesstime/includes/header.ftl
Code Block |
---|
<!-- notice the last "false" in the if statement to make the if condition always return false --> <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists && false> <#include "component://common/webcommon/includes/helplink.ftl" /> <span><a href="javascript:lookup_popup2('showHelp?helpTopic=${helpTopic}&portalPageId=${parameters.portalPageId?if_exists}','help' ,500,500);">${uiLabelMap.CommonHelp}</a></span> </#if> |
Load data and run ofbiz
Next run the ant target "run-install" and "create-admin-user-login" to populate the database.
...
At this stage, you don't have a mecanism for adding user logins or for setting user permissions. This functionality will need to be created.
Create a component
(if the application is still running from the previous step, kill it)
Code Block |
---|
./ant create-component
|
E.g.
create-component:
[input] Component name: (e.g. mycomponent)
mycomponent
[input] Component resource name: (e.g.
More to follow...
...
MyComponent)
MyComponent
[input] Webapp name: (e.g. mycomponent)
mycomponent
[input] Base permission: (e.g. MYCOMPONENT)
MYCOMPONENT
[echo] The following hot-deploy component will be created:
[echo] Name: mycomponent
[echo] Resource Name: MyComponent
[echo] Webapp Name: mycomponent
[echo] Base permission: MYCOMPONENT
[echo] Folder: /home/snowch/workspace/ofbiz.tr.framework/hot-deploy/mycomponent
[echo]
[input] Confirm: (Y, [N], y, n)
Y
Grants access for admin user to mycomponent:
Code Block |
---|
./ant run-install-seed
|
run-install-seed loads the security data in /hot-deploy/mycomponent/data/MyComponentSecurityData.xml
navigate to http://localhost:8443/mycomponent/control/main - login as admin/ofbiz
Bugs
OFBIZ-3499 - Help dependency on Content
OFBIZ-3498 - Visual Themes dependency on Party
OFBIZ-3501 - ServerHitBin dependency on Content
...
See also
There is a longer term effort looking at separating the framework, see Framework-only+distribution