Creating publication items using the Oracle Lite API

If you have been doing Oracle Lite development, chances are you have been either using the Packaging Wizard or the Mobile Workbench to create your applications. In some cases, you have had to use the APIs to do partition mapping or altering the publication items (I will show those in another post). I on the other hand use the APIs. Why do I do this? I started doing this because the new application I was working on was estimated to have 150+ tables. In my previous experience of using the packaging wizard, publishing over a VPN line was time consuming and prone to problems. So, when I started a new project where I knew there would be a lot of tables with a very good probability that the database model would be changing quite frequently, I decided to create my own code using the APIs to manage the repository. That repository today is over 360 tables. I am now able to use that code that I wrote for one application, and use it to maintain other applications as well. It is reusable and reliable. Reliable enough that I can have a 3rd party deploy the application without the use of the Oracle Lite SDK. The only information I need to know is “what tables are changing and what are the details of the change.” That little information requires 2 minutes or less of work from my schedule.

Here is the sample of how to create a publication item and add it to your publication. In the sample, it will also show you how to add a regular index to the publication item.

Nice article, Greg it helped me a lot to get started. One question though: If I start adding pub items through code, will I still be able to open the project and maintain it using the Mobile Workbench? The items would not exist in the .mpj xml project file?

I guess the point of the APIs is to better maintain your code. I only use the Workbench if I am doing something quick and not for production systems. You can mix and match, but I wouldn’t recommend it. I would also have to check if the workbench could import publication items… but I think it is able to.