- Get the source from svn e.g. to get the branch 3.1.0 use the following command
svn co svn://source.pentaho.org/svnkettleroot/Kettle/branches/3.1.0 Kettle3.1.0 - Make sure you have ant, I have 1.7.x installed and in the path
- Load the project as an existing Java project in Eclipse, modify source at your will
- Look at the build.xml file at the top level directory where you checked out the source
e.g. Kettle3.1.0 - Run the default target or if you changed source file in one of the sub packages such as core or ui etc., there are separate targets to build just those lib
Saturday, December 6, 2008
Friday, December 5, 2008
Pentaho PDI - Running multiple SQL statements
But...
I was bitten by this issue and ended up wasting couple of hours trying to debug the cause. The reason... Error is really amgious, if you have multiple "syntactically correct" SQL statements separated by commas and try to execute it with default settings on the Connector/J and MySQL as DB you get
"You have an error in your SQL statement, Check the syntax..." error.
Checked my SQL statements several times and individually in SQL Query browser to make sure they were correct.
There are a couple of things you should note
1. In the debug log you will see an old log saying executing DDL statement when it actually can execute both DDL and DML statements. So you will need to ignore that log
2. Not all the drivers/databases allow running multiple comma separated SQL statements due to SQL Injection attach. Check the driver/db to make sure it allows execution of multiple SQL statements separated by commas in one shot.
For MySQL and Connector/J by default does not allow this, so to enable it you will have to add an option in your Database Connections dialog -> Options tab and add the parameter allowMultiQueries with the value of true.
3. Also make sure that you surround ?'s in your SQL statements with single quotes if you are passing in string values. If you are like me, you tend to think of the statement as your typical prepared statement in JDBC and using JDBC api to set the values so you dont need to worry about wrapping strings with quotes.
Hope that helps.
Friday, March 21, 2008
Using Ofbiz and Wicket - Part I
Both Wicket and Ofbiz are from ASF (Apache Software Foundation) but unfortunately not many ppl seem to have used them together.
Primary reason for me to use them together was complexity and amount of configuration required to use existing Ofbiz frontend frameworks such as screen widget and learning additional technologies such as freemarker, beanshell etc. That lead me to look for a framework which would replace that and provide more - hence Apache Wicket.
Apache Wicket falls into already crowded MVC UI Frameworks consisting of struts, seam amongst others. You can get an entire list from Wicket website :). Yes, it has AJAX support builtin in the framework and yes it has rich set of components both AJAX and otherwise as Wicket extensions and at WicketStuff.org with integration with popular Javascript AJAX libraries DOJO, YUI and JQuery and few others.
Now that we have some background, lets see what you need to get started and use Wicket "inside" Apache Ofbiz.
- Ofbiz comes with embedded Tomcat at the time of writing Ofbiz 4.0 came with Tomcat 5.5.23 and fortunately Wicket can be deployed in any standard web container
- Download wicket binaries from Apache Wicket site, copy them over to your Ofbiz application lib directory where you have your application and other 3rd party jars. I chose to put it under hot-deploy/myapp/webapp/myapp/WEB-INF/lib
- Add WicketFilter entry to your web.xml file (Note: Both WicketFilter and Ofbiz ContextFilter will be listening on /* requests - so initially there will be chaining of those filters, but for this first article I will ignore that) - Make sure to put WicketFilter entry before ContextFilter so WicketFilter gets called first
- Write your first Hello World in Wicket by creating your WebApplication and WebPage classes - access the URL (http://localhost:8080/yourappcontext) and see it in action, where yourappcontext is whatever you configured it to be in your ofbiz-component.xml file
How to resolve channel 1: open failed: administratively prohibited: open failed
channel 1: open failed: administratively prohibited: open failed
But essentially it means the port you are trying to tunnel into on the remote machine cannot be opened
To debug the issue
- If you have access to the remote machine check /var/log/secure to get more information on error
- You could try ssh tunnel in verbose mode with -v option
- Try with a different port number on the remote host just to test - some ports are reserved
- If the error in the secure log was cannot resolve host name - it means you need to restart your network service or interfaces - it could be due to dns server issues
- restart sshd on the remote server - make sure port forwarding is enabled in your ssh config - there are plenty of resources on the net that will explain this
Thursday, March 20, 2008
How to package Wicket jars quickly
If you are not Maven guru and would like to get this done quickly - here is what I tried and it worked. I could not find any documentation that shows exactly these steps so...
Depending on the wicket jar that you want to build - cd to that subdirectory under wicket and use
mvn -Dmaven.test.skip=true compile jar:jar install:install
or any combination of the options above which are self explanatory, but I will explain them anyway, just in case-
compile - compile phase of maven which will compile all
jar:jar - is the jar goal of package phase if you specify the package instead of jar:jar it will also try to generate javadocs which will take forever
install:install - deploy phase goal
Hope that helped - would save atleast 30-45 mins if you didnt know maven
Thursday, March 13, 2008
Main entities and their relationships
- Website -> Store -> Catalog -> Categories
- Store -> Payment, Email, Facilities
- Categories -> Product
You will find most of the convenience methods to extract information out for these entities (for e-commerce) are in *Worker files. e.g. CategoryWorker has all category convenience methods, CatalogWorker for catalog and so on.
Tuesday, March 11, 2008
Not so obvious about Ofbiz Categories and Catalog
PRODUCT_CATEGORY should contain all the categories that you ever need.
PROD_CATALOG_CATEGORY contains a subset of the categories from the above table. Why the subset you ask? ... because PROD_CATALOG_CATEGORY table contains categories which are directly linked to a given catalog. Under normal circumstances, you would need a handful of categories (which are of type identified by the type in PROD_CATALOG_CATEGORY_TYPE). e.g. Browse Root, Quick Add, Search and Promotions and may be Whats new and Most popular. Most categories in the PRODUCT_CATEGORY table should be direct or indirect child of Browse Root category and should be of type CATALOG_CATEGORY. Only a handful of other categories (e.g. Quick Add, Search, Promotions and any other custom ones that you define) are standalone categories.
- Quick Add category is used to group all the products which can be added together in one shot
- All child (immediate or otherwise) categories of Browse Root categories are used for Navigation on ecommerce site (e.g. left nav on the Ofbiz ecommerce demo).
- Promotion category is used to show promotional products
- Search categories are used for product searches.
Refer to Ofbiz ecommerce demo and demo data under ecommerce data/demo*.xml that you installed to see the relationship and how its used/displayed
Monday, March 10, 2008
How to Hot Deploy your application in Ofbiz
hot-deploy in Ofbiz doesnt work out of the box, there are a couple of minor config changes that you need to do before you can use it.
- Copy you Ofbiz application (web application) under hot-deploy directory. Make sure all the directory structure of your ofbiz application is correct.
- Create (or copy from other ofbiz applications) component-load.xml file and add your applications load-component element tag
- In your ofbiz_home/framework/base/config/ofbiz-containers.xml file change the property setting app-contact-reloadable to true e.g. <property name="apps-context-reloadable" value="false"/>
- Restart ofbiz for this change to take effect.
- To test if its working, modify one of the java files of your application and recompile it. You will see messages on your console and/or log file indicating the web app context being reloaded.
Important: I use build.xml in my application to copy my application jar file under my applications ofbiz_home/hot-deploy/myapp/webapp/myapp/WEB-INF/lib directory. I have not tried choosing a different deploy location so not sure if it will work.
Friday, March 7, 2008
Setting up product database and seed data for Ofbiz
Ofbiz Setup Guide
- Make sure the default delegator in framework/entity/config/entityengine.xml is pointing to the correct database
- For production db setup from the ofbiz home run ant run-install-seed , this will install only the seed data which is the bare minimum data required for Ofbiz to come up in the most basic meaningful way and then you can enter your custom data
- Create your business specific data by looking at Demo*.xml files in ecommerce, accounting and other applications that comes with Ofbiz. In order to run and customize e-commerce store, you will need at least Accounting/data/DemoOrgnization e-commerce/data/DemoProduct.xml.
- Pay close attention to the "id" fields in the data file, these are the primary keys for your data. In order to avoid conflicts with existing data choose alpha numeric keys which begin with a string which identifies your company or business.
- Once these data files are created, they can be imported through the WebTools/Import functionality. If the files are successfully imported, you will see message towards teh bottom indicating how many entities were successfully imported. Note: import process is atomic and is part of 1 transaction - so if you have lot of data and if for any reason import fails, none of the data from that import will be saved. So you can import the data in its entirity.
Friday, February 1, 2008
Using ZK with Ofbiz/Opentaps
- Download ZK from zkoss.org, unzip and copy the lib directory and its subdirectories anywhere inside your Ofbiz component. e.g. you could put it under OFBIZ_HOME/applications/yourapp/webapp/yourapp/WEB-INF/lib. ZK directories for 3.0.2 are lib, lib/ext.
- Add classpath entries for these libraries in ofbiz-component.xml
- Add appropriate entries for ZK in web.xml of your component. See (http://www.zkoss.org/doc/quickstart/ch07.html) for details
- Create Hello World zul/zhtml page and put it in your webapp directory
- Change web.xml for your component, if it has ContextFilter entry, add /zkau to the allowed path variable otherwise both javascript and css wont be loaded when you view the page
Disclaimer: All the statements here are to the best of my knowledge, there may be other bigger and better ways to do things so do your own readings and research.
- How to add custom stylesheets to zk pages?There are 3 ways to add stylesheets
2. In ZUL pages only, you can add PI
3. If you want to add site wide stylesheet (theme), you can add it in APPROOT/WEB-INF/zk.xml file containing the following tags
<zk>
<desktop-configgt;
<theme-urigt;/static/css/style.csslt;/theme-urigt;
</desktop-configgt;
</zk>
- How to add meta tags to zk pages
- Included zhml pages at runtime complain about undefined standard entities like nbsp, copyright etc.
To fix this, add
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Friday, January 25, 2008
Ofbiz - Opentaps cheatsheet
|