SlideShare a Scribd company logo
1 of 23
Download to read offline
Getting started with
      Dojo Toolkit
             Cologne.js
User Group Meeting, Cologne (@cowoco)

            Thomas Koch
            (@tomy_koch)

           10. August 2010
Dojo Toolkit: About
• Dojo is JS Framework
      – Pure client-side JS (in contrast to GWT etc.)
      – Includes Dev.Tools: build, test
      – Open source, active community
        http://www.dojotoolkit.org/
• Dojo features
      –      OO-style class based development
      –      Modularisation (via concept of packages)
      –      Support for data and GUI  MVC
      –      Wide range of builtin widgets

10.08.2010                       Thomas Koch            2
Dojo Toolkit: Features
• Development: APIs for robust Web Applications
      – Event handling, DOM manipulation
      – CSS Querying, Animations, …
• Communication: Ajax and even more
      – Data abstraction layer, JSON-RPC, Comet, XMPP etc.
• Integration: with many server-side developments
      – including DWR, Django, TurboGears, Google, Jaxer …
• User interface: re-usable gui components
      –      Standard gui widgets (button, slider, table, tree, menu …)
      –      vector graphics, charting, …
      –      theming, drag’n drop, …
      –      i18N, a11y

• Widely used: Dojo Widgets (aka Dijits)


10.08.2010                                  Thomas Koch                   3
Dojo Sneak Preview: Theme Tester




10.08.2010     Thomas Koch          4
Dojo quick-start

   GETTING STARTED


10.08.2010            Thomas Koch   5
Basic Dojo Page
• minimal Dojo
    – load the dojo base stuff: dojo.js
    – define a config (optional!)
             • djConfig : dictionary used by dojo bootstrap process
                – Locale, debug, baseURL, parseOnLoad, …

• Example
         <html><head><title>Dojo Demo</title>
         <script type="text/javascript" src="dojo/dojo.js"
                djConfig="isDebug:true">
         </script></head>
         <body><p>Hello Dojo</p></body>
         </html>
10.08.2010                           Thomas Koch                      6
Document Life-Cycle
• OnLoad/unLoad Handler
    – dojo.addOnLoad(<functionname>)
             • defers script execution until all HTML is loaded
    – vice versa: addOnUnload()
• Example
        <script type="text/javascript">
          function showVersion() {
            var node = dojo.byId("demo");
            node.innerHTML = "Dojo"+dojo.version;
          }
          dojo.addOnLoad(showVersion);
        </script>
        <body>
        <div id="demo"></div>
10.08.2010                           Thomas Koch                  7
Dojo Base
• Foundation of Dojo Framework: dojo.js
    – Implements Browser detection & Package loading
          • import/packaging-concept via dojo.declare / dojo.require
    – Provides DOM Manipulation and CSS query engine
• Browser sniffing
    – dojo.isFF, dojo.isIE
    – dojo.isOpera, dojo.isSafari
    – dojo.isAir
• Dojo.is<Browser> (global variable!)
    – IS version of browser
    – OR undefined
          >>> dojo.isFF
          3.5
  10.08.2010                             Thomas Koch                   8
DOM Manipulation
• DOM Lookup
     – node = dojo.byId("id")  returns a DOM node
             • Similar to document.getElementById("id")
     – Watch out: dijit.byId("id")  returns a Dijit widget instance!
• DOM Insert/Edit
     – dojo.create() & dojo.place()
             var img = dojo.create("img"‚ ,src:"a.gif", alt:"demo" });
             dojo.place(img, node, "after");
             OR: dojo.create("img"‚ ,src:"a.gif", alt:"demo" }, node, "after");
• Dom Manipulation: cleanup
     – dojo.destroy(node)
     – dojo.empty(node)
