Contents

Let’s talk about another use case for the Pretius Drawing Plugin. This time, we’ll use it to create a functional train reservation system based on the Oracle APEX low-code platform.

In my article on the Pretius blog – Pretius Drawing Plugin: Free office layout planner for Oracle APEX apps – I introduced you to a new Oracle APEX region plugin called Pretius drawing plugin that you can use to draw 2D plans or diagrams and integrate them easily into Oracle APEX applications.

In the case I presented there, I focused on the possibility of building a parking or workspace reservation system because that was what the current challenges of our projects required of us. But as I mentioned in that article, the plugin is modular – which means you can add your own components and create different solutions.

Today, we will look at another scenario where you can use the plugin. This time, it’ll be a tool used in the transportation industry – namely, a train reservation system.

How does it look?

My inspiration came from the reservation system used by the local Polish train company PKP Intercity. At first glance, it looks quite complicated, doesn’t it?

A screen showing PKP Intercity's train reservation.

However, if I add just a few components to the Pretius drawing plugin, I should be able to create something similar in Oracle APEX.

Adding new components

I created 11 new components for this case. I added rows into the type_component table, where I defined HTML code and CSS. 

A screen showing the query builder.

The new components look like this:

A screen showing the new components.

Pretius drawing plugin – Train reservation system

The solution is divided into 2 parts. 

  • First, the side train schema where you can choose the car (“wagon” in Polish) and then the actual train plan with seats. Here’s the side view:

A screen showing the side view.

  • The second part is a bit more demanding because there are a lot of seats to add. This is how it looked in the editor.

A screen showing the editor.

To make it all work, I had to create 2 regions on one page with the Pretius drawing plugin. The extension wasn’t prepared for this scenario, so I made a few small changes – they’re already in the newest version available on GitHub, so download it if you want to replicate what I’m doing here.

A screen showing the App Builder.

You can add an on-click function when the region is read-only. So I created a simple javascript function to add the selected-seat class for the selection. I’ve also added a few not-available seats just to show off the plugin’s capabilities. The result looks like this: 

A screen showing the result.

Conclusion

This is one of many use cases for the plugin. If you want to learn more about it, you can find it in our GitHub repo. There’s also plenty of additional information available there, including the installation instructions. If you have any questions, contact me at tkucharzyk@pretius.com (you can also leave suggestions on GitHub if you prefer). Also, be sure to check out the first part of this article series:

And lastly, if you’re interested in a solution similar to the one I showed here, let us know at hello@pretius.com (or using the contact form below). We’ve delivered plenty of powerful low-code applications for our clients. With over 50 specialists in our Pretius Low-Code team – including conference speakers, plugin creators, and a few Oracle ACE experts – we’re one of the best choices for Oracle APEX development. Initial consultations are always free, so just drop us a line, and let’s talk!

Share