XPages
Transcription
XPages
Lotusphere Nachlese 2012: social + mobile + cloud = smart work ©2012 IBM Corporation Lotusphere Nachlese 2012 – Session: IBM Lotus Domino Designer and XPages Martin Leyrer Yassin Sabir IBM Collaboratrion Solutions Services ©2012 IBM Corporation IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion. Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract. The development, release, and timing of any future features or functionality described for our products remains at our sole discretion. ©2012 IBM Corporation 3 Agenda: • Xpages Extension Library • XPages Relational Database Access • XPages Social Enabler • XPages Source Control • Xpages & Designer Tips, Tricks, Neuigkeiten, Ausblick • Lotus Notes & Domino Application Development Roadmap ©2012 IBM Corporation 4 XPages Extension Library ©2012 IBM Corporation XPages Extension Library OpenNTF • Available at http://extlib.openntf.org/ – Active conversation with developers in the Discussions and Defects section ©2012 IBM Corporation 6 XPages Extension Library OpenNTF • Code is first released on OpenNTF – Available early and gives full transparency of ongoing development • Chosen subsections from OpenNTF are delivered as “Upgrade Packs” – Supported by IBM – Upgrade packs are delivered on a shorter release cycle than products • Upgrade Packs are integrated into the next revision of the product Continuous development released as open source Dec 14, 2011 UP1 Core Product N/D 8.5.3 UP2 ...UPx... UPy... N/D “Next” ©2012 IBM Corporation 7 XPages Extension Library OpenNTF There are 2 sets of plugins included in OpenNTF delivery ■ ■ “extlib” and “extlibx”. Each set is wrapped into its own XPages specific library com.ibm.xsp.extlib.library com.ibm.xsp.extlibx.library ■ The “extlibx” library contains eXperimental code RDBMS support Social Enabler and others ■ Experimental code can get added to the “extlib” library once the code has matured and there is sufficient customer demand ©2012 IBM Corporation 8 Setup of server/development environments • If you have Upgrade Pack 1 previously installed – you need to uninstall it • To consume RDBMS data, you need to install the OpenNTF version of the XPages Extension Library, • Since the OpenNTF version doesn't have an installer, like the UP1 installer, you need to follow these steps: – Download the latest ExtensionLibraryOpenNTF-853-YYYYMMDD-HHMI.zip file (it's big!) – Unzip that big zip updateSiteOpenNTF.zip file (to be installed on the Domino server/Notes preview server) – Unzip all the content in the updateSiteOpenNTF.zip file, so you can access the site.xml, as well as the features/plugins folders – Unzip, from the big zip, the updateSiteOpenNTF-designer.zip file (to be installed in Domino Designer) – No need to unzip the updateSiteOpenNTF-designer.zip content ©2012 IBM Corporation 9 • • Setup of server/development environments Installation on the Domino server should be done using the XPages Extension Library Deployment in Domino 8.5.3 and IBM XWork Server technique described in the Lotus Notes and Domino Application Development wiki: – Involves creation of a new NSF application based on the updatesite.ntf template and import of the extracted updateSiteOpenNTF.zip content, using its site.xml file – Requires specification of an OSGI_HTTP_DYNAMIC_BUNDLES variable inside your server's notes.ini file to point to the update sites' NSF – Uses additional safeguards when loading plugins (ACL) Installation for Notes web preview (where no Domino server is running) should be done based on the Using an XPages Library in Designer technique, which is also described in the Lotus Notes and Domino Application Development wiki: – Requires the features/plugins folder content, which was previously extracted from updateSiteOpenNTF.zip, to be merged with the existing features/plugins folders found under the <Notes_Data>\domino\workspace\applications\eclipse folder – Special attention should be taken not to use, for Notes web preview purpose, another similar looking folder <Notes_Data>\workspace\applications\eclipse, whose purpose is to provide features/plugins for the Notes client/Domino Designer functionality ©2012 IBM Corporation 10 RDBMS access • XPages apps can depend on both the extlib and extlibx libraries – RDBMS access requires both dependencies ©2012 IBM Corporation 11 New XPages data sources for RDBMS • XPages leverages JDBC when connecting to relational databases – Accesses any database with a JDBC driver available – You could access • DB2, • Oracle, • MS SQL, • MySQL, • Derby • ... you name it! – You need to obtain the JDBC driver from the database vendor or third party provider • RDBMS data is accessed directly – no synchronization is performed with NSF • XPages efficiently manages the connections through a connections pool • Uses NSF specific connections • The data is accessed using a set of dedicated data sources ©2012 IBM Corporation 12 New XPages data sources for RDBMS • extlibx library adds 2 new data sources: – JDBC Query for Read Only access – JDBC RowSet for CRUD (create/read/update/delete) access. • Current implementation is based on com.sun.rowset.CachedRowSetImpl, • Could be configured to use your own via the rowSetJavaClass property • Each of the provided new data sources could be easily utilized either by: – the core View Container Control (xp:viewPanel element) – the XPage itself (xp:view element) • The new data sources are now available in the Domino Designer Property Panel ©2012 IBM Corporation 13 New XPages data sources for RDBMS • For both JDBC Query and JDBC RowSet data sources, access to fields in SQL data are: – via the core xp:viewColumn element – using its columnName property • i.e. the same way you do with Domino View data source • Currently you need to know what RDBMS fields are returned in your specified SQL table or by a SQL query • Code snippet showing the definition of a view column using the “firstName” RDBMS field – The column can even be made sortable! ©2012 IBM Corporation 14 New XPages data sources for RDBMS • It's very easy to bring your relational data into an XPages enabled web application using familiar Domino Designer controls ©2012 IBM Corporation 15 New XPages data sources for RDBMS • For the CRUD scenario – you could easily develop a record editing dialog, taking values from the JDBC RowSet data source ©2012 IBM Corporation 16 Making RDBMS connections • Part of that file name before the “.jdbc” extension (in this case “db2test”) – should be used in the JDBC data sources configuration • via connectionName property • File resources with the “.jdbc” extension – should be placed within an XPages application (NSF) under the WebContent/WEB-INF/jdbc folder – This folder is visible within Domino Designer in the Navigator/Package Explorer views only. – It is not visible in the default Applications view • File resources within the WebContent/WEB-INF – cannot be accessed via URL syntax • your password and connection data is secure ©2012 IBM Corporation 17 Making RDBMS connections • SQL data can be made available by using the following properties: – sqlTable (the runtime will generate a select * from <sqlTable> ) – sqlQuery (SQL query, which could be either static or computed) – sqlFile (file resource with the “.sql” extension, containing the SQL statement) • The Core Pager control (xp:pager) can be used to navigate through the SQL data and additional properties can help display the actual number of pages for the JDBC Query data source: – calculateCount (false by default, but when set to true, the runtime will generate select count(*) for the corresponding table or query) – sqlCountQuery (allows you to specify your own count query) – sqlCountFile (file resources with the “.sql” extension, containing the SQL count query) • For the JDBC RowSet data source, you could limit the number of rows retrieved by: – maxRows (default is 0, all rows retrieved, so be careful here) – Pager control is already aware of the actual number of pages • File resources with the “.sql” extension should be placed in an XPages application, under the WebContent/WEB-INF/jdbc folder. ©2012 IBM Corporation 18 Making RDBMS connections ©2012 IBM Corporation 19 Server Side JavaScript APIs and @Functions • Currently implemented @Functions: – – – – – – @JdbcInsert @JdbcUpdate @JdbcDelete @JdbcExecuteQuery @JdbcDbColumn @JdbcGetConnection • Used to simplify various RDBMS operations • Allows programmatic access to RDBMS data ©2012 IBM Corporation 20 Setup of server/development environments • Verification of the correct installation within Domino Designer: – Select Help → About IBM Lotus Domino Designer menu – Click Plug-in Details button, sort by Plug-in Id and scroll to the extlib/extlibx plugins ©2012 IBM Corporation 21 Relational Database Demo !!! ©2012 IBM Corporation Relational Database Roadmap Next Release - Enhancements based on user feedback - Eventually makes a Feature Pack? (to be evaluated) Update 1 – Fall 2011 Initial Release – Summer 2011 - Delivered on openNTF, as part of the extension library - Runs on top of Domino 8.5.3 - JDBC Connection Manager - New Read and Read/Write data sources - Integration with the existing controls (view panel, edit...) - Java & SSJS JDBC API helpers - Enhancements based on user feedback - Better Designer integration using WDT tooling (Sql & connection editor, Data binding helpers...) 2012 2011 ©2012 IBM Corporation 23 Future directions • XPages Extension Library OpenNTF and Relational support continues to evolve further and expected features in the pipeline include: – – – – – Global Domino server based RDBMS connection definition ability Better Domino Designer tooling to work with the RDBMS tables' metadata Even better JDBC connection pooling implementation using Apache DBCP JDBC Query possibility via REST services Additional @Functions you are missing for your next great XPages application ;-) • Another new interesting OpenNTF project: – JDBC Access for IBM Lotus Domino Your XPages journey has already started, you are already discovering new features – so sit back and continue to enjoy! ©2012 IBM Corporation 24 Social Enabler for XPages ©2012 IBM Corporation XPages Social Enabler • Your entry point for adding Social Capabilities to your Domino applications • Social features are delivered as open source on openNTF, as part of the Extension Library • The plan is to deliver some of these social features within an Upgrade Pack, targeting UP#2, and then part of a future revision of IBM Lotus Notes®/Domino® product Continuous development released as open source UP1 Started last spring UPn Will be delivered in a future Upgrade Pack The code continues to evolve over time ©2012 IBM Corporation 26 Social Enabler for XPages • Designed to make access to Social features as simple as possible • Core layer providing the assets for building Social Applications • Built as new Java™ assets, part of the extension library • New data sources for REST services • Content type renderer renderers • New XPages controls and Dojo wrappers • Core services (proxy server, credential store...) • Set of high level custom controls • Built on top of the core layer • Easily customizable from the Designer UI Don't try to reinvent the wheel – It is designed to be secure with high performance ©2012 IBM Corporation 27 Accessing IBM Connections Services • All the IBM Connections services are Atom based REST services • The Extension Library provides a new data source for accessing the services – Used to access all the services • Communities, Profiles, Activities... – The data is read-only. Updates should be achieved by directly calling the REST API (helpers are provided) – Supports the rendering with a view panel, including paging, caching... • Also used to connect to the LotusLive services (Activities, Communities and Files) ©2012 IBM Corporation 28 Social Enabler Demo: XPages based App for IBM Connections • Sample XPages app accessing Connections profiles, communities and activities ©2012 IBM Corporation 29 Social Enabler Demo: Sharing Files • One simple data source for different file sharing providers – Currently supports Connections, LotusLive and Dropbox • Fully extensible to other providers • REST APIs are used to retrieve meta-data about user's files • File information is encapsulated in View Panel Row Data objects • Supports View Panel Paging • Supports Simple Actions ©2012 IBM Corporation 30 Social Enabler Demo: Consuming Social Networks ■ Simple Data Sources built in to allow access to various social networks: ─ Facebook ─ Twitter ■ XPages controls which allow the addition of 'Social Features' to your XPages: ─ Facebook Login ─ Facebook 'Like' button control ─ Facebook 'Comment' control ─ Twitter Content Type allows Twitter hashes and usernames render as links ■ ■ Consistent setup across social networks and other services Can easily be adapted to any 'social network' that provides REST APIs ©2012 IBM Corporation 31 A Word of Warning • Web Security Store: – Container for OAuth key, OAuth secret and OAuth URL info, and user credentials – 'Do NOT try this at home', it is 'easy' to create a token store, creating a secure one is not trivial – Use the pre-packaged token store (WebSecurityStore.nsf) • XPages Social Enabler demo application contains sample Custom Controls capable of connecting to various social and online services using the Social Enabler plug-in • Application developers can add social capabilities to their own applications by using the Social Enabler plug-in and Web Security Store. ©2012 IBM Corporation 32 Social Enabler Summary • The XPages Extension Library brings a new set of social capability to XPages – Access to the IBM Social Business Toolkit APIs (Connections, LotusLive, Sametime...) – Access to external social networks (Twitter, Facebook, Dropbox...) – New ready to use custom controls • These features are already available on openNTF and will be gradually integrated into the product, via UpgradePacks – http://extlib.openntf.org/ • This is an evolving piece of work, and a major focus for 2012 – Support for OpenSocial Gadgets and Embedded Experience – Support for more Social Networks and Plug-ins – Preview of Domino as an OAuth provider (monitor openNTF!) ©2012 IBM Corporation 33 Domino REST services • Domino Access Services (DAS) – Provides secure lightweight HTTP based access to Domino data – Data service is in UP1 • • • • • Tied to Domino data model Access to databases, views & folders, documents Create, Read, Update & Delete (CRUD) operations JSON for easy manipulation via JavaScript or Java DAS is built on top of OSGi & Wink so it is extensible – IBM can add new services over multiple releases – Customers and business partners can create custom REST services ©2012 IBM Corporation 34 Source Control ©2012 IBM Corporation Source Control Is Good For • Tracking changes in your code • Backing out of code that isn't working • Experimenting with changes without risking the integrity of working code • Being able to review past changes to isolate regression bugs • Working with a team of developers on the same code base • When integrated with defect/request tracking can become a self documenting list of change reasons ©2012 IBM Corporation 36 Source Control Isn't... JUST FOR TEAMS ©2012 IBM Corporation 37 Source Control Isn't... ©2012 IBM Corporation 38 Two Types Of Source Control • Client/Server Based – – – – – – • Requires an active network connection to the server Everybody works from the same repository Higher chance of conflicting changes when committing Branching and Merging are more complex Central repository always reflects latest version Developers need to serialize their work Distributed – Everybody has their own repository locally on their machine – Committing, Branching and Merging is all done locally – Can Push and Pull changes from any other local or remote repository – No central repository means no definitive 'latest version' • You can create a server based repository that each person pulls/pushes with • Increases the possibility of merging conflicts – Developers can work independent of each other and later merge their work ©2012 IBM Corporation 39 Two Types Of Source Control • Client/Server Based – – – – – – Subversion® ( SVN ) CVS IBM Rational® ClearCase® IBM Rational® Team ConcertTM Microsoft® Team Foundation Server Borland® StarTeam® • Distributed – – – – – GIT Mercurial Bazaar Darcs BitKeeper ©2012 IBM Corporation 40 Installing In Domino Designer • You will need to be able to install from an update site • Go to the 'File → Application → Install' menu • If you don't see the menu option you need to enable it in your Domino Designer preferences ©2012 IBM Corporation 41 Installing In Domino Designer • Select the option to install new features • Then add a new update site • Complete the details for your selected SCM package • Click 'Finish' to start searching for software to install ©2012 IBM Corporation 42 Installing In Domino Designer • Depending on the SCM selected you may need to show the older versions – MercurialEclipse requires an older version – De-select the following option – The older version can now be selected • Once selected click 'next' and follow the prompts to install the update site • Restart your designer client when prompted to activate the new plugins ©2012 IBM Corporation 43 Installing In Domino Designer • You can verify that the plugins are installed File → Application → Application Management ©2012 IBM Corporation 44 Creating A Source Controlled Application • Before you can do any source control operations on an application you need to create an 'On Disk' version • This is a special flat-file version of the application that the source control plugins can read • It is automatically synchronized with the NSF/NTF as you make changes • Synchronization can happen in both directions • Then you point the Source Control to the 'On Disk' version ©2012 IBM Corporation 45 Creating A Source Controlled Application ©2012 IBM Corporation 46 Creating A Source Controlled Application ©2012 IBM Corporation 47 Creating A Source Controlled Application ©2012 IBM Corporation 48 Creating A Source Controlled Application ©2012 IBM Corporation 49 Creating A Source Controlled Application ©2012 IBM Corporation 50 Creating A Source Controlled Application ©2012 IBM Corporation 51 Creating A Source Controlled Application ©2012 IBM Corporation 52 Creating A Source Controlled Application • A couple of additional notes... – Always use your own COPY of the database to develop in • Using a replica or shared DB causes issues • Your design changes are your own till you pull/merge in other changes • ( pulling and merging is discussed later ) – If possible run a local development server and work from that • Really speeds up Domino Designer – Never work directly against your production environment • A good admin would never allow this to happen in the first place ©2012 IBM Corporation 53 Creating A Source Controlled Application • A couple of additional notes... – Always use your own COPY of the database to develop in • Using a replica or shared DB causes issues • Your design changes are your own till you pull/merge in other changes • ( pulling and merging is discussed later ) – If possible run a local development server and work from that • Really speeds up Domino Designer – Never work directly against your production environment • A good admin would never allow this to happen in the first place ©2012 IBM Corporation 54 Committing ©2012 IBM Corporation 55 Committing ©2012 IBM Corporation 56 Committing • As you commit changes a revision history of the application is built up • You can use the 'History' panel to see this by using the 'Team → Show In History' menu ©2012 IBM Corporation 57 Committing • The revision history also shows what design elements changed for the selected changeset ©2012 IBM Corporation 58 Committing • Double clicking on a design element in the history will show you the differences • Handy when you want to remind yourself of exactly what changed at a later date ©2012 IBM Corporation 59 Team → Other Actions ... ©2012 IBM Corporation 60 Source Control Demo !!! ©2012 IBM Corporation Tips & Tricks ©2012 IBM Corporation IBM XWork Server • • • New offering designed for ISVs and IBM Business Partners who need a well-priced and easy to sell XPages based offering that allows them to quickly develop and deliver collaborative social business applications for web and mobile devices. Provides an attractive and VERY simplified pricing and packaging approach for XPages technology via a lower, fixed term license cost. It lowers the cost of the technology to the customer. Allows partners and ISVs to deliver their existing IBM Lotus Domino applications to new customers • Delivers eXceptional Work experiences • Offering is based on Lotus Domino Utility Server but with license restrictions • 4 applications only, 4 .NSFs per application • More apps supported via additional license (up to 8 apps) • Replication is restricted to other IBM XWork Servers ©2012 IBM Corporation 63 New Teamroom Template From This To This In two easy steps! 1) File-Application-Replace Design 2) Run Upgrade Content agent (note: you only need to run agent once) ©2012 IBM Corporation 64 ©2012 IBM Corporation 65 ©2012 IBM Corporation 66 Continued Usability Tune-Ups • Need web preview to use a different port from 80? • InfoBox on Open? Or Not? – Now you can decide • Renaming design elements – Dialog (accessed by F2 in the design list, or from navigator) allows you to supply both the name and the alias • Set the “prohibit design refresh” flag across all elements in an application • Three perspectives to adjust the screen real estate to your current task Domino Designer All design elements available Original perspective since 8.5 XPages Only XPage-relevant design elements Data palette fully visible Forms/Views XPage related design elements hidden Control palette area removed for full use of window ©2012 IBM Corporation 67 Making it Easier to Write Code.... • A new client JavaScript editor – – – – Code folding Code templates Validation Content assist • Java design element – Eases Java development for XPage applications • Uses Eclipse JDT components – Stores the class file within the note – Visible across the XPage assets in an NSF • Callable by SSJS – Perfect for defining managed beans ©2012 IBM Corporation 68 XPages Performance and Scalability - 8.5.3 • XPages Preloading : – preloads XPages Java classes before the application is opened – i.e. compiled XPages, custom controls, runtime classes etc – enabled via NOTES.INI – provisionable across the enterprise – Works on Notes client and/or Domino server • XPagesPreload=1 – … to preload just the core runtime • XPagesPreloadDB=db.nsf/myPage.xsp,other.nsf/myPage.xsp – … to preload specific apps • Particularly relevant to XPages in Notes Client remote execution ©2012 IBM Corporation 69 XPages Performance and Scalability - 8.5.3 • JS and CSS Aggregation – Dynamically aggregates DOJO javascript modules and .css files – Drastically reduces number of browser requests for JS and CSS resources • Latency between browser requests has significant negative impact – Dramatic improvements evident in initial application performance • e.g. an extreme case in the Extension Library using DWA_ListView.xsp • Settable via Application Properties (sets xsp.resources.aggregate=true in xsp.properties) ©2012 IBM Corporation 70 Programmability - 8.5.3 • ViewNavigator class enhancements improve performance – Performance improvements and cache introduced in 8.5.2 – Cache fully function for all methods – More info at: http://www.lotus.com/ldd/ddwiki.nsf/dx/Fast_Retrieval_of_View_Data_Using_the_ViewNavigator_C ache • View – Int FTSearchSorted( Variant query, Int maxDocs, String columnName, Boolean ascending, Boolean exactCase, Boolean wordVariants, Boolean fuzzySearch) • Agent – runWithDocumentContext(Document doc) – runWithDocumentContext(Document doc, String NoteID) – Now supports use case #2: Outer agent/XPage runs as Agent Signer & Inner agent runs as Agent Signer ©2012 IBM Corporation 71 Domino Designer - Beyond 8.5.x.... • Server-Side JavaScript editor and debugger • Leverage a newer Eclipse version • Multi-user support • Debug Java agents • Improve consumption of OpenNTF assets • Mac & Linux® support – On the list, but not as high as quality and functional completeness ©2012 IBM Corporation 72 XPages - Beyond 8.5.x.... • Rich Internet Application (RIA) features • Improved support for HTML5 • Offline application support • Dojo, OneUI & CKEditor upgrades • Enhanced Mobile device support • iWidget/OpenSocial hosting • Improved Integration with Activity Streams ©2012 IBM Corporation 73 Lotus Notes & Domino Application Development XWork Server 8.5.3 Lotus Domino & Designer 8.5.2 Application server based on Domino and Xpages capabilities. Suitable for ISV XPages solutions Secure Low cost Scalable Available to web browsers & mobile devices Domino Designer Usability and Productivity enhancements XPages Stability/performance improvements Improved rich text editing (CKEditor) Dojo 1.4.1 Better Notes client integration Lotus Domino & APIs XPage extensibility APIs Designer 8.5.3 Notes views (JavaTM) Domino Designer Cloud images for developers Source Control Integration Domino Designer Support new Xpagescontrols XPages XPages Extension Library Enhanced Mobile support Leverage social services from ConnectionsTM, SametimeTM Dojo upgrade 2012 2013 Lotus Domino & Designer Feature Release Domino Designer Server Side JavaScript editor & debugger Lotus Domino & Usability enhancements XPages Designer 8.5.4 Rich Internet Application (RIA) Lotus Domino and Lotus features & Designer Dojo & CKEditor upgrade Domino Social Enhanced Mobile device support 8.5.3 Upgrade Edition iWidget/OpenSocial Domino Designer Pack 1 consumption/hosting Usability enhancements Integrate with Activity Streams Source control enhancements APIs Domino Designer XPages Domino Access Services (REST Extensions for design Incorporate Upgrade Pack 1 & APIs) elements New XPages and Forms/Views 2 into base Language bindings for Activity Support new perspectives Create OpenSocial gadgets Stream APIs XPagescontrols Update CS JavaScriptTM editor Dojo, CKEditor & OneUI Platform XPages New Java design element upgrade Expand OSGi consumption and XPages Extension XPages APIs support Library Stability/performance improvements Domino Access Services in Domino Enhanced Mobile device Improved rich text editing (CKEditor) (REST APIs) Refresh Cloud services for developers support Dojo 1.5, CKEditor 3.5.3 C&S REST APIs & back-end 74| © 2012 IBM Corporation APIs APIs LotusScript & Java classes Domino Access XPage extensibility APIs Platform Information is subject to change without Services (REST APIs)Note: Cloud images for Applications Expande consumption noticeOSGi at IBM’s discretion 2011 2010 Lotus Domino & Designer 8.5.3 Upgrade Pack 2 Q&A ©2012 IBM Corporation