10.08.2010                               Thomas Koch                              9
Dojo Base : Querying
• CSS query engine
    – dojo.query("img")  returns NodeList
             • Similar to document.getElementsByTagName("IMG");
    – nodelist = dojo.query(String query, String?|Node? root)
             • Query: CSS3-Selektor http://www.w3.org/TR/css3-selectors
    – Examples
             • dojo.query(".progressIndicator"); // Query by css class.
             • dojo.query(„div#demo"); // Query by node type and id
             • dojo.query(„a*href*=‚www.bscw.de‘+"); // Query attributes
• NodeList
    – Subclass of Array with special extensions:
             • every, forEach ,filter, concat, splice, addClass,removeClass…
10.08.2010                            Thomas Koch                              10
Dojo Base : CSS
• CSS styling
     – Assign CSS classes
              • dojo.addClass(node,clsStr) , removeClass, toggleClass, hasClass
     – Assign CSS styles
              • dojo.style(DOMnode|String node, String|Object style, String val)
              • Example
                  var box = dojo.byId(„bannerTop“);
                  dojo.style(box, {height : „100px“, width: „200px“-);
                  <= => dojo.style(„bannerTop“, …);
              • dojo.attr(DOMnode|String node, String name, String value)
              • Example
                  var img = dojo.byId(„logo1“);
                  dojo.attr(img, „alt“, „OrbiTeam“);


 10.08.2010                                   Thomas Koch                          11
Dojo hands-on

   PRACTICAL EXAMPLE


10.08.2010         Thomas Koch   12
Examples - code available at
 http://code.google.com/p/dojodemo/
• 1. Simple dojo page
      –      Browser sniffing
      –      DOM Manipulation
      –      CSS Querying
      –      onLoad-Handler
• 2. Use of dijits
      –      dojo.require
      –      dojoType magic
      –      Dijit properties
      –      Data layer
• 3. Define your own dijit
      – dojo.provide / dojo.declare
      – dijit.Widget / dijit.Templated

10.08.2010                        Thomas Koch   13
The big picture

   DOJO BUILDING BLOCKS


10.08.2010           Thomas Koch   14
Dojo Architecture
• Dojo consists of …
      – Base
             • Foundation of everything else: packaging,
               loading, DOM manipulation
      – Core
             • Widget parser, animations,
               drag‘n drop, i18n …
      – Dijit
             • Dijits = Dojo Widgets:
                portable widgets
               (progress bar, menu, editor, …)
      – DojoX
             • Dojo eXtensions: stable and
                experimental widgets
               (like Charting, Grid, FishEye)
      – Util
             • Dojo Build System, ShrinkSafe,
               Checkstyle, API Doc System
10.08.2010                                      Thomas Koch   15
Dojo Base
• Basic Toolset
    –   Array Utilities                    (dojo.filter, dojo.forEach …)
    –   Language Utilities                 (dojo.hitch, dojo.isString …)
    –   OO Utilities                       (declare, mixin, extend ...)
    –   Event-System                       (publish, subscribe)
    –   Ajax / IO                          (dojo.xhr)
• Furthermore …
    – Animations
    – String Utilities, JSON Tools                 (fromJSON, toJSON, …)
    – Misc: Colors,Keys, global, eval



  10.08.2010                       Thomas Koch                             16
Dojo Core
• Extends Dojo Base Framework
   – Contains everything from dojo-Namespace
     that needs import, e.g. dojo.require(„dojo.date“)
• Important Components
   –   dojo.dnd:       Drag and Drop
   –   dojo.i18n:      Internationalization Utility
   –   dojo.rpc: Remote Procedure Calls with Backend Servers
   –   dojo.data:      a uniform data access layer
• Furthermore contains…
   –   dojo.fx:         Effects library on top of Base animations
   –   dojo.gears:      Google Gears
   –   dojo.io:         Additional AJAX I/O transports
   –   dojo.html:       Inserting contents in HTML nodes
   –   Misc: dojo.currency, dojo.date, dojo.number, dojo.regexp etc.

                                 Thomas Koch      10.08.2010           17
Dojo Unified Events
• Publish/Subscribe communication
• connect a function of your own to:
    –   a DOM event, such as when a link is clicked
    –   an event of an object, such as an animation starting
    –   a topic, which other objects can publish objects to
    –   function call of your own, such as bar();
• Methods
    – dojo.[dis]connect(), dojo.publish, dojo.subscribe()
• Example        var foo = dojo.byId("foo"); // anchor element
                 dojo.connect(foo, "onclick", function(evt) {
                     console.log("anchor clicked");
                     dojo.stopEvent(evt); //suppress navigation
 10.08.2010                   Thomas Koch                     18
                 });
Further Information on Dojo

   DOJO RELATED


10.08.2010                       Thomas Koch   19
Dojo Documentation
• API Docs
      – Online Documentation : http://dojotoolkit.org/api/
• Dojo Campus
      – Articles, Tutorials, Feature Explorer … http://dojocampus.org
• Blogs
      – Dojo Project Blog
             • http://dojotoolkit.org/blog/
      – SitePen Blog
             • http://www.sitepen.com/blog
      – Shane O’Sullivan’s technical blog
             • http://shaneosullivan.wordpress.com/
• Books
      – Russell, Matthew A.
             • Dojo: The Definitive Guide
      – Riecke, C.; Gill, R.; Russell, A.
             • Mastering Dojo:
      – Zammetti, Frank
10.08.2010
             •   Practical Dojo Projects      Thomas Koch               20
Dojo Performance
• Dojo Performs Better (DOM Manipulation!)
      – Dojo is 1.5-2x faster than jQuery, and the difference is
        biggest on the slowest browsers — where it counts most.




    siehe TaskSpeed
      – http://dante.dojotoolkit.org/taskspeed/

10.08.2010                     Thomas Koch                         21
Dojo Foundation
 – http://www.dojofoundation.org/
 – home of great open-source projects
 – started as the home of
   the Dojo Toolkit
 – today the Dojo Foundation
   is also home of other open
   web projects including
   cometD, DWR, OpenRecord,
   Persevere, and Sizzle.
 – Dojo Foundation Board
 – vote per committer

10.08.2010               Thomas Koch    22
Dojo Demos
• Demo #1
      – Dojo Image Demo: Zoomer
      – http://demos.dojotoolkit.org/demos/cropper/
• Demo #2
      – Dojo Feature Explorer
      – http://dojocampus.org/explorer
• Demo #3
      – Sitepen Persevere Demo: Stocker
      – http://persevere.sitepen.com/stocker.html

10.08.2010                 Thomas Koch                23

More Related Content

What's hot

03 Custom Classes
03 Custom Classes03 Custom Classes
03 Custom ClassesMahmoud
 
09 Data
09 Data09 Data
09 DataMahmoud
 
Presentation to wdim_students
Presentation to wdim_studentsPresentation to wdim_students
Presentation to wdim_studentsScott Motte
 
Html5: something wicked this way comes
Html5: something wicked this way comesHtml5: something wicked this way comes
Html5: something wicked this way comesKrzysztof Kotowicz
 
Devdays Seattle jQuery Intro for Developers
Devdays Seattle jQuery Intro for DevelopersDevdays Seattle jQuery Intro for Developers
Devdays Seattle jQuery Intro for Developerscody lindley
 
Building Your First MongoDB Application
Building Your First MongoDB ApplicationBuilding Your First MongoDB Application
Building Your First MongoDB ApplicationTugdual Grall
 
Mobile, Media & Touch
Mobile, Media & TouchMobile, Media & Touch
Mobile, Media & TouchTim Wright
 

What's hot (7)

03 Custom Classes
03 Custom Classes03 Custom Classes
03 Custom Classes
 
09 Data
09 Data09 Data
09 Data
 
Presentation to wdim_students
Presentation to wdim_studentsPresentation to wdim_students
Presentation to wdim_students
 
Html5: something wicked this way comes
Html5: something wicked this way comesHtml5: something wicked this way comes
Html5: something wicked this way comes
 
Devdays Seattle jQuery Intro for Developers
Devdays Seattle jQuery Intro for DevelopersDevdays Seattle jQuery Intro for Developers
Devdays Seattle jQuery Intro for Developers
 
Building Your First MongoDB Application
Building Your First MongoDB ApplicationBuilding Your First MongoDB Application
Building Your First MongoDB Application
 
Mobile, Media & Touch
Mobile, Media & TouchMobile, Media & Touch
Mobile, Media & Touch
 

Viewers also liked

EnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes ForschungsinformationssystemEnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes ForschungsinformationssystemThomas Koch
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkArulalan T
 
AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)Yuvaraja Ravi
 
Automated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationAutomated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationBarbara Jones
 
Automated hardware testing using python
Automated hardware testing using pythonAutomated hardware testing using python
Automated hardware testing using pythonYuvaraja Ravi
 

Viewers also liked (6)

EnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes ForschungsinformationssystemEnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes Forschungsinformationssystem
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
 
AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)
 
Automated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationAutomated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and Validation
 
Python in Test automation
Python in Test automationPython in Test automation
Python in Test automation
 
Automated hardware testing using python
Automated hardware testing using pythonAutomated hardware testing using python
Automated hardware testing using python
 

Similar to Getting Started with Dojo Toolkit

The Dojo Toolkit An Introduction
The Dojo Toolkit   An IntroductionThe Dojo Toolkit   An Introduction
The Dojo Toolkit An IntroductionJeff Fox
 
How dojo works
How dojo worksHow dojo works
How dojo worksAmit Tyagi
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the CloudJames Thomas
 
Dojo javascript toolkit
Dojo javascript toolkit Dojo javascript toolkit
Dojo javascript toolkit Predhin Sapru
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slideshelenmga
 
Dojo training
Dojo trainingDojo training
Dojo trainingvadivelan_k
 
JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)jeresig
 
