Monday, December 23, 2013

How to add Input Texts(or any element) dynamically within form layout?

1)      Create ADF Form layout and bind the variable to managed Bean
2)      Create method in ManagedBean to perform the action.
3)      Use following code snippet for reference to add inputboxes dynamically within form layout
        inputText = new RichInputText[newValues.length];
        if (childrenLength != 0) {
            getPnlFormLayoutForMassUpdate().getChildren().clear();
        }
        for (int i = 0; i < newValues.length; i++)

        {
            inputText[i] = new RichInputText();

            inputText[i].setLabel(newValues[i]);
            inputText[i].setId("id" + i);
            //  inputText[i].setRequired(true);
            //  inputText[i].setShowRequired(true);
            //inputText[i].setValue(newValues[i]);
          

            getPnlFormLayoutForMassUpdate().getChildren().add(inputText[i]);
            if(newValues[i].indexOf("Date")!=-1)
            {
                    RichActiveOutputText opText = new RichActiveOutputText();
                    opText.setId("otindlg");
                    opText.setValue("Example : 07-Oct-16");
                    getPnlFormLayoutForMassUpdate().getChildren().add(opText);
                }
            //refresh the container to show text field
            AdfFacesContext.getCurrentInstance().addPartialTarget(getPnlFormLayoutForMassUpdate());
            childrenLength++;


        }

How to integrate Google Maps with ADF applicatiIon

How to integrate Google Maps with ADF application…
Today I am going to demonstrate how to integrate google maps API within your application.
Often we come across requirement to show Google maps within our application where user will click on city or location name and accordingly location should be highlighted in google map.
The solution is very simple to integrate…
1)      Create Location table put fields id, locationName,Latitude,Longitude…
2)      Create ADF Fusion application
3)      Create JSF page
4)      In Model Project Create Business Component from table by selecting Location table you created
5)      Drag and Drop Panel Splitter within JSF Page
6)      In one Facet of splitter Drag and Drop Location View Object from Data Control…
7)      Replace Location Name column with following code…
<af:column sortProperty="#{bindings.JgLocationsView2.hints.LocationName.name}"
                                                           filterable="true" sortable="true"
                                                           headerText="#{bindings.JgLocationsView2.hints.LocationName.label}"
                                                           id="c4">
                                                                      <af:outputText value="#{row.LocationName}"
                                                                   shortDesc="#{bindings.JgLocationsView2.hints.LocationName.tooltip}"
                                                                   id="ot4" >
                                                                   <af:clientAttribute name="lat" value="#{row.Latitude}"/>
                                                                    <af:clientAttribute name="long" value="#{row.Longitude}"/>
                                                                    <af:clientListener method="doNavigate" type="click"/>
                                              </af:outputText>
        </af:column>
8)      Replace Second Facet with following line of code…
<f:facet name="metaContainer">
        <af:resource type="javascript" source="http://www.google.com/jsapi?key=AIzaSyBICigoNf4GQVzrdL03_d3Cw1RgucoYvJA"/>
        <af:resource type="javascript"> google.load("maps", "2.x");
                    // Call this function when the page has been loaded
                    function initialize() {
                    var map = new google.maps.Map2(document.getElementById("map"));
                    map.setCenter(new google.maps.LatLng(0,0), 1);
                    map.addControl(new GLargeMapControl());
                    map.addControl(new GMapTypeControl());
                    }
                    google.setOnLoadCallback(initialize);
        </af:resource>
        <af:resource type="javascript">
                          function doNavigate(evt)
                          { long = evt.getSource().getProperty("long");
                            lat = evt.getSource().getProperty("lat");

                            var latlng = new GLatLng(lat,long);
                            var map = new google.maps.Map2(document.getElementById("map"));            

                            map.addControl(new GLargeMapControl());
                            map.addControl(new GMapTypeControl());

                            map.setCenter(new GLatLng(lat,long), 16);
                            map.addOverlay(new GMarker(latlng));
                          }
        </af:resource>
      </f:facet>


Enjoy Google Map !!!

Monday, September 23, 2013

Oracle ADF Essentials

Oracle ADF Essentials - Overview


