SlideShare a Scribd company logo
1 of 22
CITYSEARCH
SAMPLE OF CONFIGURATION FLOW USING A DB CONNECTOR AND
BUILD APPLICATION WITH ANYPOINTSTUDIO.
CREATE BY GIUSEPPE FIORE
MULESOFT TRAINING
Through this example you will be ablo to:
1) Connect your application with database oracle
2) Create Table oracle
3) Custom Java Class for get value from JSON Object
4) Configure the component AnyPointStudio
1) Run Application with AnyPointStudio
CREATE BY GIUSEPPE FIORE
Application Search City
Our application will be able to provide the list of city (stored on database
oracle) choosing a country from web application.
Example:
DB
CREATE BY GIUSEPPE FIORE
Create Table Oracle
CREATE TABLE CITY
(
CODE VARCHAR2(254 BYTE),
CITY VARCHAR2(254 BYTE),
COUNTRY VARCHAR2(254 BYTE)
);
Insert into CITY (CODE, CITY, COUNTRY) Values ('NAP', 'NAPOLI', 'ITALY');
Insert into CITY (CODE, CITY, COUNTRY) Values ('ROM', 'ROMA', 'ITALY');
Insert into CITY (CODE, CITY, COUNTRY) Values ('FIR', 'FIRENZE', 'ITALY');
Insert into CITY (CODE, CITY, COUNTRY) Values ('NY', 'NEW YORK', 'USA');
Insert into CITY (CODE, CITY, COUNTRY) Values ('WAS', 'WASHINGTON', 'USA');
Insert into CITY (CODE, CITY, COUNTRY) Values ('BS', 'BOSTON', 'USA');
CREATE BY GIUSEPPE FIORE
Create Template HTML
https://drive.google.com/folderview?id=0BwcFnStGY0u4U095b0hIU2Q0UE0&usp=sharing
The template HTML use JSON object
to send result, throught ajax call, at
flow mulesoft:
Preview
You can get the template HTML here:
ajaxRequest.open("POST", "/citysearch", true);
ajaxRequest.setRequestHeader("Content-type",
"application/json");
ajaxRequest.send(formData);
var jsonObject = {"destination" :
destinationMenu.options[destinationMenu.selectedIndex].value};
var formData = JSON.stringify(jsonObject);
CREATE BY GIUSEPPE FIORE
Create Java Bean
https://drive.google.com/folderview?id=0BwcFnStGY0u4U095b0hIU2Q0UE0&usp=sharing
You can get the Java Bean here:
Create the following java bean:
 CityRequest.java: The java bean will store the value present into JSON object.
 City.java: The java bean will store the record extract on database.
jsonObject = {"destination": ITALY}
CityRequest
• Destination = «ITALY»
HASHMAP
{CODE=NAP, COUNTRY=ITALY, CITY=NAPOLI}
{CODE=ROM, COUNTRY=ITALY, CITY=ROMA}
{CODE=FIR, COUNTRY=ITALY, CITY=FIRENZE}
CREATE BY GIUSEPPE FIORE
Package Explorer
Copy the beans and the template HTML like show in the following image:
CREATE BY GIUSEPPE FIORE
Create a new project
Copy the beans and the template HTML like show in the follow
Create a new project «searchcity»
CREATE BY GIUSEPPE FIORE
Global Element: HTTP Listener
Creating the listener and specify the url of configuration for start ours application:
 Host: localhost (127.0.0.1)
 Port: 8081
CREATE BY GIUSEPPE FIORE
Global Element: Oracle Configuration
Creating the oracle configuration and specify the parameters of configuration for connect your application to database
oracle:
 Host: localhost (127.0.0.1)
 Port: 1521
 Instance: city
 User: city
 Password: city
CREATE BY GIUSEPPE FIORE
Flow getTemplate: 1 - HTTP Element
Start the flow getTemplate insert the first element HTTP like show in the following image:
CREATE BY GIUSEPPE FIORE
 Connector Configuration: Set the connector configuration like show in the slide 9
 Path: Use the string «citysearch»
 Allowed Methods: GET
Flow getTemplate: 2 - Parse Template Element
Continue the flow getTemplate insert the Parse Template like show in the following image:
CREATE BY GIUSEPPE FIORE
 Display Name: Parse template
 Location: Insert your path. You should search the file CityFinder.html into folder src/main/resources
 Allowed Methods: GET
