SlideShare a Scribd company logo
1 of 15
Download to read offline
D3 Web Application: Tutorial

       Gilles Dodinet
 g.dodinet@karmicsoft.com



 D3 developer workshop, Luxembourg, 2008, May, 5-6
Technologies
• Used in D3
   –   Hibernate 3.x – Object Relational Mapping 
   –   Spring 2.x – Configuration and component wiring 
   –   JAXRPC 1.1 – WS interaction
   –   JSP 2.0 – Server scripting
   –   Javascript 1.4 – Client scripting
   –   Ajax - Client-server interaction
   –   ExtJS 1.1– Client components
• Used in this tutorial
   – Spring, JSP, Javascript, Ajax, ExtJS, JUnit


                       D3 developer workshop              2
Goal of this tutorial
• Modify a  D3 view and add a new client 
  action
• The action will call an « Echo » (Model 
  2) controller  through Ajax




                D3 developer workshop    3
Roadmap
• Add a new button in the « Job » view
• Create a server controller 
• Test the controller
• Declare the controller in the Spring 
  configuration
• Create a JSP view
• Implement the client action

                D3 developer workshop         4
Task 1: Add a new button
• Open the « jobs » view
   – remoting/jobs-content.jsp
• Open the grid creation script
   – static/jobs.js
• In the script locate the toolbar creation funtion
   – createToolbar
• Modify the toolbar and add a button that only 
  displays a simple alert for now
     handler: function() { alert(‘CLICKED’); } 
• Quickly test your view

                      D3 developer workshop        5
Task 2: create an « Echo » controller
 • Create a new package named
      org.decisiondeck.web.tutorial.controller
 • In this package create a new class named 
   EchoController that implements
      org.springframework.web.servlet.mvc.Controller
 • Implement the method defined in the parent 
   interface handleRequest(..): ModelAndView
      msg = request.getParameter("message");
      return new ModelAndView("tutorial/echo", "msg", msg);



                       D3 developer workshop                  6
Task 4: test the controller
• Create a new JUnit (4.x) TestCase
• Create a new test
• Create a Mock ServletRequest and 
  Mock ServletResponse
   EasyMock.createMock(HttpServletRequest.class);
• Instantiate your controller
• Call the handleRequest method
• Verify your assertions

                  D3 developer workshop         7
Task 4: source
request = createMock(HttpServletRequest.class);
expect(request.getParameter("message")).
                          andReturn("My Message");
response = createMock(HttpServletResponse.class);
replay(request);
ModelAndView mv =
          controller.handleRequest(request, response);
verify(request);
Assert.assertNotNull(mv.getModel ().get("msg"));
Assert.assertEquals("My Message", mv.getModel().get("msg"));



                      D3 developer workshop             8
Task 5: declare the controller
• Open the following Spring configuration file:
   – WEB-INF/remoting-servlet.xml
• Add a controller to the list  of configured  
  controllers
   <bean name="echo" 
     class="org.decisiondeck.web.tutorial.controller.EchoController" /
     >
• Declare a new url mapping
   <prop key="/tutorial/echo.do">echo</prop>



                           D3 developer workshop                   9
Task 6: create a JSP view
• This view only contains a JSON 
  formatted string
  {
      echo: ‘${msg}’
  }

• Point your browser to:
  http://localhost:8080/d3/tutorial/echo.do?message=testing

• You should see the following: 
  { echo: 'testing' } 
                         D3 developer workshop                10
Task 7: implement the client action
• Now you can replace the stub handler with 
  the real implementation – an Ajax request
  Ext.Ajax.request({
     url: ‘../tutorial/echo.do’,
     success: function(response) {
        var o = Ext.decode(response.responseText);
        Ext.MessageBox.alert(‘success’, o.echo);
     },
     failure: function (response) {
        Ext.MessageBox.alert(‘error’, ‘FAILED’);
     },
     params: {
        message: ‘testing’
     }
  });
                              D3 developer workshop   11
Task 7bis: refine the client action
• You could also prompt the user for the 
  input string
 Ext.MessageBox.prompt(
     ‘echoing…’,
     ‘What’s your pet name ?’,
      function(btn, text) {
           if ( btn == ‘ok’ ) {
              doAjaxCall(text);
           }
      } );




                            D3 developer workshop   12
Expected result