ADF Essentials provides probably the most powerful (free) framework for developing Java/JEE Web Applications with high productivity and rich functionality in either Oracle JDeveloper or in Eclipse (with the OEPE plugin)- that can be deployed across JEE Containers including Tomcat, JBoss, WebSphere, GlassFish and WebLogic. This offer is bound to attract many more developers and organizations that until now were reluctant to adopt ADF because of the license involved or the supposed tie in with WebLogic and JDeveloper. However: since it is now free of charge and deployable on Tomcat, JBoss and GlassFish – this earlier hesitation is likely to disappear. The productivity and quite advanced functionality are likely to quickly bring in many more developers from the Java/JEE arena.
Advantages of ADF Essentials
Oracle ADF Essentials offers advanced innovative functionality allowing developers to build applications with richer functionality.
Some of the key capabilities of Oracle ADF Essentials include:
·     Ajax and HTML5 enabled UI components
·     Reusable task-oriented controller layer
·     Declarative binding of UI to business services
·     Declarative relational database access layer

With the ability to deploy applications that are based on Oracle ADF Essentials to various servers, without paying a license  fee, more developers can leverage the powerful Oracle Application Development Framework to speed up the creation of cutting edge applications.

What components of ADF faces are included in ADF Essentials
Oracle ADF Essentials includes the following Oracle ADF components: Oracle ADF Faces Rich Client Components, Oracle ADF Controller, Oracle ADF Model and Oracle ADF Business Components.
The following functionality is not included in Oracle ADF Essentials, and requires the full Oracle ADF version – Oracle ADF Mobile, Oracle ADF Desktop Integration, Oracle ADF Security, The Oracle ADF Web service data control, Oracle ADF remote taskflows, Oracle ADF Business Component’s Service Interfaces, Oracle ADF Data Controls for BI, Essbase and BAM, Integration with Oracle Fusion Middleware features such as MDS, OPSS, OWSM, Enterprise Manager and MBeans, High Availability and Clustering.

Note:

ADF Essentials is not open source. The ADF sources are available to customers with an ADF license. There is no community process around further evolving ADF. ADF is and stays Oracle’s strategic development framework for its enterprise applications. It has no intention whatsoever to relinquish control over one of its most important technologies. However, it is interested in sharing that technology with a much wider audience.There is no  separate version of Oracle JDeveloper specifically for Oracle ADF Essentials
The same version of JDeveloper is used to build both Oracle ADF Essentials applications as well as applications that leverage the full Oracle ADF.


References:



Wednesday, August 28, 2013

Oracle ADF Task flows

Taskflows are a very useful feature in Oracle ADF which provide a modular approach for defining control flow in an application. It allows to create application flow graphs which can be tied together to build the complete application. So instead of considering an application as a collection of different JSF pages, in ADF we would consider an application as a collection of different taskflows.
ADF Taskflows come in two forms:
  • Bounded Taskflow
  • Unbounded Taskflow
Unbounded Taskflow: A set of activities (JSF Pages/views), control flow rules, and managed beans that interact to allow a user to complete a task. An ADF unbounded task flow consists of all activities and control flows in an application that are not included within any bounded task flow.
Bounded Taskflow: A specialized form of task flow that, in contrast to an unbounded task flow, has a single entry point and zero or more exit points. It contains its own set of private control flow rules, activities, and managed beans.
A bounded taskflow:
  • has single entry point.
  • zero or more exit points.
  • may accept input parameters.
  • may generate return value.
  • has its own memory scope called pageflow scope.
The memory scope of a bounded taskflow called pageflow scope allows the developer to declare java bean classes in that scope making it available/accessible across all the JSF pages within the taskflow.


Wednesday, July 24, 2013

Oracle ADF Mobile Technology

Oracle ADF Mobile enables developers to build and extend enterprise applications for iOS and Android from a single code base. Based on a hybrid mobile architecture, ADF Mobile supports access to native device services, enables offline applications and protects enterprise investments from future technology shifts.

Features and Benefits


  • Develop once, deploy to multiple mobile device platforms including iOS and Android
  • Code and reuse application logic in Java for cross platform portability
  • Leverage Over 50 components provide simpler development of richer user interfaces
  • Accelerate development through visual & declarative application development
  • Access native device services, such as phone, SMS, camera, GPS and more
  • Protects against mobile platform shifts through a hybrid mobile application architecture
  • Support both on-device and browser-based mobile applications
  • Leverage existing skills to develop mobile applications using open standard technologies (Java, HTML5, JavaScript, CSS)
  • Supports both real-time and offline data access
  • Offline support using SQLite – encryption included
  • Consistent experiences between desktop-based and mobile application development
  • Build secure mobile applications with end-to-end encryption on a proven platform
  • Extend Oracle Enterprise and Fusion Application to mobile devices
How is ADF Mobile licensed?
ADF Mobile is licensed as part of the Oracle Application Development Framework (ADF). Oracle ADF can be licensed either as “Oracle Application Development Framework and TopLink” item
on the technology price list, or as part of the Oracle WebLogic licenses.  A named user plus license of ADF will entitle customer a single named user license of the ADF Mobile. A processor license of ADF
will allow customer to deploy ADF Mobile-based application to unlimited number of devices