Introduction To Dojo
Introduction To DojoIntroduction To Dojo
Introduction To Dojoyoavrubin
 
Dojo, from scratch to result
Dojo, from scratch to resultDojo, from scratch to result
Dojo, from scratch to resultNikolai Onken
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentalsSalvatore Fazio
 
JavaScript DOM & event
JavaScript DOM & eventJavaScript DOM & event
JavaScript DOM & eventBorey Lim
 
Dojo: Getting Started Today
Dojo: Getting Started TodayDojo: Getting Started Today
Dojo: Getting Started TodayGabriel Hamilton
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)jeresig
 
jQuery Learning
jQuery LearningjQuery Learning
jQuery LearningUzair Ali
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesMark Roden
 
DOJO
DOJO DOJO
DOJO Mahi Mca
 
Rich internet application development using the dojo toolkit
Rich internet application development using the dojo toolkitRich internet application development using the dojo toolkit
Rich internet application development using the dojo toolkitalexklaeser
 

Similar to Getting Started with Dojo Toolkit (20)

The Dojo Toolkit An Introduction
The Dojo Toolkit   An IntroductionThe Dojo Toolkit   An Introduction
The Dojo Toolkit An Introduction
 
How dojo works
How dojo worksHow dojo works
How dojo works
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the Cloud
 