Flow getTemplate: 3 - Final
CREATE BY GIUSEPPE FIORE
Flow getResult: 1 - HTTP Element
CREATE BY GIUSEPPE FIORE
Start the flow getResult insert the first element HTTP like show in the following image:
 Connector Configuration: Set the connector configuration like show in the slide 9
 Path: Use the string «citysearch»
 Allowed Methods: GET
Flow getResult: 2 – JSON to Object
CREATE BY GIUSEPPE FIORE
Continue the flow getResult insert the new element «JSON To Object» like show in the following image:
 Return Class: Configure the class «CityRequest»
Flow getResult: 3 – Set Variable
CREATE BY GIUSEPPE FIORE
Continue the flow getResult insert the new element «Set Variabile» like show in the following image:
Flow getResult: 4 – DATABASE
CREATE BY GIUSEPPE FIORE
Continue the flow getResult insert the new element «DATABASE» like show in the following image:
Flow getResult: 5 – EXPRESSION
CREATE BY GIUSEPPE FIORE
Continue the flow getResult insert the new element «Expression» like show in the following image:
Flow getResult: 6 – LIST<MAP> To Pojo
CREATE BY GIUSEPPE FIORE
Continue the flow getResult insert the new element «LIST<MAP> To Pojo» like show in the following image:
Flow getResult: 7 – Object To JSON
CREATE BY GIUSEPPE FIORE
Start the flow getResult insert the new element «Object To JSON» like show in the following image:
Flow getResult: 8 – Logger
CREATE BY GIUSEPPE FIORE
Finish the flow getResult insert the new element «Logger» like show in the following image:
Run Application
CREATE BY GIUSEPPE FIORE
Click onRun
If status is «Deployed» then you can ready to test your
application!

More Related Content

Similar to CITYSEARCH

Advanced #2 networking
Advanced #2   networkingAdvanced #2   networking
Advanced #2 networkingVitali Pekelis
 
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docxbbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docxikirkton
 
Native Phone Development 101
Native Phone Development 101Native Phone Development 101
Native Phone Development 101Sasmito Adibowo
 
Mobile Augmented Reality Using junaio
Mobile Augmented Reality Using junaioMobile Augmented Reality Using junaio
Mobile Augmented Reality Using junaioMark Billinghurst
 
Asynchronous programming patterns in Perl
Asynchronous programming patterns in PerlAsynchronous programming patterns in Perl
Asynchronous programming patterns in Perldeepfountainconsulting
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCpootsbook
 
[2019 south bay meetup] Building more contextual message with Block Kit
[2019 south bay meetup] Building more contextual message with Block Kit[2019 south bay meetup] Building more contextual message with Block Kit
[2019 south bay meetup] Building more contextual message with Block KitTomomi Imura
 
How we improved performance at Mixbook
How we improved performance at MixbookHow we improved performance at Mixbook
How we improved performance at MixbookAnton Astashov
 
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...confluent
 
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017eMan s.r.o.
 
Web service invocation in mule
Web service invocation in muleWeb service invocation in mule
Web service invocation in muleKrishnakanth Goud
 
Web service invocation in mule
Web service invocation in muleWeb service invocation in mule
Web service invocation in muleAnilKumar Etagowni
 
How I make a podcast website using serverless technology in 2023
How I make a podcast website using serverless technology in 2023How I make a podcast website using serverless technology in 2023
How I make a podcast website using serverless technology in 2023Shengyou Fan
 
Build pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSLBuild pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSLAnton Arhipov
 
Working With a Real-World Dataset in Neo4j: Import and Modeling
Working With a Real-World Dataset in Neo4j: Import and ModelingWorking With a Real-World Dataset in Neo4j: Import and Modeling
Working With a Real-World Dataset in Neo4j: Import and ModelingNeo4j
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastAtlassian
 

Similar to CITYSEARCH (20)

Making flow Mule
Making flow MuleMaking flow Mule
Making flow Mule
 
Advanced #2 networking
Advanced #2   networkingAdvanced #2   networking
Advanced #2 networking
 
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docxbbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
 
Socket.IO
Socket.IOSocket.IO
Socket.IO
 
Native Phone Development 101
Native Phone Development 101Native Phone Development 101
Native Phone Development 101
 