How is ADF Mobile licensed?
ADF Mobile is licensed as part of the Oracle Application Development Framework (ADF). Oracle ADF can be licensed either as “Oracle Application Development Framework and TopLink” item
on the technology price list, or as part of the Oracle WebLogic licenses.  A named user plus license of ADF will entitle customer a single named user license of the ADF Mobile. A processor license of ADF will allow customer to deploy ADF Mobile-based application to unlimited number of devices




Oracle ADF Security

The Oracle ADF Security feature provides a declarative and visual development environment for building Oracle platform security services-based security into Oracle ADF applications. Together, Oracle ADF Security and Oracle platform security services enable developers to focus more onwhat needs to be protected than on how it should be protected.
This article introduces Oracle ADF Security and shows how developers can use it to implement security within their enterprise Oracle ADF applications.
Roles
Three key concepts are critical in understanding Oracle ADF Security and Oracle platform security services: user identities, enterprise roles, and application roles.
User identities define users in an enterprise. Users—such as company employees—usually have a single username/password pair they use to authenticate themselves to applications within an organization. A user identity defines only who the user is—it does not define any access privileges.
To ease system deployment, administrators often organize users into enterprise roles, which provide a way to manage groups of users who have similar requirements when accessing enterprise resources. For example, employees may all be grouped into an enterprise role called Employees to give them access to all employee self-service applications within an enterprise. From an administrative point of view, it is easier to add users to or remove them from an enterprise role than to maintain individual user grants for an application.
Application roles are specific to an application and are used to grant privileges to users defined in enterprise roles. Application roles make it possible for all users who belong to an enterprise role (such as Employees) to have specific access privileges defined for various applications. For users within an enterprise role to work within an application, application roles must be granted to the enterprise role. Application roles can be granted directly to users, but this practice is rare and is not considered good programming design.
Enabling Oracle ADF Security
By digging deeper inside the sample Oracle ADF application, you can see how the security rule definitions described above are implemented for the three defined user accounts.
The first step in securing an application is to enable Oracle ADF Security. In the OramagAdfSecurity project, select Application -> Secure -> Configure ADF Security to open the Oracle ADF Security wizard. This wizard is re-entrant, so you can safely open it and browse security settings without worrying about losing data.
The first dialog box in the configuration wizard enables you to define the type of security you want. The ADF Authentication and Authorization option, used in the sample application, enables you to configure login information as well as access to specific application features. Another option,ADF Authentication, is for controlling only who can access the application (via a login dialog box when a user requests access to the application). The Remove ADF Security Configurationoption does not delete any existing policy definitions, but it disables the enforcement of Oracle ADF Security. This option can be useful for allowing application testing while temporarily disabling security.

In Conclusion

Oracle ADF Security simplifies a complex topic by abstracting JAAS authorization and Java EE authentication. With Oracle ADF, you use visual editors to protect the resources you care about the most and enforce security configurations. You can also use security expression language or Java in applications to verify user access rights. With all the simplicity added, the most important thing to be aware of is that applying security to an application is a journey and not a destination

Friday, June 21, 2013

Where Oracle ADF Fits In???

In my previous blog I described What is Oracle ADF and What is its architecture…
In present blog I have described in which scenario You should use Oracle ADF
There may be various Integration Scenario where ADF is well suited:
  • Waht to have start from scratch development of your application in which you want to have rich UI, Charts,Google Maps,Task Flows etc
  • Want to create UI layer only and integrate with existing service layer
  • Want to have composite layer as you are integrating with 2 or more application (SOA scenario – can be 2 or more independent components) – Using ADF you can achieve Composite behavior at Application Module level (aggregate multiple View Object), ADF business component level or can have custom composite layer (in case application existing architecture uses Service Bus, composite web services)
  • Want to have rich internet UI as well as advanced feature like – “UI Customization at Runtime” (Integrate with WebCenter), “MDS Integration”, “Security – ADF Security Authentication”, “Responding to Application Events”, “Customize the Application Look and Feel with Skins”, “Partial Page Rendering (PPR) on a JSF Page” etc.
  • Want to Integrate SFDC Cloud/Anyother cloud with your application, ADF fits very well.
  • Want to integrate your application with Oracle EBS R12…
  • Want to have Mobile Application functionality as well considering future of the application (Mobile application developed in Oracle ADF can be deployed in iOS,Android and all other popular mobile service platforms).
