February 29, 2016

Adding a custom css/skin file to a Oracle MAF application

When we want to apply our own css to a Oracle MAF application, we need to configure a custom css file to it. Below is the procedure to know how to add a custom css/skin file to a MAF application.
  • Right click on ApplicationController project -> select CSS File -> enter css file name. Below is the default path of the file to be created. Here my css file name is myskin.css
            /ApplicationController/public_html/resources/css/mycss.css

  • Open maf-config.xml which is under Application Resources and check the skin family and version
         Ex
             <skin-family>mobileAlta</skin-family>
             <skin-version>v1.4</skin-version>

  • open maf-skins.xml which is under the project "ApplicationController" and create an xml entry like below
        <?xml version="1.0" encoding="UTF-8" ?>
         <adfmf-skins xmlns="http://xmlns.oracle.com/adf/mf/skin">
         <skin-addition id="s1">
         <skin-id>mobileAlta-v1.4</skin-id>
         <style-sheet-name>resources/css/myskin.css</style-sheet-name>
         </skin-addition>
         </adfmf-skins>

Where <skin-id> is the combination of skin-family and skin-version of maf-config.xml file seperated by "-" and enter the css file path for <style-sheet-name>.

February 3, 2016

How to integrate or configure InAppBrowser Cordova plugin in Oracle MAF

I have created a video to show how to integrate a Cordova plugin in Oracle MAF to show InAppBrowser in a mobile app. Click here to watch the video. This video also shows the procedure to integrate any other Cordova plugin with the Oracle MAF.

The MAF version 2.1 with JDeveloper 12c is used in this example.



Below are the steps to integrate the InAppbrowser Cordova plugin in Oracle MAF.
  1. Download the inappbrowser cordova plugin from https://cordova.apache.org to your machine
  2. Create a MAF application in JDeveloper
  3. Unzip the downloaded inappborwser plugin in your machine
  4. Copy and paste the plugin folder under the ViewController project folder in the MAF application
  5. Register or Configure the plugin in MAF application's maf-application.xml
  6. White list the domain you want to open in the app browser
  7. Create a java class and write a method to invoke inappbrowser api
  8. Create a button in amx page to bind the method
  9. Select the simulator and run the app
  10. Inappbrowser is ready. On click of the link in the app, a browser will be opened in the app with the given url. You can also choose to display extra buttons and navigation on this browser by changing the parameters passed in the java script api.