SlideShare a Scribd company logo
Domino XPages Workshop
Agenda Workshop Introduction What is XPages ?  Domino Discussion template (demo) Working with XPages in IBM Lotus Domino Designer 8.5 Introduction with Designer 8.5 interface and XPage element Exercise 1 & 2 The profile application Other Exercises (3 => 26) Jacobs Engineering - Real Customer Scenario Development Model Deployment/Co-existence Environment Reuse of existing business logic XPages Futures... XPages on the client.. Write once, run on Web and Client Composite Application integration
Materials Lotus Domino server Lotus Notes & Domino Designer 8.5 Folders : Starting database = profile00.nsf
What is XPages ?
Domino discussion database
Introduction Exercises
Working with XPages in IBM Lotus Domino Designer 8.5 (1)
Working with XPages in IBM Lotus Domino Designer 8.5 (2) XPages must be compiled before the page is viewed in the broser HTTP Error 404 or old Xpages … Compilation errors
Working with XPages in IBM Lotus Domino Designer 8.5 (3) Ctrl (shift) Alt and direction keys to resize controls Previewing xpage : Domino Server Security : XPages = agents Local Domino Designer (localhost) Anonymous (must be in LCA) Project saved & builded Not for custom controls
Exercise 1 : Hello World ! Create an application Create a custom control Create a xpage and include the custom control
Exercise 2  Hello World updated Label and Editbox to type your name Button to change the Label text and hide the editbox Partial refresh Tip : getComponent Global function to access the objects backing up UI controls Methods setValue() & getValue() New property definition iknowyou To hide the editbox compositeData object to access  custom properties compositeData .iknowyou
The profile application
The Profiles Application What is it? An XPages application that manages user profiles information. Main features: Entry page allows a search to be submitted to retrieve profiles information based on that search: A simple “by name” search Results page lists the retrieved results in a tabular format: Drill-down on a selected result will navigate into that profile Profile information page displays read-only information about the selected profile Edit profile page allows a user to edit their own profile Create profile page allows a new user to fill out their profile
 
 
 
