Developing MAF Applications
Oracle Enterprise Pack for Eclipse - OEPE
As previously mentioned in Blog Entry "Android and iOS development comes to OEPE 12.13.1", MAF development has certainly come to Oracle Enterprise Pack for Eclipse (OEPE). In many ways the development experience is very smooth and it has a clean interface.
I can understand the development community preference and mass adoption of this IDE and for those of us who have become familiar with JDeveloper, here are some points to get you started and introduce you to the Eclipse development experience with MAF.
Getting started ... OEPE Download
As with the JDeveloper installation, OEPE should be downloaded and installed if a supported version of Eclipse is not already installed. I will use the "Happy Path" in this entry as the documentation does a great job in describing the various installation options.
As the download page states there are two versions of the OEPE but you should download your platform version of the 188.8.131.52.1 with Oracle Mobile Application Framework (MAF). This distribution provides the traditional OEPE feature set with additional design time tools for mobile application development, the MAF runtime, and MAF sample applications. i.e. No need to update your installation afterwards with the MAF component extensions.
Getting started ... OEPE SDK Configuration
Working with OEPE for MAF is similar to JDeveloper and as such you first steps will be to configure OEPE with the path to your Mobile SDKs, provide any keystore information for Android or provisioning profiles for iOS projects.
The process is similar to what we've been used, except it provides some smart wizards to get us through the process. From the Preferences menu option, drill down to Oracle -> Mobile Application Framework and add you SDK settings.
IOS SDK Configuration
Android SDK Configuration
Notice the ADD button on each screen which allows support of multiple SDKs, keystores, or provisioning profiles.
Getting Started ... Running a Sample ( O! I mean, an Example :D )
A good place to start is by verifying your configuration by deploying a MAF Sample Application. This is another small but nice difference in the OEPE user experience. To Open and Run a sample, simple create a new MAF Example. No need to find and then extract the samples to a project folder.
Create a New MAF Example Application, if this menu option is not showing yet, then just select Example and then you should find the MAF Example template selection item. Clicking next presents a selection of examples to choose from and I would suggest for your first MAF Workspace to select them all and have them conveniently located in a single location. Once you've selected the example you may create a Run or Debug Configuration to deploy and test your application to a configured target.
New MAF Example
The first thing you will notice after the application wizard is finished is 3 sets of folders and not just 2. The wizard generates the standard projects we are used to; The Application, & the ViewController or simply View projects. What is new is a new deployment project, or more correctly as per the documentation, the top-level assembly project.
OEPE MAF Application Projects
The assembly project holds all the related packaging and deployment artifacts. Some of the files we have had to search for in the application resources view in JDeveloper, such as default images, application, logging or connections settings which lived in the various META-INF directories, now have a respectable consolidated area.
When you are ready to Run or Debug your mobile app then this is the project to choose to have it deployed to your test simulator, emulator, device or production package. To ensure that all is well with your environment I would suggested running one of the examples now.
Getting Started ... Deploying a MAF Application in OEPE
In this process we don't talk about deploying an application but running one on a configured target configuration. To do this, select your top-assembly project (!Application && !View) and select Run As or Debug As from the context menu. The configuration will defined the target to build and deploy the application.
Create a configuration for each of your target by select the assembly project, target platform, type of target with the required settings. The Advanced options are used to further refine the application settings found under the Jdeveloper Application properties -> Deployment Profile -> Target (Android || IOS) Profile -> Target (Android || IOS) Options -> Application Images.
Run Configuration for IOS
Once defined, simply click run.
To run a configuration afterwards, simply select it from under the Debug or Run icons in the IDE.
I'll cover configuring the Debugger later, if it proves problematic for the community but from my brief encounter, debugging is quite nice under eclipse and there is no need to open a secondary application to view the log file being created or using the Android Monitor to filter out your application messages.
Getting Started ... Creating a MAF Application in OEPE
So, what should you know about creating a MAF application in OEPE is that it is fairly similar to creating one in Jdeveloper, with the exception that you have the assembly project. You have different perspectives to perform the various tasks based on the type of component you are working on. You have the same relationship between the Application and the View projects with some small differences; such as the new MAF folder which houses the Data Control Manager, the editor interface for the DataControl.dcx file.
In the assembly project the MAF folder displays the MAF Application Editor, the editor for the maf-application.xml. This project also exposes the application resource and other configuration files, normally in the resources view in JDeveloper and the hidden .adf folder of the application.
After the creation wizard is complete you will have everything you need to start developing your MAF application, except the connections.xml file which is used to keep track of your application resource links. The easiest way to create this file is from the MAF Application Editor. Once the editor is open, select the security component or tab, for lack of a better term, and you will find a hyper link for the connections.xml file which is also used to store URL White Lists. Simply select the link and you will be prompted to create the connections.xml.
Getting this created was the easy part and for SOAP based resources this ease of use continues but for those focused on the consumption of Restful services, you will have to create the connection entry manually. I will provide a sample connect entry at the end for those of you who do not have access to Jdeveloper and the Rest Data Control wizard.
This feature will be released in a future version of OEPE for MAF but once the connection URL has been added, consuming, transforming and exposing the Restful services and data is the same process and APIs.
Some other differences to mention are:
- The Palette area combines the Component and Data Control perspectives in Jdeveloper
- The Structure pane is called Outline, which shows the xml document format and not the component type icons, which make it easier to develop pages/views as in JDeverloper. You can still edit your page/view in this manner but be careful to read the component text and its level before dropping your new component onto the page.
- Flow actions, defined in your task flow, are only listed in the "Select a Value" / "Select an Outcome" screen and not in the drop down list of the action property. The pulldown only list "__back", the default return action
- The Console window has multiple views and you will need to click / select it to switch between the build/deployment view and the running application log view
- To debug your application you need to configure a Remote Java Application configuration to connect to the Debug port connection property
- To Debug your application, start the application first then the debugger
To wrap up, I'd just like to say that OEPE development experience for MAF is good and only lacks a few wizards found in JDeveloper. It supports multiple SDK environments and versions as well as keystone and provisioning profiles, which will come in handy for customer development projects.
The integrated log console view is great as well as the debugger for the application's java code. The only negative exception is the lack of wizard to add Rest URL connections, which I hope we will see released soon. For a first release this is great start and I look forward to seeing what the future holds for both OEPE and MAF development.
Please add your experiences and comments, so the PMs can keep improving OEPE and MAF in general.
Sample Connections.xml with a Rest URL connection defined
<Reference name="SampleRestServicesURL" className="oracle.adf.model.connection.rest.RestConnection" xmlns="">