D3 developer workshop   13
A step further: homework
• Call the webservice you (eventually) 
  developed earlier
• Several possibilities
  – Manual coding (see ProblemSubmitter)
  – Code generation (e.g. using Axis) based on 
    WSDL
• http://ws.apache.org/axis2

                 D3 developer workshop       14
D3 developer workshop   15

More Related Content

What's hot

Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsLudmila Nesvitiy
 
Dependency Injection @ AngularJS
Dependency Injection @ AngularJSDependency Injection @ AngularJS
Dependency Injection @ AngularJSRan Mizrahi
 
An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications Rohan Chandane
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFXHendrik Ebbers
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit TestChiew Carol
 
MeetJS Summit 2016: React.js enlightenment
MeetJS Summit 2016: React.js enlightenmentMeetJS Summit 2016: React.js enlightenment
MeetJS Summit 2016: React.js enlightenmentArtur Szott
 
Unit and functional testing with Siesta
Unit and functional testing with SiestaUnit and functional testing with Siesta
Unit and functional testing with SiestaGrgur Grisogono
 
Adventures In JavaScript Testing
Adventures In JavaScript TestingAdventures In JavaScript Testing
Adventures In JavaScript TestingThomas Fuchs
 
Javascript Test Automation Workshop (21.08.2014)
Javascript Test Automation Workshop (21.08.2014)Javascript Test Automation Workshop (21.08.2014)
Javascript Test Automation Workshop (21.08.2014)Deutsche Post
 
Making Django and NoSQL Play Nice
Making Django and NoSQL Play NiceMaking Django and NoSQL Play Nice
Making Django and NoSQL Play NiceAlex Gaynor
 
Parse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksParse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksHector Ramos
 
ReactJs presentation
ReactJs presentationReactJs presentation
ReactJs presentationnishasowdri
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architectureGabriele Falace
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JSMichael Haberman
 
Odoo Experience 2018 - The Odoo JS Framework
Odoo Experience 2018 - The Odoo JS FrameworkOdoo Experience 2018 - The Odoo JS Framework
Odoo Experience 2018 - The Odoo JS FrameworkElínAnna Jónasdóttir
 

What's hot (20)

Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
 
Dependency Injection @ AngularJS
Dependency Injection @ AngularJSDependency Injection @ AngularJS
Dependency Injection @ AngularJS
 
Node
NodeNode
Node
 
An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications
 
Vuejs testing
Vuejs testingVuejs testing
Vuejs testing
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFX
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit Test
 
iOS testing
iOS testingiOS testing
iOS testing
 
MeetJS Summit 2016: React.js enlightenment
MeetJS Summit 2016: React.js enlightenmentMeetJS Summit 2016: React.js enlightenment
MeetJS Summit 2016: React.js enlightenment
 
Unit and functional testing with Siesta
Unit and functional testing with SiestaUnit and functional testing with Siesta
Unit and functional testing with Siesta
 
Adventures In JavaScript Testing
Adventures In JavaScript TestingAdventures In JavaScript Testing
Adventures In JavaScript Testing
 
Javascript Test Automation Workshop (21.08.2014)
Javascript Test Automation Workshop (21.08.2014)Javascript Test Automation Workshop (21.08.2014)
Javascript Test Automation Workshop (21.08.2014)
 
Making Django and NoSQL Play Nice
Making Django and NoSQL Play NiceMaking Django and NoSQL Play Nice
Making Django and NoSQL Play Nice
 
Parse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksParse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & Tricks
 
Ngrx meta reducers
Ngrx meta reducersNgrx meta reducers
Ngrx meta reducers
 
ReactJs presentation
ReactJs presentationReactJs presentation
ReactJs presentation
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architecture
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JS
 
Angular 2 introduction
Angular 2 introductionAngular 2 introduction
Angular 2 introduction
 
Odoo Experience 2018 - The Odoo JS Framework
Odoo Experience 2018 - The Odoo JS FrameworkOdoo Experience 2018 - The Odoo JS Framework
Odoo Experience 2018 - The Odoo JS Framework
 

Viewers also liked

indesign_cs3_scripting_tutorial
indesign_cs3_scripting_tutorialindesign_cs3_scripting_tutorial
indesign_cs3_scripting_tutorialtutorialsruby
 