The starting database Contains “classic” Domino elements Forms Profile Keyword Friend agentDemo View Profiles keywordLookup Friends agentDemos Some documents TimeZones, Countries …
Exercise 3 Update  : start with the beginning database Creation of a custom control : container Creation of 3 XPages : home, results, profile Import resources (style sheet and images) Map styles to panels Tips Use outline to retriew or reorganize elements (nested panels)
Editable Areas (callback controls) Editable areas are regions that users can modify when the custom control is placed on an XPage. All other regions that fall outside of editable areas are read-only and cannot be modified.  Have unique facet names (determines how UI controls get displayed in the editable area at run time). Facet names can be static or computed.  Static :  you can add only one UI control to the editable area. If you want to add more than one UI control, you can add a container control such as a table and add UI controls to it. Computed, you can determine which UI controls are displayed dynamically. Editable areas require you to add UI controls and set properties for them after you add the custom control to an XPage.
Exercise 4 Adding tabbed control Adding an editable area 3 new custom controls : searchForm, profilForm, searchResults Tips : Clic under the tab to see and update tab properties (or outline) Or right-click on the tab and select « Select Active Tab Contents »
Working with data in XPages (1) Define a data source on the xpage and then drag&drop fields onto the xpage Control dialog box enabled or disable Define a data source from the Data panel and then drag&drop data on controls
Working with data in XPages (2) Data binding Simple data : a field JavaScript : a document, a collection … Advanced : a variable … Tip Watch the data source name
Exercise 5 Optional, included in the starting database Creation of the Notes profile form (and data) Creation of Notes profiles view Creation of the profile XPage Tips Property « computeWithForm » to included computed fields in the document (ex.21) Use outline to reorder fields in table
Simple actions Basic actions Confirm action, execute script, open page, save data sources Document actions Change doc mode, create response document, delete (selected) document, modify field, save doc
Exercise 6 Complete the profile custom control Style Buttons Save, Delete, Cancel, Edit Add also hide properties to Save button Tips : Use the script editor to choose properties or methods document1 is the datasource of the form
@Functions and lists Most of old @Functions are implemented Can be mixted with JavaScript code Changes : Case sensitive Separator , instead of ; Lists : Fixed values (or import a list) Formula (@DbLookup & @DbColumn) Also used in type ahead (suggestions)
Exercise 7 Optional, included in the starting database Adding « setup » forms, views and documents (for lists) keywords form, keywordLookup view Customize the profil custom control Add type-ahead and suggestion on country field Add values to Gender combobox Add values to TimeZones combobox Tips : Use the script editor to choose functions
View control Linked to a Domino view Automatic pager (different styles) Rows / page, category filter, keys … Columns properties Sortable, checkbox, content type, links,  Tips Watch the data source name “ var” properties defines the request-scope attribute to access to a row data
Exercise 8 Add a simple view control
Global objects Share values across pages Can bind control to a scoped variable Use objects with properties and methods requestScope.put("hello", "Hello request") requestScope.get("hello") requestScope applicationScope  sessionScope
Exercise 9 In the searchForm control Add a « New profile » button Add profile search In the searchResults control Add a computed field (search criteria) Update the view selection  Tips A sessionScope variable is used to pass search criteria from one form to another Can also bind the search editbox to the sessionScope
Data validation (1) « Required field » + additionnal validation properties « Classics » events  onBlur, onChange, onClick … Field Validators Regular expression Scripted expression
Data validation (2) Client side or server side validation Error message popup or « Diplay error(s) » control In server properties, application properties or xpage / control properties Tips : use a generic library to check specific fields Optional Exercise 12
Exercise 10 Add validation to search criteria  Optional (check firstName <> lastName)
Exercise 11 Data validation tests Update  : in the profileSearch custom control disableclientSideValidation = false for field FirstName Add a Display Error control for field LastName and place disableclientSideValidation to true DOB must be less than « now » and place disableclientSideValidation to true Add a Display Errors control before buttons
Exercise 12 (optional) Data validation with a generic JavaScript library Tests on the existing validationTest XPage
Exercise 13 Data validation with validators Update  : in the profileForm EMail field mandatory Create « EMailConfirm » field Mandatory Use a regular constraint as validator in EMail [\w-]+@([\w-]+\.)+[\w-]+ Check that EMailConfirm & Email have same values Using a validateExpression Add a « Display error » for EMailConfirm field
Exercise 14 Complete tab navigation Clic on the result tab = clears the search term & open results XPage Add a new property « selectedTabId » Store the active tab Default tab = selectedTabId Fill the property for XPage (homeTab, resultsTab, profileTab) Tip Don’t forget « No data validation » when clicking on tabs compositeData object to access custom properties
Exercise 15 Adding an icon to the page Import .ico file in the webconten folder of the Java application Reference the icône in XPages (with page title) Tip Java perspective can be used to import other elements
Exercise 16  Optional, included in starting database Preparing « Friends » part Every profile can have a list of connected friends Classic Domino elements (forms & views)
Repeat control (1) Allows to repeat controls on an XPage Responses documents to a document Phone numbers for a contact, … Has a source property (data) Can be … document, view, JavaScript expression Returns a document collection Has a collection name property Allows to programmatically access to each document in the collection Return a NotesDocument (ie : friend)
Repeat control (2) To manipulate each document of the collection Use methods friend.removePermanently(true) « Classics controls » To repeat, just place them into the Repeat control To link to a field, use NotesDocument methods friend.getItemValueString(&quot;Name&quot;)
Exercise 17 Add a friend part in the profilForm custom control To list connected friends or to add a new one Profiles and friends will be linked by the NoteID=friendID Fields friendName (typeahead) and friendEMail (auto filled) and button to add a new friend to the current profile The button creates a new NotesDocument Add a panel with a repeat control to list connected friend Source is all friends having friendID = NoteID of current profile Tips friendName onBlur event : try to refresh only the friendEMail field
Theme Define the look and feel of an application Themes are server-side customization of HTML generation  Can be set globally, to apply to all applications run on that server, or applied to a single application Themes are different from Style Sheets in that they are not restricted to CSS styles number of rows displayed by a view can assign values to any JSF control properties when the XPage is created. can be targeted to apply specifically to pages created by XPages or Domino Web Engine technology. Can extend existing theme Each control has a themeId  INPUTFIELD_EDITBOX = &quot;InputField.EditBox&quot;
Exercise 18 Themes Explore themes in the discussion database Create your own theme in profile application
Exercise 19 Client and server side validation combined Add a client side validation before removing a connected friend Execute a client script to get DbName & sessionScope Tips Instruction “#{javascript: xxxxxx}”;  is evaluated on server side @DbName() only works on server side
Calling an agent - Pass the document NoteID to the agent Get the document in the agent  Session.currentAgent..ParamaterDocID Session.DocumentContext Getting the document context PostSave Document already in it’s saved state WebQuerySave Processed by the server, but before hits the disk Event xPage, 8.5 Old web dev.
Exercise 20 Call agent from XPages Optional  (in the starting database)  Create view, form Create XPage to add data and show entries Tips : Watch the data source name
Exercise 21 - Using existing @Formulas Add @Formulas to agentDemo form Tips : computeWithForm property
Exercise 22 Convert an existing Notes view into an XPage Import adequat xslt Use DXL Utilities Export Notes view into xml using xslt Import exported view
Exercise 23 In the TableWalker database Create an XPage 1 subject, multi (Color, Shape, Taste) fields 1 table to add Color / Shape / Taste row(s) 1 repeat control to display existing values
Exercise 23  The script library : Resource in the XPage addRow, removeRow using Library getDataSource : source of the repeat control Collection Name = fieldGroup Index Name = rowIndex
Exercise 24 Playing with HTML within an xPage Add HTML and Javascript embedded xPages renders any markup in computed fields into literal strings To avoid  disable  the output-escaping attribute Each control has this attribute Computed field can include JS or CSS You can provide the ID of elements
Localization (1) Database properties to specify languages => Extract localizable text into .properties files (clean project) Resources (properties files) are then created in the application Accessible in the package explorer eclipse view (can be exported) Contains : in-line text, values of localizable properties (labels, …) All .properties files are &quot;compiled in&quot; to your XPages, Matching with user's browser locale, but can be programmatically force
Localization (2) JavaScript and computed values are not extracted Create a properties file Add the file as xp:bundle resource in the xPage Use the bundle resource variable
Exercise 25 Localization
Exercise 26 Call a Java function in an xPage In the Java perspective Create folders Create an HelloWorld class Create an xPage Add an editbox control to fill the name Add a button calling the java class and setting a requestScope variable Ad a computed field displaying the requestScope variable
FAQs Session & Application Scope Session is for 1 user & 1 application Application is for 1 application and all users Sizing limitations ? JVM Heap Size Icon for all pages … not just a xPage property How to enforce a specific language

