MAF framework in JDeveloper 12c (12.1.3) comes with MDS support. This means, we can customise mobile applications in similar way as we customise regular ADF Web applications. I'm going to explain and demonstrate with the sample application, how it works in MAF 2.0. You can read about it more in MAF 2.0 developer guide, Customizing MAF AMX Application Feature Artifacts.
Sample application, tested with iOS platform - MAFMobileLocalApp_v2.zip. Original version of this application brings Locations screen, where both City Name and Street Address are displayed:
We are going to customise original application with MDS, without changing source code directly. Customized application is based on two MDS tip layers - gold and silver level partners. Gold level partners are able to see State Name in addition to the Street Address:
While silver level partners are allowed to see only City Name:
To achieve MDS functionality behaviour for MAF application, you must define first MDS customisation class, this class must extend from standard MDS CustomizationClass and implement several methods. Important method is getName(), you must define MDS customisation name, the same name will be used for customisation (JDeveloper automatically reads this name during MAF application design time):
Customization class must be set in add-config.xml MDS section, in order to be registered for customisation use:
Once customisation class is registered, we can switch JDeveloper to the Customization Developer mode and start customizing application:
Make sure MDS layers are properly configured in CustomizationLayerValues.xml file. Customization layer must be set to the same name as you set in Customization class above. Layer values should specify different layers supported for customization:
I have defined two layers - gold and silver partnership. MDS layer can be selected for customisation, we start from Gold:
Locations page is updated to include State Name:
However, actual change is stored not in Location page, but in generated MDS file for Location page - it keeps delta for the changes made in customization mode. This file is generated under Gold Partnership profile folder:
State Name addition required to update Page Definition file for Locations, there is extra MDS file created with delta information for Locations Page Definition:
Next we can customize for Silver layer - change layer value:
Here we should keep only City Name and remove Street Address:
This change is reflected in MDS delta for Locations page, stored under Silver Partnership level:
Sample application, tested with iOS platform - MAFMobileLocalApp_v2.zip. Original version of this application brings Locations screen, where both City Name and Street Address are displayed:
We are going to customise original application with MDS, without changing source code directly. Customized application is based on two MDS tip layers - gold and silver level partners. Gold level partners are able to see State Name in addition to the Street Address:
While silver level partners are allowed to see only City Name:
To achieve MDS functionality behaviour for MAF application, you must define first MDS customisation class, this class must extend from standard MDS CustomizationClass and implement several methods. Important method is getName(), you must define MDS customisation name, the same name will be used for customisation (JDeveloper automatically reads this name during MAF application design time):
Customization class must be set in add-config.xml MDS section, in order to be registered for customisation use:
Once customisation class is registered, we can switch JDeveloper to the Customization Developer mode and start customizing application:
Make sure MDS layers are properly configured in CustomizationLayerValues.xml file. Customization layer must be set to the same name as you set in Customization class above. Layer values should specify different layers supported for customization:
I have defined two layers - gold and silver partnership. MDS layer can be selected for customisation, we start from Gold:
Locations page is updated to include State Name:
However, actual change is stored not in Location page, but in generated MDS file for Location page - it keeps delta for the changes made in customization mode. This file is generated under Gold Partnership profile folder:
State Name addition required to update Page Definition file for Locations, there is extra MDS file created with delta information for Locations Page Definition:
Next we can customize for Silver layer - change layer value:
Here we should keep only City Name and remove Street Address:
This change is reflected in MDS delta for Locations page, stored under Silver Partnership level:
4 comments:
Good post Andrejus!
Thanks !
Good stuff
Quite clear
I was looking for it. Thanks a lot Andrejus.
Post a Comment