SlideShare ist ein Scribd-Unternehmen logo
1 von 16
GEEK101 How To Build a
                         Multi-Field Search Page For Your
                         IBM Domino XPages Application
                         Mike McGarel | Collaborative Solutions Developer
                                        Czarnowski Display Services Inc




© 2013 IBM Corporation
Mike McGarel

   Working with web technologies for over 13 years

   Working with Notes/Domino since version 4.6

   Corporate developer


   Site developer for MWLUG and SkiLUG




2   © 2013 IBM Corporation
Searching Can Be Time-Consuming




3   © 2013 IBM Corporation
Multi-Field Searching

   Also known as faceted searching


   Allows user to easily narrow results


   Commonly used on shopping sites


   Many ways to do this with XPages


   Example project on OpenNTF




4   © 2013 IBM Corporation
5   © 2013 IBM Corporation
“Faceted Search with Standby” Project on OpenNTF

   On OpenNTF:
    http://www.openntf.org/internal/home.nsf/project.xsp?
    action=openDocument&name=Faceted%20Search%20with%20Standby

   Components on the XPage
     ─ view panel for search results
     ─ Dojo module for standby image
     ─ search fields and button to trigger the process
     ─ Server-side JavaScript function(s)
     ─ Client-side JavaScript script(s)

   Database is variation of David Leedy's FakeNames.nsf on
    XPagesCheatSheet.com


6   © 2013 IBM Corporation
Server-side JavaScript (SSJS)

function buildPeopleQuery() {
 var sFirst = sessionScope.get("firstValue");
 var sLast = sessionScope.get("lastValue");
 var sState = sessionScope.get("stateValue");
 var sOccupation = sessionScope.get("occupationValue");
 var fieldArray = [];
 if (sFirst != "") { addToQuery(sFirst,"AND",fieldArray,"firstname"); }
 if (sLast != "") { addToQuery(sLast,"AND",fieldArray,"lastname"); }
 if (sState != "") { addToQuery(sState,"AND",fieldArray,"state"); }
 if (sOccupation != "") { addToQuery(sOccupation,"AND",fieldArray,"occupation"); }
 var fieldQuery = "";
 if (fieldArray.length > 0) {
        if (fieldArray.length == 1) {fieldQuery += fieldArray[0]; } else {fieldQuery += "(" + fieldArray.join(" AND ") + ")"; }
  }
 return fieldQuery;
}

function addToQuery(str,connector,targetArray,fieldName) {
       var ret = "";
       if ((fieldName != null) && (fieldName != "")) { ret = "[" + fieldName + "]="; }
       if (@Contains(str, " ")) {
               var arr = str.split(" ");
               targetArray.push(ret + "(" + arr.join(" " + connector + " ") + ")");
       } else {
               targetArray.push("(" + ret + str + ")");
      }
}

7     © 2013 IBM Corporation
Client-side JavaScript for Firefox, Chrome, and Safari

<xp:scriptBlock rendered="#{javascript:!context.getUserAgent().isIE();}">
    <xp:this.value><![CDATA[
         var standby;
         function addStandby() {
             standby = new dojox.widget.Standby({target:'#{id:namesPanel}'});
             document.body.appendChild(standby.domNode);
             standby.startup();
             standby.show();
         }
         function removeStandby() {
             standby.hide();
             dojo.destroy(standby.domNode);
    }]]></xp:this.value>
</xp:scriptBlock>
8   © 2013 IBM Corporation
Client-side JavaScript for Internet Explorer

<xp:scriptBlock rendered="#{javascript:context.getUserAgent().isIE();}">
    <xp:this.value><![CDATA[
         var standby;
         function addStandby() {
             dojo.addClass(dojo.byId('#{id:namesPanel}'),'displayNone');
             dojo.removeClass(dojo.byId('#{id:divProcessing}'),'displayNone');
         }
         function removeStandby() {
             dojo.addClass(dojo.byId('#{id:divProcessing}'),'displayNone');
             dojo.removeClass(dojo.byId('#{id:namesPanel}'),'displayNone');
    }]]></xp:this.value>