More Related Content

PDF
Angular Pipes Workshop
PDF
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
PPTX
Laravel Tutorial PPT
PPTX
ASP.NET MVC 3.0 Validation
PPTX
introduction à MongoDB
PDF
Spring Framework - Core
PDF
Laravel Routing and Query Building
PPTX
Modele mvc
Angular Pipes Workshop
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
Laravel Tutorial PPT
ASP.NET MVC 3.0 Validation
introduction à MongoDB
Spring Framework - Core
Laravel Routing and Query Building
Modele mvc

What's hot (20)

PDF
Introduction To CodeIgniter
PPTX
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
PDF
eServices-Chp2: SOA
PPT
10 component diagram
PPTX
Chp1- Introduction aux Technologies Web et SOA
PDF
Deployment Diagram
PPTX
laravel.pptx
PPT
Configuring Domino To Be An Ldap Directory And To Use An Ldap Directory
PDF
Introduction to Docker Compose
PPTX
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
ODP
Lotusphere 2011 SHOW104
PDF
Engage2022 - Domino Admin Tips
PPTX
UML and Software Modeling Tools.pptx
PPTX
Introduction to MERN Stack
PPTX
Laravel overview
PPT
Visula C# Programming Lecture 1
PDF
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
PPT
MVC ppt presentation
PDF
Introduction to GitHub Actions
PDF
How to write a Dockerfile
Introduction To CodeIgniter
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
eServices-Chp2: SOA
10 component diagram
Chp1- Introduction aux Technologies Web et SOA
Deployment Diagram
laravel.pptx
Configuring Domino To Be An Ldap Directory And To Use An Ldap Directory
Introduction to Docker Compose
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
Lotusphere 2011 SHOW104
Engage2022 - Domino Admin Tips
UML and Software Modeling Tools.pptx
Introduction to MERN Stack
Laravel overview
Visula C# Programming Lecture 1
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
MVC ppt presentation
Introduction to GitHub Actions
How to write a Dockerfile
Ad

