Jet Integration With Rest

JET integration with Rest


Oracle jet is next set of UI technology provided by Oracle, its a complete framework which is been written in java script.

  Being on ADF technology now its must for you to start learning Oracle Jet technology.  I have started a bit and sharing my experience and projects, which I worked on.

  Jet SO far does not have any technology which can directly communicate with the database or datasource, hence its heavily dependent on the services for the interaction. So far my knowledge is limited to Rest services.

 In this example i have shown how you can integrate a 12c ADF service with the Oracle Jet.

ADF Application (Rest Source) 

I have created a small project (ADF 12c) which you can download from the link.  This project use oracle rest dataconrol (new in 12c) and expose department table as a rest service to view.




Cross Domain Access
  In ADF security does not allow to access one application from some other domain, which mean if page is running in the domain www.abc.com and its java script try to access data using rest from www.adcdata.com, adf will restrict it. In case of Rest interaction its very much required. Hence we need to enable to cross domain access in JET. Please read more about cross domain access and solution in the blog .


 If you see any error like " No 'Access-Control-Allow-Origin' header is present on the requested resource.".  It simple mean that your cross domain access is not working, hence please read and do the configuration in web.xml as given below.






2. Jet Project Rest Interaction 

When I was searching for the interaction project, i got a number of projects which was showing interaction, but none of that was working. Problem may be due to rest does not have a define structure and here i was trying to produce my own structure of the REST.

  Hence after a number of searches I did understand that method is correct to access the webservice but it was failing due to the structure which is created by ADF.


2.1 ADF Rest Services 

 I created a simple ADF application and exposed the rest webservices, using be built in feature available in 12c, will post this in a separate thread.  you can download this project from this link and can just modify the database address and then can deploy this application and it will provide the rest service interface for you.


2.2 JET Interaction
     
      Its a normal jet page been created with the navbar, which will give four already built pages, and in this example i haved used the about page to display all the departments coming from the rest webservice.

   

 2.2.1. View (about.html) 

 In the view added the table to display all the departments in the table format. If you observe its a oracle jet component, which is providing the data from the datasource which is bind to the model layer. and from source we are displaying the columns coming as a part of the data source. 




   

2.2.2 Model (about.js)

     This file is the core of the interaction, this file interact with rest webservice and parse it to fit the data.


 



  Line no 5: its the webservice address which is interacted by the rest webservice.

  Line no 18: function been used to traverse the data and add the loop to observable array.

 Line 19 : here datasource been used to bound the data and department id which we are able to see in the html page.


2.2.3 Page 

      Once we run ojet then this is the way page will show all the data from the department rest webservice.





Exercise : 


Please use Employee rest websevice and then display all employee in similar format.









Comments

yihyabachmann said…
Casino Slot Machines - Mapyro
The casino slot machine is a very versatile, compact, portable game system. These machines are perfect for 동두천 출장샵 placing bets 목포 출장안마 on 경주 출장샵 anything from slot games 여수 출장안마 to  Rating: 4 하남 출장샵 · ‎2 votes

Popular posts from this blog

Executing a method bindings In Bean method.

Using Java Decompiler(JD) with Oracle Jdeveloper (Jdev)

Current Date in ADF.