</xp:scriptBlock>



9   © 2013 IBM Corporation
Button Code

<xp:link escape="true" text="Update People List" id="linkPeopleList"
    outerStyleClass="lotusBtn" title="Update people list" style="width:80%;">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="partial" refreshId="namesPanel">
                <xp:this.onStart>
                   <![CDATA[addStandby();]]></xp:this.onStart>
                <xp:this.onComplete>
                   <![CDATA[removeStandby();]]></xp:this.onComplete>
        </xp:eventHandler>
</xp:link>

 




10   © 2013 IBM Corporation
View Panel Setup

    Set search property to function, e.g., “return buildPeopleQuery()”
 

    Set searchExactMatch property to false




11   © 2013 IBM Corporation
Process Flow

 (1)     User enters values in field(s)
 (2)
 (3)     User clicks button to search
 (4)
 (5)     Button triggers AJAX refresh on view panel
 (6)
 (7)     View panel displays search results based on SSJS function
         (if needed, displays “standby” image while processing)
 (8)
 (9) Because search values are kept in sessionScope variables, the same
     results are displayed if user leaves then returns to the page
 

 



12     © 2013 IBM Corporation
13   © 2013 IBM Corporation
XPages Resources

    XPages.Info (http://xpages.info)
    XPages Forum (http://www-10.lotus.com/ldd/xpagesforum.nsf)
    Notes/Domino Application Development Wiki
     (http://www-10.lotus.com/ldd/ddwiki.nsf)
    YouAtNotes XPages wiki (http://www.xpageswiki.com)
    Notes in 9 (http://www.notesin9.com)
    Stack Overflow (http://stackoverflow.com/questions/tagged/xpages)
    Mastering XPages (IBM Press)
    XPages Extension Library (IBM Press)
    XPages Portable Command Guide (IBM Press)




14   © 2013 IBM Corporation
Questions and Evaluations

 Mike McGarel
 Collaborative Solutions Developer
 Czarnowski Display Services Inc
 mcgarelgramming@gmail.com
 www.twitter.com/mmcgarel
 www.bleedyellow.com/blogs/McGarelGramming




                              THANK YOU!


15   © 2013 IBM Corporation
Legal disclaimer

     © IBM Corporation 2013. 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.
      Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other
      countries, or both.
      All references refer to fictitious companies and persons and are used for illustration purposes only.




16      © 2013 IBM Corporation

Weitere ähnliche Inhalte

Was ist angesagt?

High Performance JavaScript - Fronteers 2010
High Performance JavaScript - Fronteers 2010High Performance JavaScript - Fronteers 2010
High Performance JavaScript - Fronteers 2010Nicholas Zakas
 
HTML5 vs Silverlight
HTML5 vs SilverlightHTML5 vs Silverlight
HTML5 vs SilverlightMatt Casto
 
YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)Nicholas Zakas
 
Nicholas' Performance Talk at Google
Nicholas' Performance Talk at GoogleNicholas' Performance Talk at Google
Nicholas' Performance Talk at GoogleNicholas Zakas
 
JMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is NowJMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is NowRussell Maher
 
Responsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UIResponsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UIChris Toohey
 
Bootstrap4XPages webinar
Bootstrap4XPages webinarBootstrap4XPages webinar
Bootstrap4XPages webinarMark Leusink
 
Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...IT Event
 
Turducken - Divide and Conquer large GWT apps with multiple teams
Turducken - Divide and Conquer large GWT apps with multiple teamsTurducken - Divide and Conquer large GWT apps with multiple teams
Turducken - Divide and Conquer large GWT apps with multiple teamsRobert Keane
 
JavaScript Timers, Power Consumption, and Performance
JavaScript Timers, Power Consumption, and PerformanceJavaScript Timers, Power Consumption, and Performance
JavaScript Timers, Power Consumption, and PerformanceNicholas Zakas
 
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next LevelMWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Levelbalassaitis
 
Front-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsFront-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsArtur Cistov
 
HoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOpsHoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOpsSarah Sexton
 
7 tips for javascript rich ajax websites
7 tips for javascript rich ajax websites7 tips for javascript rich ajax websites
7 tips for javascript rich ajax websitesoazabir
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuAppUniverz Org
 
Tips for Building your First XPages Java Application
Tips for Building your First XPages Java ApplicationTips for Building your First XPages Java Application
Tips for Building your First XPages Java ApplicationTeamstudio
 
Bootstrap4XPages
Bootstrap4XPagesBootstrap4XPages
Bootstrap4XPagesTeamstudio
 
MozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: TaipeiMozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: Taipeilittlebtc
 
Jetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browserJetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browserlittlebtc
 
MozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: TaichungMozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: Taichunglittlebtc
 

Was ist angesagt? (20)

High Performance JavaScript - Fronteers 2010
High Performance JavaScript - Fronteers 2010High Performance JavaScript - Fronteers 2010
High Performance JavaScript - Fronteers 2010
 
HTML5 vs Silverlight
HTML5 vs SilverlightHTML5 vs Silverlight
HTML5 vs Silverlight
 
YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)
 
Nicholas' Performance Talk at Google
Nicholas' Performance Talk at GoogleNicholas' Performance Talk at Google
Nicholas' Performance Talk at Google
 
JMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is NowJMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is Now
 
Responsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UIResponsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UI
 
Bootstrap4XPages webinar
Bootstrap4XPages webinarBootstrap4XPages webinar
Bootstrap4XPages webinar
 
Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...
 
Turducken - Divide and Conquer large GWT apps with multiple teams
Turducken - Divide and Conquer large GWT apps with multiple teamsTurducken - Divide and Conquer large GWT apps with multiple teams
Turducken - Divide and Conquer large GWT apps with multiple teams
 
JavaScript Timers, Power Consumption, and Performance
JavaScript Timers, Power Consumption, and PerformanceJavaScript Timers, Power Consumption, and Performance
JavaScript Timers, Power Consumption, and Performance
 
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next LevelMWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
 
Front-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsFront-end optimisation & jQuery Internals
Front-end optimisation & jQuery Internals
 
HoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOpsHoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOps
 
7 tips for javascript rich ajax websites
7 tips for javascript rich ajax websites7 tips for javascript rich ajax websites
7 tips for javascript rich ajax websites
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. Wu
 
Tips for Building your First XPages Java Application
Tips for Building your First XPages Java ApplicationTips for Building your First XPages Java Application
Tips for Building your First XPages Java Application
 
Bootstrap4XPages
Bootstrap4XPagesBootstrap4XPages
Bootstrap4XPages
 
MozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: TaipeiMozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: Taipei
 
Jetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browserJetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browser
 
MozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: TaichungMozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: Taichung
 

Ähnlich wie How To Build a Multi-Field Search Page For Your XPages Application

IBM Lotusphere 2013 AD109: Using the IBM® Sametime® Proxy SDK: WebSphere Port...
IBM Lotusphere 2013 AD109: Using the IBM® Sametime® Proxy SDK: WebSphere Port...IBM Lotusphere 2013 AD109: Using the IBM® Sametime® Proxy SDK: WebSphere Port...
IBM Lotusphere 2013 AD109: Using the IBM® Sametime® Proxy SDK: WebSphere Port...William Holmes
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Tugdual Grall
 
Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...
Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...
Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...Martin Meijer
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...DataLeader.io
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 
BP204 - Take a REST and put your data to work with APIs!
BP204 - Take a REST and put your data to work with APIs!BP204 - Take a REST and put your data to work with APIs!
BP204 - Take a REST and put your data to work with APIs!Craig Schumann
 
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...Carl Tyler
 
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...ddrschiw
 
Where Does IBM Web Experience Factory Fit in your Architecture? TECH-D22 from...
Where Does IBM Web Experience Factory Fit in your Architecture? TECH-D22 from...Where Does IBM Web Experience Factory Fit in your Architecture? TECH-D22 from...
Where Does IBM Web Experience Factory Fit in your Architecture? TECH-D22 from...Davalen LLC
 
XPages Blast - ILUG 2010
XPages Blast - ILUG 2010XPages Blast - ILUG 2010
XPages Blast - ILUG 2010Tim Clark
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Eliran Eliassy
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest servicesIoan Eugen Stan
 
"Progressive Web Apps" by Riza Fahmi (Hacktiv8)
"Progressive Web Apps" by Riza Fahmi	(Hacktiv8)"Progressive Web Apps" by Riza Fahmi	(Hacktiv8)
"Progressive Web Apps" by Riza Fahmi (Hacktiv8)Tech in Asia ID
 
Progressive Web Apps. What, why and how
Progressive Web Apps. What, why and howProgressive Web Apps. What, why and how
Progressive Web Apps. What, why and howRiza Fahmi
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...Joel Oleson
 
DS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham ChartersDS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham Chartersmfrancis
 

Ähnlich wie How To Build a Multi-Field Search Page For Your XPages Application (20)

IBM Lotusphere 2013 AD109: Using the IBM® Sametime® Proxy SDK: WebSphere Port...
IBM Lotusphere 2013 AD109: Using the IBM® Sametime® Proxy SDK: WebSphere Port...IBM Lotusphere 2013 AD109: Using the IBM® Sametime® Proxy SDK: WebSphere Port...
IBM Lotusphere 2013 AD109: Using the IBM® Sametime® Proxy SDK: WebSphere Port...
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
 
Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...
Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...
Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Mean stack Magics
Mean stack MagicsMean stack Magics
Mean stack Magics
 
What's new in designer
What's new in designerWhat's new in designer
What's new in designer
 
BP204 - Take a REST and put your data to work with APIs!
BP204 - Take a REST and put your data to work with APIs!BP204 - Take a REST and put your data to work with APIs!
BP204 - Take a REST and put your data to work with APIs!
 
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
 
Ad111
Ad111Ad111
Ad111
 
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
 
Where Does IBM Web Experience Factory Fit in your Architecture? TECH-D22 from...
Where Does IBM Web Experience Factory Fit in your Architecture? TECH-D22 from...Where Does IBM Web Experience Factory Fit in your Architecture? TECH-D22 from...
Where Does IBM Web Experience Factory Fit in your Architecture? TECH-D22 from...
 
XPages Blast - ILUG 2010
XPages Blast - ILUG 2010XPages Blast - ILUG 2010
XPages Blast - ILUG 2010
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
 
"Progressive Web Apps" by Riza Fahmi (Hacktiv8)
"Progressive Web Apps" by Riza Fahmi	(Hacktiv8)"Progressive Web Apps" by Riza Fahmi	(Hacktiv8)
"Progressive Web Apps" by Riza Fahmi (Hacktiv8)
 
Progressive Web Apps. What, why and how
Progressive Web Apps. What, why and howProgressive Web Apps. What, why and how
Progressive Web Apps. What, why and how
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
 
DS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham ChartersDS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham Charters
 

Mehr von Michael McGarel

Extreme Development: Pair Programming
Extreme Development: Pair ProgrammingExtreme Development: Pair Programming
Extreme Development: Pair ProgrammingMichael McGarel
 
MWLUG2014 AD107 First Java App Tips
MWLUG2014 AD107 First Java App TipsMWLUG2014 AD107 First Java App Tips
MWLUG2014 AD107 First Java App TipsMichael McGarel
 
XPages Workshop: Customizing OneUI
XPages Workshop: Customizing OneUIXPages Workshop: Customizing OneUI
XPages Workshop: Customizing OneUIMichael McGarel
 
Two CCs of Layout -- Stat
Two CCs of Layout -- StatTwo CCs of Layout -- Stat
Two CCs of Layout -- StatMichael McGarel
 
XPages - The Ties That Bind
XPages - The Ties That BindXPages - The Ties That Bind
XPages - The Ties That BindMichael McGarel
 
Approaches to Enhancing the User Experience
Approaches to Enhancing the User ExperienceApproaches to Enhancing the User Experience
Approaches to Enhancing the User ExperienceMichael McGarel
 

Mehr von Michael McGarel (8)

Next Level Coding
Next Level CodingNext Level Coding
Next Level Coding
 
Object(ive) Thinking
Object(ive) ThinkingObject(ive) Thinking
Object(ive) Thinking
 
Extreme Development: Pair Programming
Extreme Development: Pair ProgrammingExtreme Development: Pair Programming
Extreme Development: Pair Programming
 
MWLUG2014 AD107 First Java App Tips
MWLUG2014 AD107 First Java App TipsMWLUG2014 AD107 First Java App Tips
MWLUG2014 AD107 First Java App Tips
 
XPages Workshop: Customizing OneUI
XPages Workshop: Customizing OneUIXPages Workshop: Customizing OneUI
XPages Workshop: Customizing OneUI
 
Two CCs of Layout -- Stat
Two CCs of Layout -- StatTwo CCs of Layout -- Stat
Two CCs of Layout -- Stat
 
XPages - The Ties That Bind
XPages - The Ties That BindXPages - The Ties That Bind
XPages - The Ties That Bind
 
Approaches to Enhancing the User Experience
Approaches to Enhancing the User ExperienceApproaches to Enhancing the User Experience
Approaches to Enhancing the User Experience
 

Kürzlich hochgeladen

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
🐬 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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Kürzlich hochgeladen (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

How To Build a Multi-Field Search Page For Your XPages Application

  • 1. GEEK101 How To Build a Multi-Field Search Page For Your IBM Domino XPages Application Mike McGarel | Collaborative Solutions Developer Czarnowski Display Services Inc © 2013 IBM Corporation
  • 2. Mike McGarel  Working with web technologies for over 13 years  Working with Notes/Domino since version 4.6  Corporate developer   Site developer for MWLUG and SkiLUG 2 © 2013 IBM Corporation
  • 3. Searching Can Be Time-Consuming 3 © 2013 IBM Corporation
  • 4. Multi-Field Searching  Also known as faceted searching   Allows user to easily narrow results   Commonly used on shopping sites   Many ways to do this with XPages   Example project on OpenNTF 4 © 2013 IBM Corporation
  • 5. 5 © 2013 IBM Corporation
  • 6. “Faceted Search with Standby” Project on OpenNTF  On OpenNTF: http://www.openntf.org/internal/home.nsf/project.xsp? action=openDocument&name=Faceted%20Search%20with%20Standby  Components on the XPage ─ view panel for search results ─ Dojo module for standby image ─ search fields and button to trigger the process ─ Server-side JavaScript function(s) ─ Client-side JavaScript script(s)  Database is variation of David Leedy's FakeNames.nsf on XPagesCheatSheet.com 6 © 2013 IBM Corporation
  • 7. Server-side JavaScript (SSJS) function buildPeopleQuery() { var sFirst = sessionScope.get("firstValue"); var sLast = sessionScope.get("lastValue"); var sState = sessionScope.get("stateValue"); var sOccupation = sessionScope.get("occupationValue"); var fieldArray = []; if (sFirst != "") { addToQuery(sFirst,"AND",fieldArray,"firstname"); } if (sLast != "") { addToQuery(sLast,"AND",fieldArray,"lastname"); } if (sState != "") { addToQuery(sState,"AND",fieldArray,"state"); } if (sOccupation != "") { addToQuery(sOccupation,"AND",fieldArray,"occupation"); } var fieldQuery = ""; if (fieldArray.length > 0) { if (fieldArray.length == 1) {fieldQuery += fieldArray[0]; } else {fieldQuery += "(" + fieldArray.join(" AND ") + ")"; } } return fieldQuery; } function addToQuery(str,connector,targetArray,fieldName) { var ret = ""; if ((fieldName != null) && (fieldName != "")) { ret = "[" + fieldName + "]="; } if (@Contains(str, " ")) { var arr = str.split(" "); targetArray.push(ret + "(" + arr.join(" " + connector + " ") + ")"); } else { targetArray.push("(" + ret + str + ")"); } } 7 © 2013 IBM Corporation
  • 8. Client-side JavaScript for Firefox, Chrome, and Safari <xp:scriptBlock rendered="#{javascript:!context.getUserAgent().isIE();}"> <xp:this.value><![CDATA[ var standby; function addStandby() { standby = new dojox.widget.Standby({target:'#{id:namesPanel}'}); document.body.appendChild(standby.domNode); standby.startup(); standby.show(); } function removeStandby() { standby.hide(); dojo.destroy(standby.domNode); }]]></xp:this.value> </xp:scriptBlock> 8 © 2013 IBM Corporation
  • 9. Client-side JavaScript for Internet Explorer <xp:scriptBlock rendered="#{javascript:context.getUserAgent().isIE();}"> <xp:this.value><![CDATA[ var standby; function addStandby() { dojo.addClass(dojo.byId('#{id:namesPanel}'),'displayNone'); dojo.removeClass(dojo.byId('#{id:divProcessing}'),'displayNone'); } function removeStandby() { dojo.addClass(dojo.byId('#{id:divProcessing}'),'displayNone'); dojo.removeClass(dojo.byId('#{id:namesPanel}'),'displayNone'); }]]></xp:this.value> </xp:scriptBlock> 9 © 2013 IBM Corporation
  • 10. Button Code <xp:link escape="true" text="Update People List" id="linkPeopleList" outerStyleClass="lotusBtn" title="Update people list" style="width:80%;"> <xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="namesPanel"> <xp:this.onStart> <![CDATA[addStandby();]]></xp:this.onStart> <xp:this.onComplete> <![CDATA[removeStandby();]]></xp:this.onComplete> </xp:eventHandler> </xp:link>  10 © 2013 IBM Corporation
  • 11. View Panel Setup  Set search property to function, e.g., “return buildPeopleQuery()”   Set searchExactMatch property to false 11 © 2013 IBM Corporation
  • 12. Process Flow (1) User enters values in field(s) (2) (3) User clicks button to search (4) (5) Button triggers AJAX refresh on view panel (6) (7) View panel displays search results based on SSJS function (if needed, displays “standby” image while processing) (8) (9) Because search values are kept in sessionScope variables, the same results are displayed if user leaves then returns to the page   12 © 2013 IBM Corporation
  • 13. 13 © 2013 IBM Corporation
  • 14. XPages Resources  XPages.Info (http://xpages.info)  XPages Forum (http://www-10.lotus.com/ldd/xpagesforum.nsf)  Notes/Domino Application Development Wiki (http://www-10.lotus.com/ldd/ddwiki.nsf)  YouAtNotes XPages wiki (http://www.xpageswiki.com)  Notes in 9 (http://www.notesin9.com)  Stack Overflow (http://stackoverflow.com/questions/tagged/xpages)  Mastering XPages (IBM Press)  XPages Extension Library (IBM Press)  XPages Portable Command Guide (IBM Press) 14 © 2013 IBM Corporation
  • 15. Questions and Evaluations Mike McGarel Collaborative Solutions Developer Czarnowski Display Services Inc mcgarelgramming@gmail.com www.twitter.com/mmcgarel www.bleedyellow.com/blogs/McGarelGramming THANK YOU! 15 © 2013 IBM Corporation
  • 16. Legal disclaimer © IBM Corporation 2013. 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. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. All references refer to fictitious companies and persons and are used for illustration purposes only. 16 © 2013 IBM Corporation