Perl%20SYLLABUS%20PB
Perl%20SYLLABUS%20PBPerl%20SYLLABUS%20PB
Perl%20SYLLABUS%20PBtutorialsruby
 
Perl%20Tutorial.!Picking%20Up%20Perl
Perl%20Tutorial.!Picking%20Up%20PerlPerl%20Tutorial.!Picking%20Up%20Perl
Perl%20Tutorial.!Picking%20Up%20Perltutorialsruby
 
A Quick and Dirty D3.js Tutorial
A Quick and Dirty D3.js TutorialA Quick and Dirty D3.js Tutorial
A Quick and Dirty D3.js TutorialYoung-Ho Kim
 
Data visualisation with D3
Data visualisation with D3Data visualisation with D3
Data visualisation with D3Florian Evéquoz
 
Hi there everyone (text for change the world) 2016
Hi there everyone (text for change the world) 2016Hi there everyone (text for change the world) 2016
Hi there everyone (text for change the world) 2016amir milo
 
TRABALHO MARISA - CATÁLOGO
TRABALHO MARISA - CATÁLOGOTRABALHO MARISA - CATÁLOGO
TRABALHO MARISA - CATÁLOGOLuciana Holanda
 
Brochure Change Et Al
Brochure Change Et AlBrochure Change Et Al
Brochure Change Et AlChange Et Al.
 
Php和My Sql Web开发(原书第三版)
Php和My Sql Web开发(原书第三版)Php和My Sql Web开发(原书第三版)
Php和My Sql Web开发(原书第三版)yiditushe
 
Swacchata Marathi Bestseller Dr. Shriniwas Kashalikar
Swacchata Marathi Bestseller Dr. Shriniwas KashalikarSwacchata Marathi Bestseller Dr. Shriniwas Kashalikar
Swacchata Marathi Bestseller Dr. Shriniwas Kashalikardrsolapurkar
 
Hypocrite Dr. Shriniwas Kashalikar
Hypocrite Dr. Shriniwas KashalikarHypocrite Dr. Shriniwas Kashalikar
Hypocrite Dr. Shriniwas Kashalikardrsolapurkar
 
jaijith doha resume
jaijith doha resumejaijith doha resume
jaijith doha resumeJaijith Mg
 
由一个简单的程序谈起――之二
由一个简单的程序谈起――之二由一个简单的程序谈起――之二
由一个简单的程序谈起――之二yiditushe
 

Viewers also liked (16)

indesign_cs3_scripting_tutorial
indesign_cs3_scripting_tutorialindesign_cs3_scripting_tutorial
indesign_cs3_scripting_tutorial
 
Perl%20SYLLABUS%20PB
Perl%20SYLLABUS%20PBPerl%20SYLLABUS%20PB
Perl%20SYLLABUS%20PB
 
Avik_RailsTutorial
Avik_RailsTutorialAvik_RailsTutorial
Avik_RailsTutorial
 
Perl%20Tutorial.!Picking%20Up%20Perl
Perl%20Tutorial.!Picking%20Up%20PerlPerl%20Tutorial.!Picking%20Up%20Perl
Perl%20Tutorial.!Picking%20Up%20Perl
 
Introduction to D3
Introduction to D3Introduction to D3
Introduction to D3
 
A Quick and Dirty D3.js Tutorial
A Quick and Dirty D3.js TutorialA Quick and Dirty D3.js Tutorial
A Quick and Dirty D3.js Tutorial
 
Data visualisation with D3
Data visualisation with D3Data visualisation with D3
Data visualisation with D3
 
Hi there everyone (text for change the world) 2016
Hi there everyone (text for change the world) 2016Hi there everyone (text for change the world) 2016
Hi there everyone (text for change the world) 2016
 
TRABALHO MARISA - CATÁLOGO
TRABALHO MARISA - CATÁLOGOTRABALHO MARISA - CATÁLOGO
TRABALHO MARISA - CATÁLOGO
 
Brochure Change Et Al
Brochure Change Et AlBrochure Change Et Al
Brochure Change Et Al
 
Php和My Sql Web开发(原书第三版)
Php和My Sql Web开发(原书第三版)Php和My Sql Web开发(原书第三版)
Php和My Sql Web开发(原书第三版)
 