Viewers also liked (20)

PDF
Ad108 - XPages in the IBM Lotus Notes Client - A Deep Dive!
PDF
XPages: No Experience Needed
PPT
Unlocking the OGS: Building Cognitive Solutions with IBM Domino, Watson and B...
PDF
Ad110 - Unleash the Power of Xpages
ODP
Building A Cool Web 2.0 Application With XPages
PDF
Privacy Matters for Lotus Notes & Domino Professionals
PPT
Lotus Notes Application to SharePoint Migration Process
PPT
Lotus Notes to SharePoint Migration
PDF
Show110 | Using the XPages Extension Library for the Real World
PPT
Lotus Notes Tips
PPTX
Angular.js in XPages
PDF
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
PPTX
Lotus Notes: Live Long and Prosper
PDF
Optimus XPages: An Explosion of Techniques and Best Practices
PDF
Introducing IBM Lotus Notes and Domino 8.5
PDF
DEV-1430 IBM Connections Integration
PPTX
Replacing Lotus Notes? Here's How It Really Goes Down
PDF
Connect 2017 DEV-1420 - Blue Mix and Domino – Complementing Smartcloud
PPTX
Migrating 3000 users and 1100 applications from Lotus Notes to Office 365
PDF
White Paper: Migrating IBM Lotus Notes and Domino to the Cloud: Selecting Mic...
Ad108 - XPages in the IBM Lotus Notes Client - A Deep Dive!
XPages: No Experience Needed
Unlocking the OGS: Building Cognitive Solutions with IBM Domino, Watson and B...
Ad110 - Unleash the Power of Xpages
Building A Cool Web 2.0 Application With XPages
Privacy Matters for Lotus Notes & Domino Professionals
Lotus Notes Application to SharePoint Migration Process
Lotus Notes to SharePoint Migration
Show110 | Using the XPages Extension Library for the Real World
Lotus Notes Tips
Angular.js in XPages
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Lotus Notes: Live Long and Prosper
Optimus XPages: An Explosion of Techniques and Best Practices
Introducing IBM Lotus Notes and Domino 8.5
DEV-1430 IBM Connections Integration
Replacing Lotus Notes? Here's How It Really Goes Down
Connect 2017 DEV-1420 - Blue Mix and Domino – Complementing Smartcloud
Migrating 3000 users and 1100 applications from Lotus Notes to Office 365
White Paper: Migrating IBM Lotus Notes and Domino to the Cloud: Selecting Mic...
Ad

Similar to XPages Workshop: Concepts And Exercises (20)

ODP
AD207 Presentation
PDF
Ad107 - Enhance Your Existing Applications with XPages
PDF
Creating a Great XPages User Interface
PDF
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
ODP
IBM Lotus Notes Domino XPages and XPages for Mobile
PPTX
Entwickler camp2012 make the impossible possible with x_pages
PDF
Just the Facets, Ma'am
PDF
XPages Blast - Lotusphere 2013
PDF
Connect 2014 - JMP102: Creating a Great XPages User Interface
ODP
Moving a Notes Application to the 21st Century
ODP
Approaches to Enhancing the User Experience
PDF
Move Your XPages Applications to the Fast Lane
PDF
Learning To Run - XPages for Lotus Notes Client Developers
PDF
Marty, You're Just Not Thinking Fourth Dimensionally
PDF
jQuery: The World's Most Popular JavaScript Library Comes to XPages
PDF
XPages and jQuery DataTables: Simplifying View Creation while Maximizing Func...
PDF
Learning to run
DOCX
PDF
Extjs Cookbook
PPT
Hnd201 Building Ibm Lotus Domino Applications With Ajax Plugins
AD207 Presentation
Ad107 - Enhance Your Existing Applications with XPages
Creating a Great XPages User Interface
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
IBM Lotus Notes Domino XPages and XPages for Mobile
Entwickler camp2012 make the impossible possible with x_pages
Just the Facets, Ma'am
XPages Blast - Lotusphere 2013
Connect 2014 - JMP102: Creating a Great XPages User Interface
Moving a Notes Application to the 21st Century
Approaches to Enhancing the User Experience
Move Your XPages Applications to the Fast Lane
Learning To Run - XPages for Lotus Notes Client Developers
Marty, You're Just Not Thinking Fourth Dimensionally
jQuery: The World's Most Popular JavaScript Library Comes to XPages
XPages and jQuery DataTables: Simplifying View Creation while Maximizing Func...
Learning to run
Extjs Cookbook
Hnd201 Building Ibm Lotus Domino Applications With Ajax Plugins