Mobile Augmented Reality Using junaio
Mobile Augmented Reality Using junaioMobile Augmented Reality Using junaio
Mobile Augmented Reality Using junaio
 
Asynchronous programming patterns in Perl
Asynchronous programming patterns in PerlAsynchronous programming patterns in Perl
Asynchronous programming patterns in Perl
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
[2019 south bay meetup] Building more contextual message with Block Kit
[2019 south bay meetup] Building more contextual message with Block Kit[2019 south bay meetup] Building more contextual message with Block Kit
[2019 south bay meetup] Building more contextual message with Block Kit
 
How we improved performance at Mixbook
How we improved performance at MixbookHow we improved performance at Mixbook
How we improved performance at Mixbook
 
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
 
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
 
Web service invocation in mule
Web service invocation in muleWeb service invocation in mule
Web service invocation in mule
 
Web service invocation in mule
Web service invocation in muleWeb service invocation in mule
Web service invocation in mule
 
How I make a podcast website using serverless technology in 2023
How I make a podcast website using serverless technology in 2023How I make a podcast website using serverless technology in 2023
How I make a podcast website using serverless technology in 2023
 
Build pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSLBuild pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSL
 
CARTO ENGINE
CARTO ENGINECARTO ENGINE
CARTO ENGINE
 
Working With a Real-World Dataset in Neo4j: Import and Modeling
Working With a Real-World Dataset in Neo4j: Import and ModelingWorking With a Real-World Dataset in Neo4j: Import and Modeling
Working With a Real-World Dataset in Neo4j: Import and Modeling
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
 
Webservices
WebservicesWebservices
Webservices
 

Recently uploaded

Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringPrakhyath Rai
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Lisi Hocke
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckMarc Lester
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024SimonedeGijt
 
BusinessGPT - Security and Governance for Generative AI
BusinessGPT  - Security and Governance for Generative AIBusinessGPT  - Security and Governance for Generative AI
BusinessGPT - Security and Governance for Generative AIAGATSoftware
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...naitiksharma1124
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...OnePlan Solutions
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit MilanNeo4j
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfWSO2
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMarkus Moeller
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Andrea Goulet
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaNeo4j
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNeo4j
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAShane Coughlan
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...Neo4j
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdfSelfMade bd
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksJinanKordab
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfICS
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Chirag Panchal
 

Recently uploaded (20)

Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
BusinessGPT - Security and Governance for Generative AI
BusinessGPT  - Security and Governance for Generative AIBusinessGPT  - Security and Governance for Generative AI
BusinessGPT - Security and Governance for Generative AI
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024
 