When to Use (Recommendation)
Fast Development: Want to build application within no time. This case will be best suited for small projects where you want to build application quickly and looking for end to end framework or build new UI and integrate existing service layer. Reason for saying this is once you understand ADF architecture/layers, can focus on ADF feature you want to explore.
Migration: To migrate existing application choosing ADF as option needs to be evaluated. ADF provide number of rich internet UI patterns and help in rapid UI development, so migrating application for UI scenario should be large (in terms of no of UI screens). In large application effort can be drastically minimized after identifying common usability pattern. As development scenario we can have 4 scenario stated above CRUDQ [Create, Read, Update and Search/Query]. For better usability (similar look and feel), Business Analyst/Usability Team can define similar look and feel. ADF have lot of inbuilt Usablity Pattern for CRUDQ, which can decrease development time drastically. Migration for small application just for UI might not be good idea (unless you have requirement to extend application in near future).
Rich Internet and Advanced Features: Rich Internet Feature, “UI Customization at Runtime” (Integrate with WebCenter), “MDS Integration”, “Security – ADF Security Authentication”, “Responding to Application Events”, “Customize the Application Look and Feel with Skins”, “Partial Page Rendering (PPR) on a JSF Page”.
Integration: Integrate your application into a SOA by firing events from your business components, invoke BPEL or create Human Work Flows


References: http://shishirkumarblog.wordpress.com, http://www.oracle.com/technetwork/developer-tools/jdev/overview/index-100269.html

Thursday, June 13, 2013

Oracle ADF With my spectacles

HI All, My name is Rohit Majithia and I am working with Jade Global Software pvt ltd as Sr. Consultant.
My motivation for writing this article is simple: I have worked with ADF. I have developed Java Web applications with a range of other frameworks and libraries. I have been part of ferocious debates about which tools, IDEs, frameworks and technologies to use in projects. I have seen the struggle of many Java developers to find their way in rapidly evolving Java frameworks and to become productive.
I have also worked in JSF and Spring frame works. From my  experience I can say ADF is best among all the frame works available (Though it is paid one  except ADF Essentials  ).
Please exeuse me if you find content of my article is copied from somewhere. What my idea is to go through most of available contents on internet and pick best of the contents available.
This article will first explain in brief what ADF is and its architecture.
In further articles I will also discuss when and why  you should use ADF applications, where ADF applications fits in etc.

Introduction
Java EE is a standard, robust, scalable, and secure platform that forms the basis for
many of today’s enterprise applications. Java EE provides a set of specifications for
building multi-tier applications using the JavaTM language. In the past, there was a direct
correlation between the robust nature of an application to the complexity required to
achieve it. However, with the advent of the Oracle ADF framework, you are able to
provide the implementation of extremely rich Java EE applications, adhering to standard
patterns and practices with greatly reduced effort.

Additionally, the increased need for organizations to build composite applications that
utilize Service Oriented Architecture (SOA) principles has forced developers to create
applications that are extremely agile. Implementing these best practices in agile
applications usually involves writing a significant amount of infrastructure code, adding
another obstacle for developers building their first Java EE application.

What is ADF

In computing, Oracle Application Development Framework, usually called Oracle ADF, provides a commercial Java framework for building enterprise applications. It provides visual and declarative approaches to Java EE development. It supports rapid application development based on ready-to-use design patterns, metadata-driven and visual tools.


Oracle Application Development Framework (Oracle ADF) is an innovative, yet mature Java EE
development framework available from Oracle and directly supported and enabled by
Oracle JDeveloper 11g.

Oracle ADF Architecture:

Oracle ADF lets developers choose the technology they prefer to use when implementing each
of the layers. The diagram below shows the various options available for developers when
building Oracle ADF applications. The glue that integrates the various components of Java EE
applications and makes development so flexible is the Oracle ADF model layer. EJB, Web
Services, JavaBeans, JPA/EclipseLink/TopLink objects and many others can all be used as
Business Services for the Oracle ADF Model. View layers can include Web based interfaces
implemented with JSF, Desktop Swing applications and MS Office front ends, as well as
interfaces for mobile devices.


Oracle ADF is based on the Model-View-Controller (MVC) design pattern. An MVC application
is separated into:
1) a model layer that handles interaction with data-sources and runs the
business logic,
2) a view layer that handles the application user interface, and
3) a controller that
manages the application flow and acts as the interface between the Model and the View layers.



The Business Services layer - provides access to data from various sources and handles
business logic.
The Model layer - provides an abstraction layer on top of the Business Services layer, enabling
the View and Controller layers to work with different implementations of Business Services in
a consistent way.
The Controller layer - provides a mechanism to control the flow of the Web application.
The View layer - provides the user interface of the application.

                http://technology.amis.nl

                 http://docs.oracle.com