Monday, November 28, 2016

Tuesday, October 11, 2016

OTN Appreciation Day: Alta UI

Today it is time to say "Thank you" to the Oracle Technology Network (OTN) for keeping up one of the worlds greatest developer community.

One cool thing within the Oracle Development ecosystem I really like is the availability of an technology agnostic Design Guide, including Style, Patterns, Cookbook, etc. called ALTA UI. Besides containing best practices for designing great User Experiences it allows to introduce new technologies under the covers. The user does not notice if something is build in ADF, JET, MAF or technology X which implements the Alta UI Patterns.

Source: altaui.com

Checkout some of the featured Alta UI Demos.

Checkout Alta UI Design Pattern Library.

#ThanksOTN

Monday, August 22, 2016

Oracle JET 2.1.0 released - for web and hybrid mobil app development

Today Oracle released the new Version of Oracle JET - JavaScript Extension Toolkit for developing client-side web apps and hybrid mobile apps.

The new Cookbook looks awesome.
 Oracle JET Cookbook





















The Oracle JET Theme Builder also looks pretty impressive


Check out the updated documentation



Saturday, August 20, 2016

Walkthrough Oracle Application Builder Cloud Service - Create Table based on ADF BC REST Service

Oracle is making great progress in the Cloud. One of the recently released Cloud Services is the Application Builder Cloud Service (short: ABCS).

In this post I want to share my first impression in using ABCS for building modern web applications - responsive and optimized for mobile. For the backend I am using an exposed REST Service through ADF Business Components.

Prerequisites

You have created a new ABCS application.

Start with creating Business Objects on REST Resources

First open the Data Designer from the Hamburger-Menu. Choose New Business Object > Select from external service. The following Wizard shows up


Choose "Add Custom Services" and provide details to your REST resource. In this case a URL to the ADF REST Services descriptor is expected.


(For Authentication there are the following options: None, Basic, Oracle Cloud Account)
After submitting the form the REST service will be parsed. The containing resources are being shown in the next wizard step.


Select the "employee" resource and go to the next step to fine tune the naming, paths and child resources if available.



Go to the next screen to define so called Business Objects. That means choose/define just the specific attributes from the REST Resource you want to use in your app. (kind of similiar to creating ADF Business components from Database table). For the chosen fields you can further adjust data types or define defaults for the UI, e.g. Label Name. (compared to ADF these are "UI hints")

Finishing this last step the Business Object(s) are all setup to start building the UI.

Create table from Business Object

From the Data Designer switch to the Page Designer. (I am assuming here a page employees is already created).

Select Table from the Components Palette and Drag And Drop on the Page canvas. On the right side the Table Creation starts. Choose Employee Business Object


In the next step (Mapping) select fields you want to be used for the Table Columns. This is done by DnD from Available to Selected Pane.

The table will be readonly. With just some configuration options like 'Create on/off', Edit 'on/off', Edit Screen Title, 'Delete on/off' etc. you can let ABCS generate corresponding actions and Screens. The is a great feature for many typical use cases!

On the last wizard step you might want to configure Filtering, Sorting and further options like table summary for accessiblity.

Generated Edit form

As mentioned before when selecting to create the "Edit Action" ABCS generates the Edit form for you that you can further fine tune in terms of required fields, label positions, etc.


Conclusion

Oracle Application Builder Cloud Service feels like ADF for the cloud era. Having APIs as your backend (not coercively a DB) you model Business Objects which are the basis to wire the desired UI components.

The development experience is very smooth for basic UI development. For more advanced UI Logic custom JavaScript is needed. For reusable components Oracle JET (see blogpost) comes into play. All you need is a browser.

The resulting applications are being deployed with a push of a button on Test and Production Cloud Environments. Awesome!

Get Connected with the Community (Oracle JET and ABCS)

Be part of the ABCS Community and follow the ABCS Youtube Channel. Go to https://cloud.oracle.com/ApplicationBuilder for a trial account to get started.

Further Information

Monday, March 28, 2016

Running Node.JS Apps and "Fat-JAR" Apps on Application Container Cloud Service


With the trend of container technologies going on it is great to see Oracle is providing the so called Application Container Cloud Service. Its current architecture is based on Docker and allows to run Java SE and Node.js applications in its current version. See the the following diagram


The Load Balancing, dockerizing and scaling is fully transparent. From developer perspective you are deploying a ZIP containing a manifest.json with a command property that states what should be executed once the deployment has been installed on the specific container.

In the following figure you see the overview screen of Application Container Cloud service (ACC).


Next lets create an app and deploy it to ACC. For Java SE lets see how that manifest.json looks like

Java SE App

The important properties are runtime / majorVersion and command. It states that the deployment needs Java 8. The application is started with the given "java -jar ..." command. Currently two working samples are provided, one works with embedded Tomcat the other works with Grizzly Http Server. Here is how a typical Main.java class would look like


The PORT and HOSTNAME are given from the environment. So it is in control of the application container cloud service.

Node.js App
For a Node.js app that manifest.json looks like

