• Speichern
BP210 XPages: Enter The Dojo
Upcoming SlideShare
Loading in...5

BP210 XPages: Enter The Dojo



BP210 session from Lotusphere 2011

BP210 session from Lotusphere 2011



Views auf SlideShare
Views einbetten


Gefällt mir

3 Einbettungen 4

http://www.slashdocs.com 2
https://si0.twimg.com 1
https://twitter.com 1



Details hochladen

Uploaded via as OpenOffice


© Alle Rechte vorbehalten

Report content

Als unangemessen gemeldet Als unangemessen melden
Als unangemessen melden

Wählen Sie Ihren Grund, warum Sie diese Präsentation als unangemessen melden.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Ihre Nachricht erscheint hier
  • it says bp207 in the presentation?
    Are you sure you want to
    Ihre Nachricht erscheint hier
Kommentar posten
Kommentar bearbeiten

BP210 XPages: Enter The Dojo BP210 XPages: Enter The Dojo Presentation Transcript

  • BP207 XPages: Enter The Dojo Paul Withers | Senior Domino Developer | Intec Systems Ltd David Leedy | Developer | Czarnowski
  • About Paul Withers
    • Domino Developer since R5
    • Team leader at Intec Systems Ltd
    • Developed classic web apps with Dojo
    • Developing XPages apps since Q2 2009
    • Guest on The X Cast Feb 2010, TWiL Sept 2010
    • XPages Tutorials: Including Validation and Dojo charts
    • Article on using OAT Javascript Framework with XPages
    • Video on using XPages for live-text widget
    • Audit Comments Custom Control on OpenNTF
  • About David Leedy
    • Developer since R4
    • Customer NOT a business Partner
    • Client Developer who got XPages Religion in 2009
    • Lotus Community Enthusiast
    • NotesIn9 Screencast (Notesin9.com)
    • XPages.TV
    • lotusnotebook.com
    • WikiMadness.com
    • XPages Cheat Sheet
  • About This Session
    • This is NOT an intro to XPages
    • It's an Intro to using Dojo inside of XPages
    • We assume:
      • you do NOT know much about Dojo
      • you're familiar with XPages itself
      • you're familiar with the Source pane
      • you may have some familiarity with JavaScript
      • you want to make great Web 2.0 XPages applications
  • Agenda
    • White Belt
      • What is Dojo?
    • Orange Belt
      • Getting started with Dojo in XPages
      • AccordionContainer, Dates, Rating, TabContainer
    • Brown Belt
      • ToolTips, Themes, Rich Text
    • Black Belt
      • Dialogs, Extending Dojo Modules, Charts
    • Ninja
      • Extension Library
  • What is Dojo?
    • Very Popular JavaScript FrameWork since 2004
    • Open Source Toolkit designed for cross platform RAD
    • Provides common Functions such as:
      • AJAX Data Retrieval
      • Drag and Drop
      • Event Handling
      • Visual Effects / Animation
      • Form UI Tools
        • Sliders, Page Layout, Type Ahead, etc..
      • Graphs / Charting
  • Why Dojo?
    • Very Popular
      • Many Sites Use it
      • Many Books available
      • Thriving OpenSource community
    • Bundled with Lotus Domino Server
    • Designed to be cross platform across browsers
    • Contributions from IBM
    • Commercial support is available
    • Custom builds can be created
    • It's also FREE FREE FREE
  • XPages and Dojo: Fully Integrated
    • XPages get many features from Dojo
      • Client Side Validation
      • Partial Refresh
      • XSP Class
      • Date Picker
      • Type Ahead
      • Extension Library
      • Rich Text Editor
        • 8.5.0 and 8.5.1 is Dojo
        • 8.5.2 defaults to CKEditor
  • Dojo and Domino Versions
    • Domino has been keeping VERY up to date on the latest Dojo Versions
    • 8.5.0 = Dojo 1.1.1
    • 8.5.1 = Dojo 1.3.2
    • 8.5.2 = Dojo 1.4.3
      • dojoType and dojoAttributes properties added for the following controls:
        • Edit Box, Rich Text, Multiline Edit Box, Button, Check Box, Radio Button, Date Time Picker, Span Content, Panel, Table, Div
      • 8.5.3 = Dojo 1.5.0
  • Speaking the Dojo Language
    • Dojo.js (Base) and Core
      • AJAX and Animation
      • Event Handling
      • DOM Manipulation
    • Dijit
      • Library of Widgets
    • DojoX
      • Dojo Extensions
      • Experimental Section
    • Util
      • Additional JavaScript Functions
  • dijit.layout.AccordionContainer
    • Collapsable Sections
    • Each section a Div
      • Use a Custom Control
  • Setting up Dojo in DDE
    • Turn Dojo on via All Properties settings and then add Resources
  • Setting up Dojo via Source <xp:view xmlns:xp=&quot;http://www.ibm.com/xsp/core&quot; dojoParseOnLoad=&quot;true&quot; dojoTheme=&quot;true&quot;> <xp:this.resources> <xp:dojoModule name=&quot;dijit.layout.AccordionContainer&quot;> </xp:dojoModule> <xp:dojoModule name=&quot;dijit.layout.ContentPane&quot;> </xp:dojoModule> </xp:this.resources>
  • Using AccordionContainer
    • Create a DIV or Panel
      • Div performs better
      • Panel is 8.5.2 or higher
    <div dojoType=&quot;dijit.layout.AccordionContainer&quot; style=&quot;height: 300px;&quot;> <div dojoType=&quot;dijit.layout.ContentPane&quot; title=&quot;Panel 1&quot;> Panel 1 content or custom Control </div> <div dojoType=&quot;dijit.layout.ContentPane&quot; title=&quot;Panel 2&quot;> Panel 2 content or Custom Control </div> <div dojoType=&quot;dijit.layout.ContentPane&quot; title=&quot;Panel 3&quot;> Panel 2 Content or Custom Control </div> </div>
  • Date Picker
    • Date Picker is built into XPages
    • But you don't need to use it!
      • dijit.form.DateTextBox
      • dijit.Calendar
  • More Dojo Language...
    • dojo.byId
      • document.getElementById
    • dijit.byId
      • Gets a handle on Parsed Dojo Widgets (Dijit)
    • Both part of CORE Dojo
  • dojox.widget.Rating
    • Graphically choose Stars to represent a number
    • The stars are linked to a DIV – Not a field
    • We get the value of the dijit and add it to a hidden field
    • Needs additional CSS Loaded <xp:styleSheet href=”/.ibmxpres/dojoroot/dojox/form/resources/Rating.css”> </xp:styleSheet>
    <div id=&quot;rateControl&quot; dojoType=&quot;dojox.form.Rating&quot; numStars=&quot;5&quot; value=&quot;2&quot; onChange=&quot;dojo.byId('#{id:editControlName}').value = dijit.byId('#{id:rateControl}').value&quot;> </div>
  • dijit.layout.TabContainer
    • XPages comes with a built in Tabbed Panel container
      • But you might want to avoid it in some situations.
      • None active tabs are NOT rendered to the browser
        • So not available for Client Side JS
        • You hit the server every time a tab is changed
          • Slow....
    • Dojo's TabContainer
      • Easy to implement
      • Use for Div's OR Panels
      • All content sent to Browser
        • Everything available to Client Side JS
        • Dojo takes care of the hiding
          • FAST!!!!
  • Using TabContainer
    • Very similar to AccordionContainer
    • Resources
      • dijit.layout.TabContainer
      • dijit.layout.ContentPane
    <xp:panel dojoType=&quot;dijit.layout.TabContainer&quot; style=&quot;width: 350px; height: 300px&quot;> <xp:panel dojoType=&quot;dijit.layout.ContentPane&quot; title=&quot;dojo Tab 1&quot;> Content for Tab 1 </xp:panel> <xp:panel dojoType=&quot;dijit.layout.ContentPane&quot; title=&quot;dojo Tab 2&quot;> Content for Tab 2 </xp:panel> <xp:panel dojoType=&quot;dijit.layout.ContentPane&quot; title=&quot;dojo Tab 3&quot;> Content for Tab 3 </xp:panel> </xp:panel>
  • Sample App...
    • Tom “Duffbert” Duff
    • He reads books....
      • A LOT OF THEM
    • Now a Days we Writes Books
      • SameTime Users Guide
  • dijit.Tooltip
    • Used to display content on hover
      • Text
      • Images
      • Formatting
    • Resource
      • dijit.Tooltip
    • Create a div or panel
    • Label attribute or content within div / panel
    • Define connectId (component's client-side ID)
    <div dojoType=&quot;dijit.Tooltip&quot; connectId=&quot;label1&quot; position=&quot;below&quot; label=&quot;Enter only numbers&quot;> </div>
  • Dojo Themes
    • Four themes
      • tundra (the default theme implemented by XPages)
      • soria
      • nihilo
      • claro (new with Dojo 1.5)
    • Create Theme resource
    <resource dojoTheme=&quot;true&quot;> <content-type>text/css</content-type> <href>/.ibmxspres/dojoroot/dijit/themes/nihilo/nihilo.css</href> </resource> <control> <name>ViewRoot</name> <property mode=&quot;concat&quot;> <name>styleClass</name> <value>nihilo</value> </property> </control>
  • Rich Text Editor - 8.5.x
    • ibm.xsp.widget.layout.RichText by default in 8.5.0 / 8.5.1
      • dijit.Editor extended by IBM with extra plugins
      • Add as dojoType on Rich Text control in 8.5.2 to override CKEditor
        • e.g. for backwards compatibility
      • Toolbar can be extended with extra buttons in 8.5.0 / 8.5.1
    • Resources
      • dijit._editor.plugins.LinkDialog
    <xp:inputRichText value=&quot;#{logEntry.prlGeneralNotes}&quot;> <xp:this.dojoAttributes> <xp:dojoAttribute name=&quot;extraPlugins&quot;> <xp:this.value><![CDATA[[&quot;createLink&quot;, &quot;|&quot;]]]></xp:this.value> </xp:dojoAttribute> </xp:this.dojoAttributes> </xp:inputRichText>
  • Rich Text Editor 8.5.2+
    • CKEditor by default (extended by IBM)
    • <data>dominohtmlckeditor (compressed files)
    • _source subfolder for uncompressed files
    • Managed by <dojoroot>ibmxspwidgetlayoutCKEditorWrapper.js
    • Extend by defining dojoAttributes
      • toolbarType:to choose from predefined toolbars, 'Slim', 'Medium', 'Large'
      • toolbar: creates your own toolbar from scratch
        • “ [['Font','FontSize'],['Preview','TextColor','BGColor']]”
        • Names can be found in plugin.js files in subfolders of plugins folder
        • Or see constructor method in CKEditorWrapper.js
      • extraPlugins: to include additional plugins not in 3 default toolbars
      • skins: to theme the editor
      • ...and many more. See CKEditorWrapper.js
  • dijit.Dialog 1
    • Div or Panel
    • BUT if you want to use SSJS there are problems
      • Dojo moves the div outside the <form> tag
      • So content is not posted back to server
  • Creating Your Own Dojo Module
    • Various options on the web:
      • http://www.scottgood.com/jsg/blog.nsf/d6plinks/SGOD-889H6V
      • http://xpagesblog.com/xpages-blog/2010/4/10/xpages-compatible-dojo-dialog-reusable-component.html : Extended Dojo module (by Jeremy Hodge)
    • Step 1: Create a Javascript Script Library / File Resource or install on server
      • <data>dominojsdojo-1.x.x...
      • &quot;provide&quot; your Dojo module
      • &quot;require&quot; any other Dojo modules required
      • &quot;declare&quot; your module referencing the module you're extending
      • Define any attributes / functions you're adding / modifying
    • Compare existing Dojo files
      • Look at uncompressed versions
        • http://download.dojotoolkit.org/release-1.4.3/dojo-release-1.4.3-src.zip
  • Anatomy of a Dojo Module 1
  • Anatomy of a Dojo Module 2
  • Anatomy of a Dojo Module 3
  • Anatomy of a Dojo Module 4
  • dijit.Dialog 2
    • Step 2: Include javascript library as module on XPage (removing “.js” for web)
    Include File Resource as module on XPage
    • Step 3: Set dojoType on div or panel
    <xp:resources> <xp:script src=&quot;/com/ZetaOne/widget/Dialog.js&quot; client-side=&quot;true&quot;> </xp:script> </xp:resources> <xp:panel dojoType=&quot;com.ZetaOne.widget.Dialog&quot;> CONTENT </xp:panel>
  • dojox.charting 1
    • Dojox, i.e. differing levels of completeness and interoperability
    • Compatibility mode required for Microsoft Internet Explorer 8
    • 2D charts
      • Line charts / stacked line charts
      • Bar charts / column charts
      • Pie charts
      • Scatter charts
    • 3D charts
    • Configurable Axes
    • Background grids
    • Predefined themes
    • Legends (contributed by Chris Mitchell, IBM)
  • dojox.charting 2
    • Data Series
      • Array of values / JSON objects
      • dojox.data stores
    • Animations
      • Highlight
      • Magnify
      • MoveSlice / Shake
      • Tooltip
      • Events
      • Zooming / panning / scrolling
    • With Dojo 1.5.0
      • Linear / radial gradients
      • Map chart
      • Additional themes
  • Changing the Dojo Version
    • Install relevant version on the server in <data>dominojs folder
    • Restart server
    • Server / client automatically uses highest numbered dojo-x.x.x folder
    • To downgrade a whole server / client:
      • Server-Wide / Client-Wide
        • <data>propertiesxsp.properties file
      • Add in e.g. xsp.client.script.dojo.version=1.5.0
    • Possible at nsf level but complicated
  • Beyond Black Belt – Extension Library
    • Server install currently required
    • Many Dojo widgets packaged as native controls
    • Mobile Controls
    • See AD116 XPages Extension Library: Making Application Development Even Easier
      • Replay on 02/02/2011 10.00am
      • DL N. Hemisphere A-C
    • Improves performance
    • Improves ease of use
    • Improves development time
  • Recommended Reading
    • Dojo Toolkit http://dojotoolkit.org
      • http://download.dojotoolkit.org/release-1.4.3/dojo-release-1.4.3-src.zip
    • IBM Dojo Widget Gallery HomePage
      • http://www-01.ibm.com/software/ucd/widgetgallery.html
    • Lotus Notes & Domino Application Development Wiki
      • http://www-10.lotus.com/ldd/ddwiki.nsf/xpViewRecent.xsp?searchValue=xpages
    • OpenNTF http://openntf.org
    • xpag.es/?search
    • xpages.tv
    • xpages.info
    • thexcast.net
    • qtzar.com
    • xpagesblog.com
  • Related Sessions
    • SHOW106 XPages 101 – How to build a simple XPages application
      • SPEAKERS: Matt White & Tim Clark
    • AD110 Building XPages Applications By The Book!
      • SPEAKER: Martin Donnelly & Tony McGuckin
    • AD112 How the Re-vamped TeamRoom and DocLib Templates Are Built Using XPages Extension Library
      • SPEAKERS: Maire Kehoe & Tony McGuckin
    • AD116 XPages Extension Library: Making Application Development Even Easier
      • SPEAKERS: Paul Hannan & Maire Kehoe
    • BP207 Apps, Apps, and More Apps: Meet the Very Best Open Source Apps from openNTF
      • SPEAKERS: Bruce Elgort & Niklas Heidloff
    • BP211 XPages Blast
      • SPEAKERS: Matt White & Tim Clark
  • Thank You, Q&A Paul Withers [email_address] @PaulSWithers http://hermes.intec.co.uk/intec/blog.nsf http://www.youtube.com/intecsystems http//www.intec.co.uk David Leedy [email_address] @DavidLeedy NotesIn9.com XPages.TV LotusNotebook.com Please complete your evaluations
  • Legal Disclaimer © IBM Corporation 2011. All Rights Reserved. The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino, Quickr, Sametime, WebSphere, UC2, PartnerWorld and Lotusphere are trademarks of International Business Machines Corporation in the United States, other countries, or both. Unyte is a trademark of WebDialogs, Inc., in the United States, other countries, or both. Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.