CITYSEARCH

  • 1. CITYSEARCH SAMPLE OF CONFIGURATION FLOW USING A DB CONNECTOR AND BUILD APPLICATION WITH ANYPOINTSTUDIO. CREATE BY GIUSEPPE FIORE MULESOFT TRAINING
  • 2. Through this example you will be ablo to: 1) Connect your application with database oracle 2) Create Table oracle 3) Custom Java Class for get value from JSON Object 4) Configure the component AnyPointStudio 1) Run Application with AnyPointStudio CREATE BY GIUSEPPE FIORE
  • 3. Application Search City Our application will be able to provide the list of city (stored on database oracle) choosing a country from web application. Example: DB CREATE BY GIUSEPPE FIORE
  • 4. Create Table Oracle CREATE TABLE CITY ( CODE VARCHAR2(254 BYTE), CITY VARCHAR2(254 BYTE), COUNTRY VARCHAR2(254 BYTE) ); Insert into CITY (CODE, CITY, COUNTRY) Values ('NAP', 'NAPOLI', 'ITALY'); Insert into CITY (CODE, CITY, COUNTRY) Values ('ROM', 'ROMA', 'ITALY'); Insert into CITY (CODE, CITY, COUNTRY) Values ('FIR', 'FIRENZE', 'ITALY'); Insert into CITY (CODE, CITY, COUNTRY) Values ('NY', 'NEW YORK', 'USA'); Insert into CITY (CODE, CITY, COUNTRY) Values ('WAS', 'WASHINGTON', 'USA'); Insert into CITY (CODE, CITY, COUNTRY) Values ('BS', 'BOSTON', 'USA'); CREATE BY GIUSEPPE FIORE
  • 5. Create Template HTML https://drive.google.com/folderview?id=0BwcFnStGY0u4U095b0hIU2Q0UE0&usp=sharing The template HTML use JSON object to send result, throught ajax call, at flow mulesoft: Preview You can get the template HTML here: ajaxRequest.open("POST", "/citysearch", true); ajaxRequest.setRequestHeader("Content-type", "application/json"); ajaxRequest.send(formData); var jsonObject = {"destination" : destinationMenu.options[destinationMenu.selectedIndex].value}; var formData = JSON.stringify(jsonObject); CREATE BY GIUSEPPE FIORE
  • 6. Create Java Bean https://drive.google.com/folderview?id=0BwcFnStGY0u4U095b0hIU2Q0UE0&usp=sharing You can get the Java Bean here: Create the following java bean:  CityRequest.java: The java bean will store the value present into JSON object.  City.java: The java bean will store the record extract on database. jsonObject = {"destination": ITALY} CityRequest • Destination = «ITALY» HASHMAP {CODE=NAP, COUNTRY=ITALY, CITY=NAPOLI} {CODE=ROM, COUNTRY=ITALY, CITY=ROMA} {CODE=FIR, COUNTRY=ITALY, CITY=FIRENZE} CREATE BY GIUSEPPE FIORE
  • 7. Package Explorer Copy the beans and the template HTML like show in the following image: CREATE BY GIUSEPPE FIORE
  • 8. Create a new project Copy the beans and the template HTML like show in the follow Create a new project «searchcity» CREATE BY GIUSEPPE FIORE
  • 9. Global Element: HTTP Listener Creating the listener and specify the url of configuration for start ours application:  Host: localhost (127.0.0.1)  Port: 8081 CREATE BY GIUSEPPE FIORE
  • 10. Global Element: Oracle Configuration Creating the oracle configuration and specify the parameters of configuration for connect your application to database oracle:  Host: localhost (127.0.0.1)  Port: 1521  Instance: city  User: city  Password: city CREATE BY GIUSEPPE FIORE
  • 11. Flow getTemplate: 1 - HTTP Element Start the flow getTemplate insert the first element HTTP like show in the following image: CREATE BY GIUSEPPE FIORE  Connector Configuration: Set the connector configuration like show in the slide 9  Path: Use the string «citysearch»  Allowed Methods: GET
  • 12. Flow getTemplate: 2 - Parse Template Element Continue the flow getTemplate insert the Parse Template like show in the following image: CREATE BY GIUSEPPE FIORE  Display Name: Parse template  Location: Insert your path. You should search the file CityFinder.html into folder src/main/resources  Allowed Methods: GET
  • 13. Flow getTemplate: 3 - Final CREATE BY GIUSEPPE FIORE
  • 14. Flow getResult: 1 - HTTP Element CREATE BY GIUSEPPE FIORE Start the flow getResult insert the first element HTTP like show in the following image:  Connector Configuration: Set the connector configuration like show in the slide 9  Path: Use the string «citysearch»  Allowed Methods: GET
  • 15. Flow getResult: 2 – JSON to Object CREATE BY GIUSEPPE FIORE Continue the flow getResult insert the new element «JSON To Object» like show in the following image:  Return Class: Configure the class «CityRequest»
  • 16. Flow getResult: 3 – Set Variable CREATE BY GIUSEPPE FIORE Continue the flow getResult insert the new element «Set Variabile» like show in the following image:
  • 17. Flow getResult: 4 – DATABASE CREATE BY GIUSEPPE FIORE Continue the flow getResult insert the new element «DATABASE» like show in the following image:
  • 18. Flow getResult: 5 – EXPRESSION CREATE BY GIUSEPPE FIORE Continue the flow getResult insert the new element «Expression» like show in the following image:
  • 19. Flow getResult: 6 – LIST<MAP> To Pojo CREATE BY GIUSEPPE FIORE Continue the flow getResult insert the new element «LIST<MAP> To Pojo» like show in the following image:
  • 20. Flow getResult: 7 – Object To JSON CREATE BY GIUSEPPE FIORE Start the flow getResult insert the new element «Object To JSON» like show in the following image:
  • 21. Flow getResult: 8 – Logger CREATE BY GIUSEPPE FIORE Finish the flow getResult insert the new element «Logger» like show in the following image:
  • 22. Run Application CREATE BY GIUSEPPE FIORE Click onRun If status is «Deployed» then you can ready to test your application!