Dojo javascript toolkit
Dojo javascript toolkit Dojo javascript toolkit
Dojo javascript toolkit
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slides
 
Dojo training
Dojo trainingDojo training
Dojo training
 
JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)
 
Test02
Test02Test02
Test02
 
Introduction To Dojo
Introduction To DojoIntroduction To Dojo
Introduction To Dojo
 
Dojo, from scratch to result
Dojo, from scratch to resultDojo, from scratch to result
Dojo, from scratch to result
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
JavaScript DOM & event
JavaScript DOM & eventJavaScript DOM & event
JavaScript DOM & event
 
Dojo: Getting Started Today
Dojo: Getting Started TodayDojo: Getting Started Today
Dojo: Getting Started Today
 
dojo.things()
dojo.things()dojo.things()
dojo.things()
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)
 
jQuery Learning
jQuery LearningjQuery Learning
jQuery Learning
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
DOJO
DOJO DOJO
DOJO
 
Complete Dojo
Complete DojoComplete Dojo
Complete Dojo
 
Rich internet application development using the dojo toolkit
Rich internet application development using the dojo toolkitRich internet application development using the dojo toolkit
Rich internet application development using the dojo toolkit
 

More from Thomas Koch

Einfache Heimautomatisierung auf dem Raspberry Pi mit Python
Einfache Heimautomatisierung auf dem Raspberry Pi mit PythonEinfache Heimautomatisierung auf dem Raspberry Pi mit Python
Einfache Heimautomatisierung auf dem Raspberry Pi mit PythonThomas Koch
 
CI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python CodeCI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python CodeThomas Koch
 