Potencialidades Turisticas em Alcochete
Potencialidades Turisticas em AlcochetePotencialidades Turisticas em Alcochete
Potencialidades Turisticas em Alcochete
 
Swacchata Marathi Bestseller Dr. Shriniwas Kashalikar
Swacchata Marathi Bestseller Dr. Shriniwas KashalikarSwacchata Marathi Bestseller Dr. Shriniwas Kashalikar
Swacchata Marathi Bestseller Dr. Shriniwas Kashalikar
 
Hypocrite Dr. Shriniwas Kashalikar
Hypocrite Dr. Shriniwas KashalikarHypocrite Dr. Shriniwas Kashalikar
Hypocrite Dr. Shriniwas Kashalikar
 
jaijith doha resume
jaijith doha resumejaijith doha resume
jaijith doha resume
 
由一个简单的程序谈起――之二
由一个简单的程序谈起――之二由一个简单的程序谈起――之二
由一个简单的程序谈起――之二
 

Similar to D3_Tuto_GD

A To-do Web App on Google App Engine
A To-do Web App on Google App EngineA To-do Web App on Google App Engine
A To-do Web App on Google App EngineMichael Parker
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09Daniel Bryant
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
Necto 16 training 20 component mode &amp; java script
Necto 16 training 20   component mode &amp; java scriptNecto 16 training 20   component mode &amp; java script
Necto 16 training 20 component mode &amp; java scriptPanorama Software
 
27 - Panorama Necto 14 component mode & java script - visualization & data di...
27 - Panorama Necto 14 component mode & java script - visualization & data di...27 - Panorama Necto 14 component mode & java script - visualization & data di...
27 - Panorama Necto 14 component mode & java script - visualization & data di...Panorama Software
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UITech OneStop
 
Testing Legacy Rails Apps
Testing Legacy Rails AppsTesting Legacy Rails Apps
Testing Legacy Rails AppsRabble .
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsSoós Gábor
 
Introduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comIntroduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comVan-Duyet Le
 
Soa development using javascript
Soa development using javascriptSoa development using javascript
Soa development using javascriptDsixE Inc
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkIndicThreads
 
Scala based Lift Framework
Scala based Lift FrameworkScala based Lift Framework
Scala based Lift Frameworkvhazrati
 
Java EE 7 Recipes for Concurrency - JavaOne 2014
Java EE 7 Recipes for Concurrency - JavaOne 2014Java EE 7 Recipes for Concurrency - JavaOne 2014
Java EE 7 Recipes for Concurrency - JavaOne 2014Josh Juneau
 
Introducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsIntroducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsRichard Rodger
 

Similar to D3_Tuto_GD (20)

A To-do Web App on Google App Engine
A To-do Web App on Google App EngineA To-do Web App on Google App Engine
A To-do Web App on Google App Engine
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Necto 16 training 20 component mode &amp; java script
Necto 16 training 20   component mode &amp; java scriptNecto 16 training 20   component mode &amp; java script
Necto 16 training 20 component mode &amp; java script
 
27 - Panorama Necto 14 component mode & java script - visualization & data di...
27 - Panorama Necto 14 component mode & java script - visualization & data di...27 - Panorama Necto 14 component mode & java script - visualization & data di...
27 - Panorama Necto 14 component mode & java script - visualization & data di...
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
 
Testing Legacy Rails Apps
Testing Legacy Rails AppsTesting Legacy Rails Apps
Testing Legacy Rails Apps
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
os-php-wiki5-a4
os-php-wiki5-a4os-php-wiki5-a4
os-php-wiki5-a4
 
os-php-wiki5-a4
os-php-wiki5-a4os-php-wiki5-a4
os-php-wiki5-a4
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
 
Introduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comIntroduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.com
 
Soa development using javascript
Soa development using javascriptSoa development using javascript
Soa development using javascript
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Overview Of Lift Framework
Overview Of Lift FrameworkOverview Of Lift Framework
Overview Of Lift Framework
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
 
Scala based Lift Framework
Scala based Lift FrameworkScala based Lift Framework
Scala based Lift Framework
 
Java EE 7 Recipes for Concurrency - JavaOne 2014
Java EE 7 Recipes for Concurrency - JavaOne 2014Java EE 7 Recipes for Concurrency - JavaOne 2014
Java EE 7 Recipes for Concurrency - JavaOne 2014
 
Introducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsIntroducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.js
 

More from tutorialsruby

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 

More from tutorialsruby (20)

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

D3_Tuto_GD

  • 1. D3 Web Application: Tutorial Gilles Dodinet g.dodinet@karmicsoft.com D3 developer workshop, Luxembourg, 2008, May, 5-6
  • 2. Technologies • Used in D3 – Hibernate 3.x – Object Relational Mapping  – Spring 2.x – Configuration and component wiring  – JAXRPC 1.1 – WS interaction – JSP 2.0 – Server scripting – Javascript 1.4 – Client scripting – Ajax - Client-server interaction – ExtJS 1.1– Client components • Used in this tutorial – Spring, JSP, Javascript, Ajax, ExtJS, JUnit D3 developer workshop 2
  • 3. Goal of this tutorial • Modify a  D3 view and add a new client  action • The action will call an « Echo » (Model  2) controller  through Ajax D3 developer workshop 3
  • 4. Roadmap • Add a new button in the « Job » view • Create a server controller  • Test the controller • Declare the controller in the Spring  configuration • Create a JSP view • Implement the client action D3 developer workshop 4
  • 5. Task 1: Add a new button • Open the « jobs » view – remoting/jobs-content.jsp • Open the grid creation script – static/jobs.js • In the script locate the toolbar creation funtion – createToolbar • Modify the toolbar and add a button that only  displays a simple alert for now handler: function() { alert(‘CLICKED’); }  • Quickly test your view D3 developer workshop 5
  • 6. Task 2: create an « Echo » controller • Create a new package named org.decisiondeck.web.tutorial.controller • In this package create a new class named  EchoController that implements org.springframework.web.servlet.mvc.Controller • Implement the method defined in the parent  interface handleRequest(..): ModelAndView msg = request.getParameter("message"); return new ModelAndView("tutorial/echo", "msg", msg); D3 developer workshop 6
  • 7. Task 4: test the controller • Create a new JUnit (4.x) TestCase • Create a new test • Create a Mock ServletRequest and  Mock ServletResponse EasyMock.createMock(HttpServletRequest.class); • Instantiate your controller • Call the handleRequest method • Verify your assertions D3 developer workshop 7
  • 8. Task 4: source request = createMock(HttpServletRequest.class); expect(request.getParameter("message")). andReturn("My Message"); response = createMock(HttpServletResponse.class); replay(request); ModelAndView mv = controller.handleRequest(request, response); verify(request); Assert.assertNotNull(mv.getModel ().get("msg")); Assert.assertEquals("My Message", mv.getModel().get("msg")); D3 developer workshop 8
  • 9. Task 5: declare the controller • Open the following Spring configuration file: – WEB-INF/remoting-servlet.xml • Add a controller to the list  of configured   controllers <bean name="echo"  class="org.decisiondeck.web.tutorial.controller.EchoController" / > • Declare a new url mapping <prop key="/tutorial/echo.do">echo</prop> D3 developer workshop 9
  • 10. Task 6: create a JSP view • This view only contains a JSON  formatted string { echo: ‘${msg}’ } • Point your browser to: http://localhost:8080/d3/tutorial/echo.do?message=testing • You should see the following:  { echo: 'testing' }  D3 developer workshop 10
  • 11. Task 7: implement the client action • Now you can replace the stub handler with  the real implementation – an Ajax request Ext.Ajax.request({ url: ‘../tutorial/echo.do’, success: function(response) { var o = Ext.decode(response.responseText); Ext.MessageBox.alert(‘success’, o.echo); }, failure: function (response) { Ext.MessageBox.alert(‘error’, ‘FAILED’); }, params: { message: ‘testing’ } }); D3 developer workshop 11
  • 12. Task 7bis: refine the client action • You could also prompt the user for the  input string Ext.MessageBox.prompt( ‘echoing…’, ‘What’s your pet name ?’, function(btn, text) { if ( btn == ‘ok’ ) { doAjaxCall(text); } } ); D3 developer workshop 12
  • 14. A step further: homework • Call the webservice you (eventually)  developed earlier • Several possibilities – Manual coding (see ProblemSubmitter) – Code generation (e.g. using Axis) based on  WSDL • http://ws.apache.org/axis2 D3 developer workshop 14