More from ddrschiw (19)

PDF
Traveler preview guide
ODT
Traveler preview guide
PDF
AD113 -- IBM Lotus Notes Discussion Template: Next Generation and Other OpenN...
PDF
Ad111
PDF
AD112 -- Development and Deployment of Lotus Product Documentation Wikis
PDF
AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM...
PDF
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
PDF
Ad109 - XPages Performance and Scalability
PDF
Ad106 - XPages Just Keep Getting Better
PDF
Ad103 - Have it Your Way: Extending IBM Lotus Domino Designer
PDF
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
PDF
Ad101 - IBM Lotus Domino Designer: Full Speed Ahead!
ODP
LotusSphere 2010 - Leveraging IBM Lotus® Forms™ with IBM WebSphere® Process S...
PPT
Webform Server 351 Architecture and Overview
PPT
Introduction To IBM Lotus Forms Viewer
PDF
Domino X Pages
PDF
Mlb Demo1
PPT
Lotus Forms Webform Server 3.0 Overview & Architecture
PPT
Lotus Forms Webform Server 3.0 Overview & Architecture
Traveler preview guide
Traveler preview guide
AD113 -- IBM Lotus Notes Discussion Template: Next Generation and Other OpenN...
Ad111
AD112 -- Development and Deployment of Lotus Product Documentation Wikis
AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
Ad109 - XPages Performance and Scalability
Ad106 - XPages Just Keep Getting Better
Ad103 - Have it Your Way: Extending IBM Lotus Domino Designer
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
Ad101 - IBM Lotus Domino Designer: Full Speed Ahead!
LotusSphere 2010 - Leveraging IBM Lotus® Forms™ with IBM WebSphere® Process S...
Webform Server 351 Architecture and Overview
Introduction To IBM Lotus Forms Viewer
Domino X Pages
Mlb Demo1
Lotus Forms Webform Server 3.0 Overview & Architecture
Lotus Forms Webform Server 3.0 Overview & Architecture

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
cuic standard and advanced reporting.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Mobile App Security Testing_ A Comprehensive Guide.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
cuic standard and advanced reporting.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Review of recent advances in non-invasive hemoglobin estimation
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation_ Review paper, used for researhc scholars
The Rise and Fall of 3GPP – Time for a Sabbatical?
Big Data Technologies - Introduction.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Understanding_Digital_Forensics_Presentation.pptx
Chapter 3 Spatial Domain Image Processing.pdf
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf

XPages Workshop: Concepts And Exercises

  • 2. Agenda Workshop Introduction What is XPages ? Domino Discussion template (demo) Working with XPages in IBM Lotus Domino Designer 8.5 Introduction with Designer 8.5 interface and XPage element Exercise 1 & 2 The profile application Other Exercises (3 => 26) Jacobs Engineering - Real Customer Scenario Development Model Deployment/Co-existence Environment Reuse of existing business logic XPages Futures... XPages on the client.. Write once, run on Web and Client Composite Application integration
  • 3. Materials Lotus Domino server Lotus Notes & Domino Designer 8.5 Folders : Starting database = profile00.nsf
  • 7. Working with XPages in IBM Lotus Domino Designer 8.5 (1)
  • 8. Working with XPages in IBM Lotus Domino Designer 8.5 (2) XPages must be compiled before the page is viewed in the broser HTTP Error 404 or old Xpages … Compilation errors
  • 9. Working with XPages in IBM Lotus Domino Designer 8.5 (3) Ctrl (shift) Alt and direction keys to resize controls Previewing xpage : Domino Server Security : XPages = agents Local Domino Designer (localhost) Anonymous (must be in LCA) Project saved & builded Not for custom controls
  • 10. Exercise 1 : Hello World ! Create an application Create a custom control Create a xpage and include the custom control
  • 11. Exercise 2 Hello World updated Label and Editbox to type your name Button to change the Label text and hide the editbox Partial refresh Tip : getComponent Global function to access the objects backing up UI controls Methods setValue() & getValue() New property definition iknowyou To hide the editbox compositeData object to access custom properties compositeData .iknowyou
  • 13. The Profiles Application What is it? An XPages application that manages user profiles information. Main features: Entry page allows a search to be submitted to retrieve profiles information based on that search: A simple “by name” search Results page lists the retrieved results in a tabular format: Drill-down on a selected result will navigate into that profile Profile information page displays read-only information about the selected profile Edit profile page allows a user to edit their own profile Create profile page allows a new user to fill out their profile
  • 14.  
  • 15.  
  • 16.  
  • 17. The starting database Contains “classic” Domino elements Forms Profile Keyword Friend agentDemo View Profiles keywordLookup Friends agentDemos Some documents TimeZones, Countries …
  • 18. Exercise 3 Update : start with the beginning database Creation of a custom control : container Creation of 3 XPages : home, results, profile Import resources (style sheet and images) Map styles to panels Tips Use outline to retriew or reorganize elements (nested panels)
  • 19. Editable Areas (callback controls) Editable areas are regions that users can modify when the custom control is placed on an XPage. All other regions that fall outside of editable areas are read-only and cannot be modified. Have unique facet names (determines how UI controls get displayed in the editable area at run time). Facet names can be static or computed. Static : you can add only one UI control to the editable area. If you want to add more than one UI control, you can add a container control such as a table and add UI controls to it. Computed, you can determine which UI controls are displayed dynamically. Editable areas require you to add UI controls and set properties for them after you add the custom control to an XPage.
  • 20. Exercise 4 Adding tabbed control Adding an editable area 3 new custom controls : searchForm, profilForm, searchResults Tips : Clic under the tab to see and update tab properties (or outline) Or right-click on the tab and select « Select Active Tab Contents »
  • 21. Working with data in XPages (1) Define a data source on the xpage and then drag&drop fields onto the xpage Control dialog box enabled or disable Define a data source from the Data panel and then drag&drop data on controls
  • 22. Working with data in XPages (2) Data binding Simple data : a field JavaScript : a document, a collection … Advanced : a variable … Tip Watch the data source name
  • 23. Exercise 5 Optional, included in the starting database Creation of the Notes profile form (and data) Creation of Notes profiles view Creation of the profile XPage Tips Property « computeWithForm » to included computed fields in the document (ex.21) Use outline to reorder fields in table
  • 24. Simple actions Basic actions Confirm action, execute script, open page, save data sources Document actions Change doc mode, create response document, delete (selected) document, modify field, save doc
  • 25. Exercise 6 Complete the profile custom control Style Buttons Save, Delete, Cancel, Edit Add also hide properties to Save button Tips : Use the script editor to choose properties or methods document1 is the datasource of the form
  • 26. @Functions and lists Most of old @Functions are implemented Can be mixted with JavaScript code Changes : Case sensitive Separator , instead of ; Lists : Fixed values (or import a list) Formula (@DbLookup & @DbColumn) Also used in type ahead (suggestions)
  • 27. Exercise 7 Optional, included in the starting database Adding « setup » forms, views and documents (for lists) keywords form, keywordLookup view Customize the profil custom control Add type-ahead and suggestion on country field Add values to Gender combobox Add values to TimeZones combobox Tips : Use the script editor to choose functions
  • 28. View control Linked to a Domino view Automatic pager (different styles) Rows / page, category filter, keys … Columns properties Sortable, checkbox, content type, links, Tips Watch the data source name “ var” properties defines the request-scope attribute to access to a row data
  • 29. Exercise 8 Add a simple view control
  • 30. Global objects Share values across pages Can bind control to a scoped variable Use objects with properties and methods requestScope.put(&quot;hello&quot;, &quot;Hello request&quot;) requestScope.get(&quot;hello&quot;) requestScope applicationScope sessionScope
  • 31. Exercise 9 In the searchForm control Add a « New profile » button Add profile search In the searchResults control Add a computed field (search criteria) Update the view selection Tips A sessionScope variable is used to pass search criteria from one form to another Can also bind the search editbox to the sessionScope
  • 32. Data validation (1) « Required field » + additionnal validation properties « Classics » events onBlur, onChange, onClick … Field Validators Regular expression Scripted expression
  • 33. Data validation (2) Client side or server side validation Error message popup or « Diplay error(s) » control In server properties, application properties or xpage / control properties Tips : use a generic library to check specific fields Optional Exercise 12
  • 34. Exercise 10 Add validation to search criteria Optional (check firstName <> lastName)
  • 35. Exercise 11 Data validation tests Update : in the profileSearch custom control disableclientSideValidation = false for field FirstName Add a Display Error control for field LastName and place disableclientSideValidation to true DOB must be less than « now » and place disableclientSideValidation to true Add a Display Errors control before buttons
  • 36. Exercise 12 (optional) Data validation with a generic JavaScript library Tests on the existing validationTest XPage
  • 37. Exercise 13 Data validation with validators Update : in the profileForm EMail field mandatory Create « EMailConfirm » field Mandatory Use a regular constraint as validator in EMail [\w-]+@([\w-]+\.)+[\w-]+ Check that EMailConfirm & Email have same values Using a validateExpression Add a « Display error » for EMailConfirm field
  • 38. Exercise 14 Complete tab navigation Clic on the result tab = clears the search term & open results XPage Add a new property « selectedTabId » Store the active tab Default tab = selectedTabId Fill the property for XPage (homeTab, resultsTab, profileTab) Tip Don’t forget « No data validation » when clicking on tabs compositeData object to access custom properties
  • 39. Exercise 15 Adding an icon to the page Import .ico file in the webconten folder of the Java application Reference the icône in XPages (with page title) Tip Java perspective can be used to import other elements
  • 40. Exercise 16 Optional, included in starting database Preparing « Friends » part Every profile can have a list of connected friends Classic Domino elements (forms & views)
  • 41. Repeat control (1) Allows to repeat controls on an XPage Responses documents to a document Phone numbers for a contact, … Has a source property (data) Can be … document, view, JavaScript expression Returns a document collection Has a collection name property Allows to programmatically access to each document in the collection Return a NotesDocument (ie : friend)
  • 42. Repeat control (2) To manipulate each document of the collection Use methods friend.removePermanently(true) « Classics controls » To repeat, just place them into the Repeat control To link to a field, use NotesDocument methods friend.getItemValueString(&quot;Name&quot;)
  • 43. Exercise 17 Add a friend part in the profilForm custom control To list connected friends or to add a new one Profiles and friends will be linked by the NoteID=friendID Fields friendName (typeahead) and friendEMail (auto filled) and button to add a new friend to the current profile The button creates a new NotesDocument Add a panel with a repeat control to list connected friend Source is all friends having friendID = NoteID of current profile Tips friendName onBlur event : try to refresh only the friendEMail field
  • 44. Theme Define the look and feel of an application Themes are server-side customization of HTML generation Can be set globally, to apply to all applications run on that server, or applied to a single application Themes are different from Style Sheets in that they are not restricted to CSS styles number of rows displayed by a view can assign values to any JSF control properties when the XPage is created. can be targeted to apply specifically to pages created by XPages or Domino Web Engine technology. Can extend existing theme Each control has a themeId INPUTFIELD_EDITBOX = &quot;InputField.EditBox&quot;
  • 45. Exercise 18 Themes Explore themes in the discussion database Create your own theme in profile application
  • 46. Exercise 19 Client and server side validation combined Add a client side validation before removing a connected friend Execute a client script to get DbName & sessionScope Tips Instruction “#{javascript: xxxxxx}”; is evaluated on server side @DbName() only works on server side
  • 47. Calling an agent - Pass the document NoteID to the agent Get the document in the agent Session.currentAgent..ParamaterDocID Session.DocumentContext Getting the document context PostSave Document already in it’s saved state WebQuerySave Processed by the server, but before hits the disk Event xPage, 8.5 Old web dev.
  • 48. Exercise 20 Call agent from XPages Optional (in the starting database) Create view, form Create XPage to add data and show entries Tips : Watch the data source name
  • 49. Exercise 21 - Using existing @Formulas Add @Formulas to agentDemo form Tips : computeWithForm property
  • 50. Exercise 22 Convert an existing Notes view into an XPage Import adequat xslt Use DXL Utilities Export Notes view into xml using xslt Import exported view
  • 51. Exercise 23 In the TableWalker database Create an XPage 1 subject, multi (Color, Shape, Taste) fields 1 table to add Color / Shape / Taste row(s) 1 repeat control to display existing values
  • 52. Exercise 23 The script library : Resource in the XPage addRow, removeRow using Library getDataSource : source of the repeat control Collection Name = fieldGroup Index Name = rowIndex
  • 53. Exercise 24 Playing with HTML within an xPage Add HTML and Javascript embedded xPages renders any markup in computed fields into literal strings To avoid disable the output-escaping attribute Each control has this attribute Computed field can include JS or CSS You can provide the ID of elements
  • 54. Localization (1) Database properties to specify languages => Extract localizable text into .properties files (clean project) Resources (properties files) are then created in the application Accessible in the package explorer eclipse view (can be exported) Contains : in-line text, values of localizable properties (labels, …) All .properties files are &quot;compiled in&quot; to your XPages, Matching with user's browser locale, but can be programmatically force
  • 55. Localization (2) JavaScript and computed values are not extracted Create a properties file Add the file as xp:bundle resource in the xPage Use the bundle resource variable
  • 57. Exercise 26 Call a Java function in an xPage In the Java perspective Create folders Create an HelloWorld class Create an xPage Add an editbox control to fill the name Add a button calling the java class and setting a requestScope variable Ad a computed field displaying the requestScope variable
  • 58. FAQs Session & Application Scope Session is for 1 user & 1 application Application is for 1 application and all users Sizing limitations ? JVM Heap Size Icon for all pages … not just a xPage property How to enforce a specific language