CI-Ampel fĂźr Jenkins mit RaspberryPi und Python
CI-Ampel fĂźr Jenkins mit RaspberryPi und PythonCI-Ampel fĂźr Jenkins mit RaspberryPi und Python
CI-Ampel fĂźr Jenkins mit RaspberryPi und PythonThomas Koch
 
Facettensuche mit Lucene und Solr
Facettensuche mit Lucene und SolrFacettensuche mit Lucene und Solr
Facettensuche mit Lucene und SolrThomas Koch
 
BSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemachtBSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemachtThomas Koch
 
Raspberry Pi und Python
Raspberry Pi und PythonRaspberry Pi und Python
Raspberry Pi und PythonThomas Koch
 
EinfĂźhrung in Raspberry Pi und GPIO
EinfĂźhrung in Raspberry Pi und GPIOEinfĂźhrung in Raspberry Pi und GPIO
EinfĂźhrung in Raspberry Pi und GPIOThomas Koch
 
Python-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipsePython-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipseThomas Koch
 
Pandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen EinsatzPandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen EinsatzThomas Koch
 
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...Thomas Koch
 
Volltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und SolrVolltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und SolrThomas Koch
 
PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011Thomas Koch
 
Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008) Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008) Thomas Koch
 
Suche und PyLucene
Suche und PyLuceneSuche und PyLucene
Suche und PyLuceneThomas Koch
 

More from Thomas Koch (14)

Einfache Heimautomatisierung auf dem Raspberry Pi mit Python
Einfache Heimautomatisierung auf dem Raspberry Pi mit PythonEinfache Heimautomatisierung auf dem Raspberry Pi mit Python
Einfache Heimautomatisierung auf dem Raspberry Pi mit Python
 
CI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python CodeCI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python Code
 
CI-Ampel fĂźr Jenkins mit RaspberryPi und Python
CI-Ampel fĂźr Jenkins mit RaspberryPi und PythonCI-Ampel fĂźr Jenkins mit RaspberryPi und Python
CI-Ampel fĂźr Jenkins mit RaspberryPi und Python
 
Facettensuche mit Lucene und Solr
Facettensuche mit Lucene und SolrFacettensuche mit Lucene und Solr
Facettensuche mit Lucene und Solr
 
BSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemachtBSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemacht
 
Raspberry Pi und Python
Raspberry Pi und PythonRaspberry Pi und Python
Raspberry Pi und Python
 
EinfĂźhrung in Raspberry Pi und GPIO
EinfĂźhrung in Raspberry Pi und GPIOEinfĂźhrung in Raspberry Pi und GPIO
EinfĂźhrung in Raspberry Pi und GPIO
 
Python-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipsePython-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und Eclipse
 
Pandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen EinsatzPandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen Einsatz
 
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
 
Volltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und SolrVolltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und Solr
 
PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011
 
Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008) Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008)
 
Suche und PyLucene
Suche und PyLuceneSuche und PyLucene
Suche und PyLucene
 

Recently uploaded

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vĂĄzquez
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 