It expects a file server.js as the main entry point. There is an official Node.js sample application (together with a Tutorial). In my example I am going to create a connection to Oracle Database Cloud Service (via oracle nodedb driver) and expose DEPARTMENTS as a read online REST Resource.

The most interesting part here is how to retrieve the CONNECT String to the Database.

For testing on local machine defaults are used. Once deployed the CONNECT String is given as an environment property (beyond PORT, USER, etc).

Hint: All the JavaScript modules except native add-ons like node-oracledb should be included in the ZIP bundle.

Deployment
The deployment is quite straightforward from the ACC UI using the "upload application archive" option. Further you can provide initial values for number of "Instances" and Memory.

After about 5 min. the application is available through the Load balancer. For automated deployment a REST API exists.

To connect to other cloud services a service binding needs to be created first. The service binding creates environment variables that are available to every application instance.

Custom environment variables can be created. For example the schema user / password you want to connect with. Unfortunately just clear text values are accepted at the moment. Would be great to have a "secret type" for passwords. Further  # characters are not allowed (although my schema name is c##hr  ;) ).  Anyway it is no major show stopper.


See the sample service running in Postman


Logging / Diagnostics
Logs are stored on the Oracle Storage Cloud Service as a zip file. To look into the log files you have to download those ZIP files on your local disc first

For Java SE Apps a Flight Recording is possible.

Summary

The first public release of ACC looks quite promising. For the next versions my wishlist would contain
- Online Log Viewer
- Monitoring RAM / CPU Usage / Requests online
- Automatic Scaling
- Service discovery
- Security ?
- Adding environment variables of type "secret". (Currently you can only provide variables in clear text)
- Packaging improvements, maybe some mvn acc:install or CLI Tooling


Looking forward to new features in the future versions. There is potential for a modern microservice platform.

Samples Code
Explore the Node.JS sample code on https://github.com/enpit/enpit.sample.acc-node-hrapi
The Java SE jersey based code is available from Oracle.

Further Information

Tuesday, February 9, 2016

ADF Spotlight: REST in ADF 12.2.1

In the recent ADF Spotlight Webconference I have given a presentation and live demo on some of the new REST features in ADF 12.2.1. The recording (in german) is on youtube: https://www.youtube.com/watch?v=SmrINlqVNPs

The new REST features (to create REST resources) are implemented on top of Application Module (WebServices > REST). Here you can choose a Root View Instance, assign it to a release version and further configure the defined REST resource in a new Overview Editor.

Following summarizes some of the new REST features in ADF:

Resource Versioning

Versioning is the first thing need to be configured before you can start creating REST resources. It is supported at the level of the adf-config.xml file. Here you can define different versions. Each version can be configured as  active, deprecated or desupported. To keep things simple I recommend to use same name for internal and release name.


Versions marked as desupported will reply with HTTP 500  and corresponding message. They will not serve any REST Data.


Versions marked as deprecated will work. If you invoke the URL for v2 metadata you will get information that there is a successor-version:


It implements the HATEOAS principle and therefore is very developer friendly.

Read, Create, Update, Delete Out-of-the-box

By default all REST HTTP Methods are exposed on a resource. GET for read, POST for Create, DELETE for Delete. To partially update a resource (only some attributes e.g.)  the PATCH method is exposed.  For PUT you need to provide all attributes (It will do kind of a replace).

Important: When working with the REST API it is important to set the Content-Type to application/vnd.oracle.adf.description+json otherwise there will be the following exception:

oracle.adf.internal.model.rest.core.exception.CannotParseContentException: The PayloadParser could not be found in the ResourceProcessingContext.

See the following Postman PATCH sample:

Pagination for collections by default

Having a REST collection ADF automatically exposes parameters for pagination. Just append limit und offset as URL parameters and your good to go. see next pic to get a feeling how the parameters affect the response:

Children and LOVs as sub-resource

This is also a pretty great feature. 

By a simple configuration child view object instance will be exposed a sub-resources.



Configured LOVs on specific attributes will by default be exposed as sub-resources too. See example in postman:

Attribute Shaping

By default all attributes of a View Object will be exposed in the REST resource. If you want to expose only a subset of the attributes you can define "Service Shapes" on the View Object

and use those to customize the REST resource (Tab: Attributes)


Security

Securing ADF REST Resources is quite powerful. It works just like with Pages / Taskflow Permission. You just need to run the ADF Security Wizard on the RESTWebService project.

More features

Canonical Link

The canonical link is used to link to a resource that represents the full representation (of REST resource). This can be an "internal" defined View Object or an external (by pointing to the corresponding) ADF Connection.

See details in the Dev Guide: How to expose canonical Resources

RowFinder Key

With RowFinder configuration it is possible to change the URL of a resource from e.g. /employees/100 to /employees/SKING

Expose Custom Methods in the ADF REST Resource

To be evaluated ;) The ADF Documentation is not very clear about that topic.


--
Sample Code: https://github.com/enpit/enpit.sample.adf1221.restsandbox

Further information