Posts

Programmatic DVT charts in Oracle ADF

Image
JDev: 12.2.1.3.0 Source:  GitHub This article talks about programmatic approach of creating dvt components or charts, using Java objects, and more importantly, without ADF bindings. This is quite helpful when you deal with data which does not change often and can be pre-loaded into Java objects. The biggest advantage of this is of course, performance , since you do away with any database interaction. The sample code has a table based on Department pojo. Each department object has a List of Employee pojo. On table row selection, I retrieve the list of employees, and I use this list to create the Object array required for each chart type. There are a couple of key points to this approach: 1) Your Java data model should be prepared to provide all the required information to the chart. 2) You need to know the "Tabular Data"  format for each graph. My data-model consists of a Department object, having a list of Employee objects. Each graph's tabular...

Send mail using gmail from Oracle ADF

Image
JDev: 12.2.1.3.0 Source:  GitHub This article talks about using Google services (Gmail) to send email from an ADF application. I doubt that there would be a real-world use-case for this, but nonetheless, the email integration would be the major takeaway from this blog. This does not use any ADF related package. Any Java application is good enough for this. To start with, I have an ADF application, with just the ViewController project. I don't need any Model support for my sample project. The UI captures the required details. Email UI However, before you start sending emails from your Google account, you need to allow "less secure apps" to access your Google account. Now this is not recommended, but try it out for once. Visit  https://myaccount.google.com/security , scroll down till the end and set "Allow less secure apps: ON". Allow less secure apps from your Google settings The emailing will be taken care of by javax.mail package. Let us ...

Custom (user-defined) GUI components in ADF

Image
JDev: 12.2.1.3.0 Source: 1)  CustomComponent , 2) CustomComponentApp A very less-used, yet powerful, feature of Oracle ADF is its ability to allow users to create custom (declarative) UI components. The steps to create such a re-usable component is a bit elaborate and clumsy, but the fruit of the hard-work is quite sweet! This is going to be quite a large blog. So I will break this into 2 sections. However, just to get your attention, this is what we intend to achieve in the end: This is what our jspx code will be Section 1 - Define the component Create an ADF application, with the default ViewController and Model projects. I have renamed ViewController to DeclarativeComponent in my case, and have removed the Model project. An alternate starting point would be to create an empty Java application and add a project, but I chose this path so as to ensure that all the required libraries get included automatically and save me the hard work! Once the appli...