Getting Started with Dojo Toolkit

  • 1. Getting started with Dojo Toolkit Cologne.js User Group Meeting, Cologne (@cowoco) Thomas Koch (@tomy_koch) 10. August 2010
  • 2. Dojo Toolkit: About • Dojo is JS Framework – Pure client-side JS (in contrast to GWT etc.) – Includes Dev.Tools: build, test – Open source, active community http://www.dojotoolkit.org/ • Dojo features – OO-style class based development – Modularisation (via concept of packages) – Support for data and GUI  MVC – Wide range of builtin widgets 10.08.2010 Thomas Koch 2
  • 3. Dojo Toolkit: Features • Development: APIs for robust Web Applications – Event handling, DOM manipulation – CSS Querying, Animations, … • Communication: Ajax and even more – Data abstraction layer, JSON-RPC, Comet, XMPP etc. • Integration: with many server-side developments – including DWR, Django, TurboGears, Google, Jaxer … • User interface: re-usable gui components – Standard gui widgets (button, slider, table, tree, menu …) – vector graphics, charting, … – theming, drag’n drop, … – i18N, a11y • Widely used: Dojo Widgets (aka Dijits) 10.08.2010 Thomas Koch 3
  • 4. Dojo Sneak Preview: Theme Tester 10.08.2010 Thomas Koch 4
  • 5. Dojo quick-start GETTING STARTED 10.08.2010 Thomas Koch 5
  • 6. Basic Dojo Page • minimal Dojo – load the dojo base stuff: dojo.js – define a config (optional!) • djConfig : dictionary used by dojo bootstrap process – Locale, debug, baseURL, parseOnLoad, … • Example <html><head><title>Dojo Demo</title> <script type="text/javascript" src="dojo/dojo.js" djConfig="isDebug:true"> </script></head> <body><p>Hello Dojo</p></body> </html> 10.08.2010 Thomas Koch 6
  • 7. Document Life-Cycle • OnLoad/unLoad Handler – dojo.addOnLoad(<functionname>) • defers script execution until all HTML is loaded – vice versa: addOnUnload() • Example <script type="text/javascript"> function showVersion() { var node = dojo.byId("demo"); node.innerHTML = "Dojo"+dojo.version; } dojo.addOnLoad(showVersion); </script> <body> <div id="demo"></div> 10.08.2010 Thomas Koch 7
  • 8. Dojo Base • Foundation of Dojo Framework: dojo.js – Implements Browser detection & Package loading • import/packaging-concept via dojo.declare / dojo.require – Provides DOM Manipulation and CSS query engine • Browser sniffing – dojo.isFF, dojo.isIE – dojo.isOpera, dojo.isSafari – dojo.isAir • Dojo.is<Browser> (global variable!) – IS version of browser – OR undefined >>> dojo.isFF 3.5 10.08.2010 Thomas Koch 8
  • 9. DOM Manipulation • DOM Lookup – node = dojo.byId("id")  returns a DOM node • Similar to document.getElementById("id") – Watch out: dijit.byId("id")  returns a Dijit widget instance! • DOM Insert/Edit – dojo.create() & dojo.place() var img = dojo.create("img"‚ ,src:"a.gif", alt:"demo" }); dojo.place(img, node, "after"); OR: dojo.create("img"‚ ,src:"a.gif", alt:"demo" }, node, "after"); • Dom Manipulation: cleanup – dojo.destroy(node) – dojo.empty(node) 10.08.2010 Thomas Koch 9
  • 10. Dojo Base : Querying • CSS query engine – dojo.query("img")  returns NodeList • Similar to document.getElementsByTagName("IMG"); – nodelist = dojo.query(String query, String?|Node? root) • Query: CSS3-Selektor http://www.w3.org/TR/css3-selectors – Examples • dojo.query(".progressIndicator"); // Query by css class. • dojo.query(„div#demo"); // Query by node type and id • dojo.query(„a*href*=‚www.bscw.de‘+"); // Query attributes • NodeList – Subclass of Array with special extensions: • every, forEach ,filter, concat, splice, addClass,removeClass… 10.08.2010 Thomas Koch 10
  • 11. Dojo Base : CSS • CSS styling – Assign CSS classes • dojo.addClass(node,clsStr) , removeClass, toggleClass, hasClass – Assign CSS styles • dojo.style(DOMnode|String node, String|Object style, String val) • Example var box = dojo.byId(„bannerTop“); dojo.style(box, {height : „100px“, width: „200px“-); <= => dojo.style(„bannerTop“, …); • dojo.attr(DOMnode|String node, String name, String value) • Example var img = dojo.byId(„logo1“); dojo.attr(img, „alt“, „OrbiTeam“); 10.08.2010 Thomas Koch 11
  • 12. Dojo hands-on PRACTICAL EXAMPLE 10.08.2010 Thomas Koch 12
  • 13. Examples - code available at http://code.google.com/p/dojodemo/ • 1. Simple dojo page – Browser sniffing – DOM Manipulation – CSS Querying – onLoad-Handler • 2. Use of dijits – dojo.require – dojoType magic – Dijit properties – Data layer • 3. Define your own dijit – dojo.provide / dojo.declare – dijit.Widget / dijit.Templated 10.08.2010 Thomas Koch 13
  • 14. The big picture DOJO BUILDING BLOCKS 10.08.2010 Thomas Koch 14
  • 15. Dojo Architecture • Dojo consists of … – Base • Foundation of everything else: packaging, loading, DOM manipulation – Core • Widget parser, animations, drag‘n drop, i18n … – Dijit • Dijits = Dojo Widgets: portable widgets (progress bar, menu, editor, …) – DojoX • Dojo eXtensions: stable and experimental widgets (like Charting, Grid, FishEye) – Util • Dojo Build System, ShrinkSafe, Checkstyle, API Doc System 10.08.2010 Thomas Koch 15
  • 16. Dojo Base • Basic Toolset – Array Utilities (dojo.filter, dojo.forEach …) – Language Utilities (dojo.hitch, dojo.isString …) – OO Utilities (declare, mixin, extend ...) – Event-System (publish, subscribe) – Ajax / IO (dojo.xhr) • Furthermore … – Animations – String Utilities, JSON Tools (fromJSON, toJSON, …) – Misc: Colors,Keys, global, eval 10.08.2010 Thomas Koch 16
  • 17. Dojo Core • Extends Dojo Base Framework – Contains everything from dojo-Namespace that needs import, e.g. dojo.require(„dojo.date“) • Important Components – dojo.dnd: Drag and Drop – dojo.i18n: Internationalization Utility – dojo.rpc: Remote Procedure Calls with Backend Servers – dojo.data: a uniform data access layer • Furthermore contains… – dojo.fx: Effects library on top of Base animations – dojo.gears: Google Gears – dojo.io: Additional AJAX I/O transports – dojo.html: Inserting contents in HTML nodes – Misc: dojo.currency, dojo.date, dojo.number, dojo.regexp etc. Thomas Koch 10.08.2010 17
  • 18. Dojo Unified Events • Publish/Subscribe communication • connect a function of your own to: – a DOM event, such as when a link is clicked – an event of an object, such as an animation starting – a topic, which other objects can publish objects to – function call of your own, such as bar(); • Methods – dojo.[dis]connect(), dojo.publish, dojo.subscribe() • Example var foo = dojo.byId("foo"); // anchor element dojo.connect(foo, "onclick", function(evt) { console.log("anchor clicked"); dojo.stopEvent(evt); //suppress navigation 10.08.2010 Thomas Koch 18 });
  • 19. Further Information on Dojo DOJO RELATED 10.08.2010 Thomas Koch 19
  • 20. Dojo Documentation • API Docs – Online Documentation : http://dojotoolkit.org/api/ • Dojo Campus – Articles, Tutorials, Feature Explorer … http://dojocampus.org • Blogs – Dojo Project Blog • http://dojotoolkit.org/blog/ – SitePen Blog • http://www.sitepen.com/blog – Shane O’Sullivan’s technical blog • http://shaneosullivan.wordpress.com/ • Books – Russell, Matthew A. • Dojo: The Definitive Guide – Riecke, C.; Gill, R.; Russell, A. • Mastering Dojo: – Zammetti, Frank 10.08.2010 • Practical Dojo Projects Thomas Koch 20
  • 21. Dojo Performance • Dojo Performs Better (DOM Manipulation!) – Dojo is 1.5-2x faster than jQuery, and the difference is biggest on the slowest browsers — where it counts most. siehe TaskSpeed – http://dante.dojotoolkit.org/taskspeed/ 10.08.2010 Thomas Koch 21
  • 22. Dojo Foundation – http://www.dojofoundation.org/ – home of great open-source projects – started as the home of the Dojo Toolkit – today the Dojo Foundation is also home of other open web projects including cometD, DWR, OpenRecord, Persevere, and Sizzle. – Dojo Foundation Board – vote per committer 10.08.2010 Thomas Koch 22
  • 23. Dojo Demos • Demo #1 – Dojo Image Demo: Zoomer – http://demos.dojotoolkit.org/demos/cropper/ • Demo #2 – Dojo Feature Explorer – http://dojocampus.org/explorer • Demo #3 – Sitepen Persevere Demo: Stocker – http://persevere.sitepen.com/stocker.html 10.08.2010 Thomas Koch 23