Editor's Notes

  • #3: End of day1 = Ex17 done ???
  • #6: Discussion7 and discussion8.nsf Sign applications Open discussion7 in Notes, and By Author in a web browser URL ? Open discussion8 in Notes, and By Author in a web browser Look in Notes client ? Web interface : topic, tags, pager, expand / collapse … URL = xsp
  • #8: Tour of Designer interface Designer 8.5 Panels Design / source Controls (or create menu) Properties Code panels (@functions, …)
  • #9: If this is not selected: ... and the XPage has never been compiled, you&apos;ll see errors such as HTTP Error 404: Item Not Found Exception in the web browser. ... and the XPage has been compiled, but not since the most recent change, you may not see the most recent changes reflected in the browser.
  • #12: Iknowyou = to store the fact that name has been filled and then use it to hide the editbox
  • #20: Permet ici d’avoir un seul custom control (container), et de faire en sorte que quand on l’inclut dans un page (potentiellement plusieurs fois), on puisse modifier ses propriétés pour chaque page
  • #21: Editable area in the container control (that’ll be in the 3 xpages) Drag and drop each of the 3 new forms in the facet of each of xpages
  • #23: Datasourcename returns a NotesXspDocument
  • #25: As old Designer release, on agent or action buttons
  • #29: Var …. Par exemple pour accéder à un champ noteID du document …
  • #31: Already talk about a global function (getComponent) .. Here are global objects Can avoid to use old profile documents or notes.ini variables applicationScope : All users, same application sessionScope : Specific user, one application
  • #33: Script library has to be included as resource of the xpage or custom control
  • #34: Script library has to be included as resource of the xpage or custom control
  • #37: getElementById = DOMDocument
  • #38: Based on the original Exercise, but applied to the profile application
  • #39: Before this Exercise : Tab navigation is not complete : tab are not selected When clicking on results, search is not cleared
  • #55: Updates : - Files updated depending the application properties - Original file update and update manually other files depending of application properties