My presentation at MWLUG 2015. I show how to build and connect a modern looking website, built with HTML, CSS, and Javascript/jQuery, to your existing IBM Domino backend data using Ajax and JSON and some simple Lotusscript code.
In this talk, we’ll discuss the benefits of the document-based data model that MongoDB offers by walking through how one can build a simple app. We'll show you how to design a full-blown RSS Aggregation service to replace the loss the world suffered when Google Reader was shutdown.
We'll dive deeper into topics, such as how to model your data and create your REST API using MongoDB, Express.js and Node.js (core components of the MEAN stack). This session will jumpstart your development knowledge of MongoDB.
The document discusses the evolution of web applications from thin clients with fat servers to more balanced architectures. New browser technologies like HTML5, faster JavaScript engines, local storage, and offline capabilities allow more processing to be done locally on the client. This enables richer interfaces, offline usage, and more balanced work distribution between the client and server. It provides examples of how a web application may utilize these new capabilities, such as storing data locally and caching interfaces while communicating with a server via JSON.
Asynchronous Web Programming with HTML5 WebSockets and Java
(Talk originally given @ KCDC - http://kcdc.info ).
Over the last decade, advances in web computing have removed many of the barriers to entry for developers. New languages, frameworks, and development methodologies have kickstarted new ideas and new ways to develop web applications to make modern life easier and more efficient. WebSockets (introduced as part of HTML5) is one such technology that enables a new class of scalable, super-responsive, collaborative, and real-time web applications with a wide range of uses.
In this talk, we will first cover the basics of asynchronous web programming using WebSockets, including predecessors such as polling and long-polling, applications of WebSockets, its limitations and potential bottlenecks, and potential future improvements.
Next, we will demo and dissect a real-world use case for realtime social data analytics, using the Apache Tomcat implementation of WebSockets and the Java-based Liferay Portal Server. This will include a discussion about development of WebSocket endpoints, its lifecycle within the application container and browser, debugging WebSockets, and scalability topics.
Http Service will help us fetch external data, post to it, etc. We need to import the http module to make use of the http service. Let us consider an example to understand how to make use of the http service.
This document provides an overview of how to use Postman, a tool for building and testing APIs. It discusses how Postman allows users to quickly build API requests, organize requests into collections with folders and descriptions, share collections with teams, use environments to switch between development and production APIs, write test scripts to automate testing, and run collections from the command line with Newman.
Sherlock Homepage - A detective story about running large web services - NDC ...
The site was slow. CPU and memory usage everywhere! Some dead objects in the corner. Something terrible must have happened! We have some IIS logs. Some traces from a witness. But not enough to find out what was wrong. In this session, we’ll see how effective telemetry, a profiler or two as well as a refresher of how IIS runs our ASP.NET web applications can help solve this server murder mystery.
The document provides an overview of Carol McDonald's presentation on Sun's web services stack. The key points are:
- Metro is Sun's implementation of JAX-WS for developing web services. WSIT provides reliability, security, and transactions using WS-* specifications.
- JAX-WS allows developing web services by annotating POJOs. The WSDL is generated automatically.
- WSIT adds features like reliable messaging, security, and transactions to web services using standards like WS-ReliableMessaging and WS-Security.
- The presentation demonstrates creating and consuming a web service using JAX-WS and configuring reliable messaging and security using WSIT.
JAX-WS is a Java framework for creating and consuming web services. It allows developers to create web services using Java annotations or a contract-first approach by defining services in WSDL. JAX-WS handles generating the necessary artifacts like WSDL and XSD. Services are deployed as a WAR file and configured using web.xml and sun-jaxws.xml. Clients can be generated using wsimport to call the web service operations.
Drupal is not intended to directly generate entire web pages. It is better suited as a back-end content management system, with other technologies handling page assembly and delivery. For high-traffic sites, offloading elements like user comments, real-time updates and cached content to external services improves scalability. Edge side includes and client-side technologies can incorporate dynamic fragments into cached pages without involving Drupal. This allows Drupal to focus on content while distributing page load across the technical stack.
The document discusses configuring caching in Mule using a non-persistent managed objects store. It shows how to configure a caching strategy with a non-persistent managed object store, test the cached web service response, invalidate the cache to force a database hit, and configure a flow to clear the cache. The caching allows retrieving the same response even if the database data is deleted, and invalidating empties the cache so the service hits the database again.
AngularFire is the officially supported AngularJS binding for Firebase. ... The focus of this library is to abstract much of the boilerplate involved in creating Angular bindings from Firebase to Angular, and to make it easy to create services that sync to your database.
This document discusses various techniques for optimizing the frontend performance of web applications. It provides 5 rules: 1) Only optimize when it makes a meaningful difference. 2) Download resources in parallel to reduce page load time. 3) Eliminate unnecessary requests through techniques like merging, inlining, sprites and caching. 4) Defer parsing of JavaScripts when possible to improve perceived page load speeds. 5) Consider factors like server location and content delivery networks to improve global performance.
Building instant features with advanced Plone themes
Plone ships with built-in batteries for building sophisticated content management solutions without writing a single line of new Python code.
We present how to use these features to customize content types, workflows, permissions and user interface elements directly in your custom theme.
We also show how to deploy all these new features instantly, without running buildout nor restarting instances.
http://datakurre.pandala.org/2017/10/building-instant-features-with-advanced.html
The document discusses various techniques for implementing real-time web applications, including polling, Comet, and WebSockets. It explains that polling involves the browser periodically requesting updates from the server. Comet enables long-polling to allow the server to push responses to the browser without requiring it to send frequent requests. WebSockets provide true two-way communication by upgrading the initial HTTP connection to a WebSocket protocol.
It will describes SOAP/REST differences and SOAP web services in detail with practical approach. it shows usage of SOAP, XML, JAVA, WSDL, XSD and RPC with examples.
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
This session focuses on how Java EE 7 provides extensive set of new and enhanced features to support standards like HTML5, WebSockets, and Server Sent Events among others.In this session we will show how these new features are designed and matched to work together for developing lightweight solutions matching end users high expectation from a web application’s responsiveness. The session will cover best practices and design patterns governing application development using JAX-RS 2.0, Async Servlet, and JSON-P (among others) as well as iterating over the pitfalls that should be avoided. During the session we will show code snippets and block diagrams that clarify use of APIs coming from the demo application we will show at the end.
This document discusses different methods for client-client and client-server communication using HTML5, including desktop notifications, postMessage for cross-window messaging, CORS for cross-origin resource sharing, and server-sent events for streaming data from the server to client. It provides an overview and examples of how each technique works and when they should be used, such as desktop notifications for browser-based apps, postMessage for communication between iframes or popups, CORS for making cross-domain AJAX requests, and server-sent events for push notifications from server without websockets.
This document provides an overview of integrating existing Domino data with modern websites using jQuery and Bootstrap. It discusses using Bootstrap and jQuery to build web interfaces that retrieve data from Domino via Ajax calls. Lotusscript agents are used to generate JSON data from Domino views and documents. Examples are provided of building a contact database interface with Bootstrap that displays contacts in a table, loads detail views, and allows editing and saving contacts back to the Domino database.
The document provides an overview of developing a 3-tier web application using MySQL, JavaServer Pages (JSP), and Apache Tomcat. It discusses the architecture of a 3-tier system with separate data, application, and presentation tiers. It also provides information on using MySQL for the database tier, JSP and servlets for the application tier, and HTML/JSP for the presentation tier. The document gives examples of using MySQL commands and JSP tags and objects.
1. The document provides an introduction to the Node.js course, covering topics like JavaScript basics, Node.js fundamentals, Express.js, debugging, and more.
2. Key concepts discussed include how the Node.js runtime works, using core modules, asynchronous programming with callbacks and promises, and the module system.
3. Express.js is introduced as a popular web framework that handles requests and responses, routing, and other complex server tasks so developers can focus on business logic. Debugging tools are also covered.
This document discusses optimizing Meetup's performance by reducing page load times. It recommends reducing JavaScript, image, DOM, and CSS files. Specific techniques include externalizing and concatenating JavaScript, lazy loading images and scripts, minimizing DOM elements, writing efficient CSS selectors, and profiling code to optimize loops and DOM manipulation. Reducing page weight through these techniques can improve the user experience by speeding up load times and drop in member activity.
This document discusses various techniques for optimizing ASP.NET applications to scale from thousands to millions of users. It covers topics such as preventing denial of service attacks, optimizing the ASP.NET process model and pipeline, reducing the size of ASP.NET cookies on static content, improving System.net settings, optimizing queries to ASP.NET membership providers, issues with LINQ to SQL, using transaction isolation levels to prevent deadlocks, and employing a content delivery network. The overall message is that ASP.NET requires various "hacks" at the code, database, and configuration levels to scale to support millions of hits.
This document provides an overview and demonstration of using the AJAX Solr framework to build a dynamic graphical user interface (GUI) for a knowledge base search application. It summarizes the company background, requirements, and inspiration for modernizing the existing GUI using AJAX Solr. It then demonstrates the framework architecture, including the manager, parameter store, widgets, and theming components. Finally, it discusses best practices, challenges, performance, and provides references for more information.
Developing High Performance Web Apps - CodeMash 2011
This document provides an overview of techniques for developing high performance web applications. It discusses why front-end performance matters, and outlines best practices for optimizing page load times, using responsive interfaces, loading and executing JavaScript efficiently, and accessing data. The presentation recommends tools for monitoring and improving performance, such as Firebug, Page Speed, and YSlow.
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The document summarizes Peter Serzo's presentation on the client-side story and object model in SharePoint 2010. It discusses how the client object model allows accessing SharePoint data through managed code, Silverlight, JavaScript and web services. It provides examples of using the client object model to upload files, retrieve list data, and get user profile properties. It also covers using jQuery templates and REST to display and format list data on a page.
Talk given at the Erlang User Conference, june 2013, Stockholm, about the performance of Zotonic, the Erlang Web Framework and CMS.
It highlights Zotonic's architecture, performance charts and provides a glimpse into the future of this web development framework.
Lotus Domino 8.5 introduces a new Eclipse-based architecture, allows all existing Notes applications to run, and provides new features like XPages and improved AJAX support. It has system requirements of 1 GB RAM minimum and supports platforms like Windows, Mac and Linux. Key benefits include the open Eclipse platform, composite applications, XPages, UI improvements, and continued multiplatform support without requiring rip and replace.
PL/SQL applications do not live on an island - any longer. Increasingly, applications need relate to the rest of the world. Either to make themselves and the services they provide accessible to external parties - that may not speak PL/SQL at all - or to access information or enlist help from external services.
Fortunately, PL/SQL can do much more than invoke other PL/SQL applications or execute SQL. PL/SQL - sometimes in conjunctions with other components in the Oracle RDBMS - provides many inbound and outbound channels for such interactions. This session discusses and demonstrates a number of channels - when and why to use them and how to use them.
The presentation discusses how to publish data to consumers via HTTP, using both XMLDB and the Embedded PL/SQL Gateway - for example to deliver HTML, XML or RSS or to provide REST-style (web)services that are much in demand. The session also discusses the importance of email as a vehicle for human-application interaction, demonstrating how to send and how to act on received emails. An important topic is how to engage in queue based interactions (for example with a SOA infrastructure) and it concludes with how through utl_http or XMLDB and (simple) middleware, the world of SOA, REST and even the internet is ours as well. It includes a demo on 'chatting from the database' (database triggers that send out IM alerts to human agents).
Learn all the basics of web app development including bootstrap, handlebars templates, jquery and angularjs, as well as using hybrid app deployment on a phone.
This document introduces Node.js and provides an overview of its key features and use cases. Some main points:
- Node.js is a JavaScript runtime built on Chrome's V8 engine that allows building scalable network applications easily. It is not a web framework but you can build web frameworks with Node.js modules.
- Node.js is well-suited for building web servers, TCP servers, command line tools, and anything involving high I/O due to its non-blocking I/O model. It has over 15,000 modules and an active community for support.
- Common use cases include building JSON APIs, single page apps, leveraging existing Unix tools via child processes, streaming
Selenium is a tool for automating web browsers. It can be used to create macros for repetitive browser tasks, web scraping, testing web applications, and more. Additional "power tools" like WebDriverManager, ShutterBug, Tesseract, Faker, WireMock and PDFBox can extend Selenium's capabilities by automating browser driver management, taking and comparing screenshots, extracting text from images, generating fake test data, mocking web services, and working with PDF files. These open source tools allow Selenium to be used for browser automation, testing, and robotic process automation.
This document provides an overview of Node.js and how to build web applications with it. It discusses asynchronous and synchronous reading and writing of files using the fs module. It also covers creating HTTP servers and clients to handle network requests, as well as using common Node modules like net, os, and path. The document demonstrates building a basic web server with Express to handle GET and POST requests, and routing requests to different handler functions based on the request path and method.
The document provides an overview of Google App Engine, a platform for developing and hosting web applications on Google's infrastructure. It discusses the different language runtimes, services, and development tools available on App Engine and highlights some example applications that have been built on the platform. The document also shares experiences from Latin American users and details some new features recently added to App Engine like cursors, task queues, and cron jobs.
WebNet Conference 2012 - Designing complex applications using html5 and knock...
This document provides an overview of designing complex applications using HTML5 and KnockoutJS. It discusses HTML5 and why it is useful, introduces JavaScript and frameworks like KnockoutJS and SammyJS that help manage complexity. It also summarizes several JavaScript libraries and patterns including the module pattern, revealing module pattern, and MV* patterns. Specific libraries and frameworks discussed include RequireJS, AmplifyJS, UnderscoreJS, and LINQ.js. The document concludes with a brief mention of server-side tools like ScriptSharp.
The document discusses using AJAX (Asynchronous JavaScript and XML) in Domino web applications. It provides an overview of traditional web applications versus AJAX-enabled applications, defines what AJAX is, and describes how XMLHttpRequest and JavaScript enable asynchronous data retrieval and updating parts of a web page without refreshing. It also covers browsers that support AJAX, demo applications using AJAX with Domino, and solutions for using AJAX in Domino web development.
The document summarizes new features and improvements in Internet Explorer 8, including standards compliance, multiple rendering modes, developer tools, AJAX enhancements, and security updates. Key points include improved support for CSS 2.1, HTML 5, and accessibility standards; contextual accelerators and activities; RSS-based WebSlices for content subscription; back/forward navigation and DOM storage for AJAX apps; and integrated HTML, CSS, and JavaScript debugging tools. A timeline outlines the beta and release schedule through 2008.
Tarun Gaur On Data Breaches and Privacy Fears https://www.cbs19news.com/story/50764645/tarun-gaur-on-data-breaches-and-privacy-fears-navigating-the-minefield-of-modern-internet-safety
Jarren Duran Fuck EM T shirts Jarren Duran Fuck EM T shirts
Jarren Duran Fuck EM T shirts
https://www.pinterest.com/youngtshirt/jarren-duran-fuck-em-t-shirts/
Happy to Pay Fine for Expletive shirt,Happy to Pay Fine for Expletive T shirts,Jarren Duran Fuck EM T shirts Grabs yours today. tag and share who loves it.
Megalive99 telah menetapkan standar tinggi untuk platform taruhan online. Berbagai macam permainan, desain ramah pengguna, dan transaksi aman menjadikannya pilihan utama para petaruh.
International dating programhttps: please register here and start to meet new people todayhttps://www.digistore24.com/redir/384521/godtim/.
get started. https://www.digistore24.com/redir/384521/godtim/
This document discusses server-side programming using Java servlets. It begins by explaining the difference between static and dynamic web pages/server responses. Java servlets provide a way to generate dynamic responses by instantiating a servlet class in response to an HTTP request. The document then covers the basics of servlets, including the servlet lifecycle methods and using request and response objects to add content and generate the HTTP response. It also discusses retrieving and handling parameter data passed in the HTTP request, as well as using HTTP sessions to maintain state across multiple requests and pages.
New Flash Builder 4 WSDL and HTTP Connectorsrtretola
This document provides instructions for setting up a Java SDK and Tomcat server on Windows and Mac OS X systems in order to run a Flash Builder project. It describes downloading and configuring a Java SDK by setting the JAVA_HOME environment variable. It then explains how to navigate to the Tomcat directory in the command line and start the server using specific commands for Windows and Mac. The document tests that the server is running properly by accessing certain URLs and describes how a crossdomain.xml policy file works to allow access to remote data services. It concludes by outlining the initial steps to create a new Flash Builder project and connect to REST data from an XML service using MXML and ActionScript.
SOAP Web Services have a well established role in the enterprise, but aside from the many benefits of the WS-* standards, SOAP and XML also carry additional baggage for developers. Consequently, REST Web Services are gaining tremendous popularity within the developer community. This session will begin by comparing and contrasting the basic concepts of both SOAP and REST Web Services. Building on that foundation, Sam Brannen will show attendees how to implement SOAP-based applications using Spring-WS 2.0. He will then demonstrate how to build a similar REST-ful application using Spring MVC 3.0. The session will conclude with an in-depth look at both server-side and client-side development as well as efficient integration testing of Web Services using the Spring Framework.
In this talk, we’ll discuss the benefits of the document-based data model that MongoDB offers by walking through how one can build a simple app. We'll show you how to design a full-blown RSS Aggregation service to replace the loss the world suffered when Google Reader was shutdown.
We'll dive deeper into topics, such as how to model your data and create your REST API using MongoDB, Express.js and Node.js (core components of the MEAN stack). This session will jumpstart your development knowledge of MongoDB.
The document discusses the evolution of web applications from thin clients with fat servers to more balanced architectures. New browser technologies like HTML5, faster JavaScript engines, local storage, and offline capabilities allow more processing to be done locally on the client. This enables richer interfaces, offline usage, and more balanced work distribution between the client and server. It provides examples of how a web application may utilize these new capabilities, such as storing data locally and caching interfaces while communicating with a server via JSON.
Asynchronous Web Programming with HTML5 WebSockets and JavaJames Falkner
(Talk originally given @ KCDC - http://kcdc.info ).
Over the last decade, advances in web computing have removed many of the barriers to entry for developers. New languages, frameworks, and development methodologies have kickstarted new ideas and new ways to develop web applications to make modern life easier and more efficient. WebSockets (introduced as part of HTML5) is one such technology that enables a new class of scalable, super-responsive, collaborative, and real-time web applications with a wide range of uses.
In this talk, we will first cover the basics of asynchronous web programming using WebSockets, including predecessors such as polling and long-polling, applications of WebSockets, its limitations and potential bottlenecks, and potential future improvements.
Next, we will demo and dissect a real-world use case for realtime social data analytics, using the Apache Tomcat implementation of WebSockets and the Java-based Liferay Portal Server. This will include a discussion about development of WebSocket endpoints, its lifecycle within the application container and browser, debugging WebSockets, and scalability topics.
Http Service will help us fetch external data, post to it, etc. We need to import the http module to make use of the http service. Let us consider an example to understand how to make use of the http service.
40+ tips to use Postman more efficientlypostmanclient
This document provides an overview of how to use Postman, a tool for building and testing APIs. It discusses how Postman allows users to quickly build API requests, organize requests into collections with folders and descriptions, share collections with teams, use environments to switch between development and production APIs, write test scripts to automate testing, and run collections from the command line with Newman.
Sherlock Homepage - A detective story about running large web services - NDC ...Maarten Balliauw
The site was slow. CPU and memory usage everywhere! Some dead objects in the corner. Something terrible must have happened! We have some IIS logs. Some traces from a witness. But not enough to find out what was wrong. In this session, we’ll see how effective telemetry, a profiler or two as well as a refresher of how IIS runs our ASP.NET web applications can help solve this server murder mystery.
Interoperable Web Services with JAX-WS and WSITCarol McDonald
The document provides an overview of Carol McDonald's presentation on Sun's web services stack. The key points are:
- Metro is Sun's implementation of JAX-WS for developing web services. WSIT provides reliability, security, and transactions using WS-* specifications.
- JAX-WS allows developing web services by annotating POJOs. The WSDL is generated automatically.
- WSIT adds features like reliable messaging, security, and transactions to web services using standards like WS-ReliableMessaging and WS-Security.
- The presentation demonstrates creating and consuming a web service using JAX-WS and configuring reliable messaging and security using WSIT.
JAX-WS is a Java framework for creating and consuming web services. It allows developers to create web services using Java annotations or a contract-first approach by defining services in WSDL. JAX-WS handles generating the necessary artifacts like WSDL and XSD. Services are deployed as a WAR file and configured using web.xml and sun-jaxws.xml. Clients can be generated using wsimport to call the web service operations.
Drupal is not intended to directly generate entire web pages. It is better suited as a back-end content management system, with other technologies handling page assembly and delivery. For high-traffic sites, offloading elements like user comments, real-time updates and cached content to external services improves scalability. Edge side includes and client-side technologies can incorporate dynamic fragments into cached pages without involving Drupal. This allows Drupal to focus on content while distributing page load across the technical stack.
The document discusses configuring caching in Mule using a non-persistent managed objects store. It shows how to configure a caching strategy with a non-persistent managed object store, test the cached web service response, invalidate the cache to force a database hit, and configure a flow to clear the cache. The caching allows retrieving the same response even if the database data is deleted, and invalidating empties the cache so the service hits the database again.
AngularFire is the officially supported AngularJS binding for Firebase. ... The focus of this library is to abstract much of the boilerplate involved in creating Angular bindings from Firebase to Angular, and to make it easy to create services that sync to your database.
This document discusses various techniques for optimizing the frontend performance of web applications. It provides 5 rules: 1) Only optimize when it makes a meaningful difference. 2) Download resources in parallel to reduce page load time. 3) Eliminate unnecessary requests through techniques like merging, inlining, sprites and caching. 4) Defer parsing of JavaScripts when possible to improve perceived page load speeds. 5) Consider factors like server location and content delivery networks to improve global performance.
Building instant features with advanced Plone themesAsko Soukka
Plone ships with built-in batteries for building sophisticated content management solutions without writing a single line of new Python code.
We present how to use these features to customize content types, workflows, permissions and user interface elements directly in your custom theme.
We also show how to deploy all these new features instantly, without running buildout nor restarting instances.
http://datakurre.pandala.org/2017/10/building-instant-features-with-advanced.html
The document discusses various techniques for implementing real-time web applications, including polling, Comet, and WebSockets. It explains that polling involves the browser periodically requesting updates from the server. Comet enables long-polling to allow the server to push responses to the browser without requiring it to send frequent requests. WebSockets provide true two-way communication by upgrading the initial HTTP connection to a WebSocket protocol.
It will describes SOAP/REST differences and SOAP web services in detail with practical approach. it shows usage of SOAP, XML, JAVA, WSDL, XSD and RPC with examples.
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Masoud Kalali
This session focuses on how Java EE 7 provides extensive set of new and enhanced features to support standards like HTML5, WebSockets, and Server Sent Events among others.In this session we will show how these new features are designed and matched to work together for developing lightweight solutions matching end users high expectation from a web application’s responsiveness. The session will cover best practices and design patterns governing application development using JAX-RS 2.0, Async Servlet, and JSON-P (among others) as well as iterating over the pitfalls that should be avoided. During the session we will show code snippets and block diagrams that clarify use of APIs coming from the demo application we will show at the end.
This document discusses different methods for client-client and client-server communication using HTML5, including desktop notifications, postMessage for cross-window messaging, CORS for cross-origin resource sharing, and server-sent events for streaming data from the server to client. It provides an overview and examples of how each technique works and when they should be used, such as desktop notifications for browser-based apps, postMessage for communication between iframes or popups, CORS for making cross-domain AJAX requests, and server-sent events for push notifications from server without websockets.
This document provides an overview of integrating existing Domino data with modern websites using jQuery and Bootstrap. It discusses using Bootstrap and jQuery to build web interfaces that retrieve data from Domino via Ajax calls. Lotusscript agents are used to generate JSON data from Domino views and documents. Examples are provided of building a contact database interface with Bootstrap that displays contacts in a table, loads detail views, and allows editing and saving contacts back to the Domino database.
The document provides an overview of developing a 3-tier web application using MySQL, JavaServer Pages (JSP), and Apache Tomcat. It discusses the architecture of a 3-tier system with separate data, application, and presentation tiers. It also provides information on using MySQL for the database tier, JSP and servlets for the application tier, and HTML/JSP for the presentation tier. The document gives examples of using MySQL commands and JSP tags and objects.
1. The document provides an introduction to the Node.js course, covering topics like JavaScript basics, Node.js fundamentals, Express.js, debugging, and more.
2. Key concepts discussed include how the Node.js runtime works, using core modules, asynchronous programming with callbacks and promises, and the module system.
3. Express.js is introduced as a popular web framework that handles requests and responses, routing, and other complex server tasks so developers can focus on business logic. Debugging tools are also covered.
This document discusses optimizing Meetup's performance by reducing page load times. It recommends reducing JavaScript, image, DOM, and CSS files. Specific techniques include externalizing and concatenating JavaScript, lazy loading images and scripts, minimizing DOM elements, writing efficient CSS selectors, and profiling code to optimize loops and DOM manipulation. Reducing page weight through these techniques can improve the user experience by speeding up load times and drop in member activity.
Scaling asp.net websites to millions of usersoazabir
This document discusses various techniques for optimizing ASP.NET applications to scale from thousands to millions of users. It covers topics such as preventing denial of service attacks, optimizing the ASP.NET process model and pipeline, reducing the size of ASP.NET cookies on static content, improving System.net settings, optimizing queries to ASP.NET membership providers, issues with LINQ to SQL, using transaction isolation levels to prevent deadlocks, and employing a content delivery network. The overall message is that ASP.NET requires various "hacks" at the code, database, and configuration levels to scale to support millions of hits.
This document provides an overview and demonstration of using the AJAX Solr framework to build a dynamic graphical user interface (GUI) for a knowledge base search application. It summarizes the company background, requirements, and inspiration for modernizing the existing GUI using AJAX Solr. It then demonstrates the framework architecture, including the manager, parameter store, widgets, and theming components. Finally, it discusses best practices, challenges, performance, and provides references for more information.
Developing High Performance Web Apps - CodeMash 2011Timothy Fisher
This document provides an overview of techniques for developing high performance web applications. It discusses why front-end performance matters, and outlines best practices for optimizing page load times, using responsive interfaces, loading and executing JavaScript efficiently, and accessing data. The presentation recommends tools for monitoring and improving performance, such as Firebug, Page Speed, and YSlow.
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...SPTechCon
The document summarizes Peter Serzo's presentation on the client-side story and object model in SharePoint 2010. It discusses how the client object model allows accessing SharePoint data through managed code, Silverlight, JavaScript and web services. It provides examples of using the client object model to upload files, retrieve list data, and get user profile properties. It also covers using jQuery templates and REST to display and format list data on a page.
Talk given at the Erlang User Conference, june 2013, Stockholm, about the performance of Zotonic, the Erlang Web Framework and CMS.
It highlights Zotonic's architecture, performance charts and provides a glimpse into the future of this web development framework.
Lotus Domino 8.5 introduces a new Eclipse-based architecture, allows all existing Notes applications to run, and provides new features like XPages and improved AJAX support. It has system requirements of 1 GB RAM minimum and supports platforms like Windows, Mac and Linux. Key benefits include the open Eclipse platform, composite applications, XPages, UI improvements, and continued multiplatform support without requiring rip and replace.
PL/SQL applications do not live on an island - any longer. Increasingly, applications need relate to the rest of the world. Either to make themselves and the services they provide accessible to external parties - that may not speak PL/SQL at all - or to access information or enlist help from external services.
Fortunately, PL/SQL can do much more than invoke other PL/SQL applications or execute SQL. PL/SQL - sometimes in conjunctions with other components in the Oracle RDBMS - provides many inbound and outbound channels for such interactions. This session discusses and demonstrates a number of channels - when and why to use them and how to use them.
The presentation discusses how to publish data to consumers via HTTP, using both XMLDB and the Embedded PL/SQL Gateway - for example to deliver HTML, XML or RSS or to provide REST-style (web)services that are much in demand. The session also discusses the importance of email as a vehicle for human-application interaction, demonstrating how to send and how to act on received emails. An important topic is how to engage in queue based interactions (for example with a SOA infrastructure) and it concludes with how through utl_http or XMLDB and (simple) middleware, the world of SOA, REST and even the internet is ours as well. It includes a demo on 'chatting from the database' (database triggers that send out IM alerts to human agents).
Intro to mobile web application developmentzonathen
Learn all the basics of web app development including bootstrap, handlebars templates, jquery and angularjs, as well as using hybrid app deployment on a phone.
This document introduces Node.js and provides an overview of its key features and use cases. Some main points:
- Node.js is a JavaScript runtime built on Chrome's V8 engine that allows building scalable network applications easily. It is not a web framework but you can build web frameworks with Node.js modules.
- Node.js is well-suited for building web servers, TCP servers, command line tools, and anything involving high I/O due to its non-blocking I/O model. It has over 15,000 modules and an active community for support.
- Common use cases include building JSON APIs, single page apps, leveraging existing Unix tools via child processes, streaming
Selenium is a tool for automating web browsers. It can be used to create macros for repetitive browser tasks, web scraping, testing web applications, and more. Additional "power tools" like WebDriverManager, ShutterBug, Tesseract, Faker, WireMock and PDFBox can extend Selenium's capabilities by automating browser driver management, taking and comparing screenshots, extracting text from images, generating fake test data, mocking web services, and working with PDF files. These open source tools allow Selenium to be used for browser automation, testing, and robotic process automation.
This document provides an overview of Node.js and how to build web applications with it. It discusses asynchronous and synchronous reading and writing of files using the fs module. It also covers creating HTTP servers and clients to handle network requests, as well as using common Node modules like net, os, and path. The document demonstrates building a basic web server with Express to handle GET and POST requests, and routing requests to different handler functions based on the request path and method.
The document provides an overview of Google App Engine, a platform for developing and hosting web applications on Google's infrastructure. It discusses the different language runtimes, services, and development tools available on App Engine and highlights some example applications that have been built on the platform. The document also shares experiences from Latin American users and details some new features recently added to App Engine like cursors, task queues, and cron jobs.
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
This document provides an overview of designing complex applications using HTML5 and KnockoutJS. It discusses HTML5 and why it is useful, introduces JavaScript and frameworks like KnockoutJS and SammyJS that help manage complexity. It also summarizes several JavaScript libraries and patterns including the module pattern, revealing module pattern, and MV* patterns. Specific libraries and frameworks discussed include RequireJS, AmplifyJS, UnderscoreJS, and LINQ.js. The document concludes with a brief mention of server-side tools like ScriptSharp.
The document discusses using AJAX (Asynchronous JavaScript and XML) in Domino web applications. It provides an overview of traditional web applications versus AJAX-enabled applications, defines what AJAX is, and describes how XMLHttpRequest and JavaScript enable asynchronous data retrieval and updating parts of a web page without refreshing. It also covers browsers that support AJAX, demo applications using AJAX with Domino, and solutions for using AJAX in Domino web development.
The document summarizes new features and improvements in Internet Explorer 8, including standards compliance, multiple rendering modes, developer tools, AJAX enhancements, and security updates. Key points include improved support for CSS 2.1, HTML 5, and accessibility standards; contextual accelerators and activities; RSS-based WebSlices for content subscription; back/forward navigation and DOM storage for AJAX apps; and integrated HTML, CSS, and JavaScript debugging tools. A timeline outlines the beta and release schedule through 2008.
Tarun Gaur On Data Breaches and Privacy FearsTarun Gaur
Tarun Gaur On Data Breaches and Privacy Fears https://www.cbs19news.com/story/50764645/tarun-gaur-on-data-breaches-and-privacy-fears-navigating-the-minefield-of-modern-internet-safety
Jarren Duran Fuck EM T shirts Jarren Duran Fuck EM T shirtsexgf28
Jarren Duran Fuck EM T shirts
https://www.pinterest.com/youngtshirt/jarren-duran-fuck-em-t-shirts/
Happy to Pay Fine for Expletive shirt,Happy to Pay Fine for Expletive T shirts,Jarren Duran Fuck EM T shirts Grabs yours today. tag and share who loves it.
Megalive99 Situs Betting Online Gacor TerpercayaMegalive99
Megalive99 telah menetapkan standar tinggi untuk platform taruhan online. Berbagai macam permainan, desain ramah pengguna, dan transaksi aman menjadikannya pilihan utama para petaruh.
Book dating , international dating phgrathomaskurtha9
International dating programhttps: please register here and start to meet new people todayhttps://www.digistore24.com/redir/384521/godtim/.
get started. https://www.digistore24.com/redir/384521/godtim/
1. AD 102 – Break out of the box
Integrate existing Domino data with modern websites
Karl-Henry Martinsson
Deep South Insurance
2. Swede living in Dallas
Sr. Applications Developer, Deep South Insurance
Life-long geek
Programming since 1982
Ex-Microsoft (1988-90)
Ex-journalist (1993-1997, freelance 1998-2011)
Web developer since 1994
Notes/Domino developer since 1996
IBM Champion 2014 and 2015
http://blog.texasswede.com
I AM…
3. Old infrastructure
Company unwilling to upgrade
Requesting new web applications
Wanted modern look, mobile
Bootstrap and jQuery to the rescue:
My story
4. Agenda
“Integrate existing Domino data with modern websites”
Why integrate?
Why jQuery and not XPages?
Separate the workload
Client – Javascript/jQuery, Ajax, JSON
Server – Lotusscript
Improve the UI – Bootstrap
Demos
All sample code will be available for download at
http://blog.texasswede.com/MWLUG
5. Limited or no migration options
Desire to modernize
Code re-use
Take advantage of the power of Domino
No one will know you are using a Domino backend
Use existing skillset
Learn valuable new skills
Why integrate?
6. Infrastructure not supporting XPages
No XPages skills
Tight deadline – no time to learn
More control
Plugin availability
Why not use Xpages?
7. Separate design and code
Focus expertise on their respective areas
Use established front-end technologies
Back-end focus on business logic and data
Collaboration is important!
Separate the workload
9. Lotusscript Agents
NSF database
Existing business logic
Can use existing classes/script libraries
Works on Domino since R5
Update highly recommended!
Server – IBM Domino
10. Where does everything live?
HTML pages, CSS files and Javascript
• Notes page element
• Notes resources
• CDN (.js and .css)
• Server file system – in Data/Domino/HTML
• Another web server
Lotusscript agents
• .NSF on Domino server
11. Development tools
Domino Designer
Browser with Dev Tools
Firefox with Firebug plugin
Internet Explorer Developer Tools (built-in)
Chrome Developer Tools (built-in)
Online resources
• jsonlint.com
• Stack Overflow
• Google Search
12. Asynchronous Javascript And XML
Asynchronous = call processed in background
Result is passed back and then processed
XML used first, JSON now more common
Easier to parse JSON in Javascript
Using few lines of jQuery code
Ajax
13. jQuery
Javascript library
Free
Very popular
Powerful – save development time
Easy access to web page elements (DOM)
Online resources
14. $.ajax({
url: '/websites/example.nsf/ajax_GetUserDetails?OpenAgent',
data: {name: “Karl-Henry Martinsson”},
cache: false
}).done(function(data) {
// Process returned data here
}).fail(function(e) {
// Process failed call here
});
or
$.ajax({
url: '/websites/example.nsf/ajax_GetUserDetails?OpenAgent',
data: {name: userName},
cache: false
}).success(function(data) {
// Process returned data here
});
Can be more complex – .done(), .fail() and .always()
Arguments passed as JSON
cache: false – “cache buster”
Calling Ajax using jQuery
15. JavaScript Object Notation
Describe data as Javascript objects
Preferred to XML in web applications
• Less “chatty” (less bandwidth)
• Very easy to access values directly in Javascript
Any data types, including other objects
Array of objects
JSON
16. ?ReadViewEntries&OutputFormat=JSON
• Available in Domino 7.0.2+
• Can be hard to parse
Formula in Notes view
• http://www.eknori.de/2011-07-23/formula-magic/
Lotusscript agent
• Generate your own JSON
• Test at JSONLint.com
• Use JSON classes
o My Class.JSON
o JSON Lotusscript Classes by Troy Reimer (OpenNTF.org)
Generate JSON on Domino
17. XPages agent (SSJS XAgent)
• Domino 8.5.2 and XPages knowledge
• Better performance than Lotusscript
• http://www.wissel.net/blog/d6plinks/shwl-7mgfbn
REST Services control from Extension Library
• Domino 8.5.2 and ExtLib on server
Generate JSON on Domino – Xpages Style
18. First button will update specified element with text
• Static text - stored in the Javascript source code
Second button will trigger an Ajax call to server
• Server agent returns plain text
• No parsing of name-value pairs
• No database lookups or other server interaction
• Returned text can contain HTML
• Javascript updates specified element with returned text
Google as CDN for jQuery
jQuery also hosted by Microsoft and others
Demo 1 – Text/HTML response
19. <!DOCTYPE HTML ><html>
<head>
<title>Demo 1 - MWLUG 2015</title>
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
</head>
<body>
<div id="content"></div>
<button id="btnDisplayStaticContent">Show content from page</button>
<button id="btnDisplayServerContent">Load content from server</button>
<script>
$(document).ready(function () {
// Update content div with content from this page
$('#btnDisplayStaticContent').click( function() {
var content = "This is some static content from this page";
$('#content').html(content);
});
// Update content div with content from server
$('#btnDisplayServerContent').click( function() {
$.ajax({
url: 'ajax_Demo1?OpenAgent',
cache: false
}).done(function(data) {
$('#content').html(data);
});
});
});
</script>
</body>
</html>
Demo 1 – Web page
20. Option Public
Option Declare
Sub Initialize
'*** MIME Header to tell browser what kind of data we will return
Print "content-type: text/html"
'*** Content (HTML) to return to calling browser
Print "This is content loaded from the server.<br>"
Print "<em>This</em> text is returned as <strong>HTML</strong>.<br>"
End Sub
Agent settings
Demo 1 – Lotusscript agent
22. Read text field, pass to server
Return and display computed text
Simple URL class
• http://blog.texasswede.com/free-code-class-to-read-url-name-value-pairs/
Using @URLDecode
Demo 2 – Text/HTML response
23. <!DOCTYPE HTML ><html>
<head>
<title>Demo 2 - MWLUG 2015</title>
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
</head>
<body>
Name: <input type="text" id="userName"></input>
<br>
<br>
<button id="btnDisplayServerContent">Load content from server</button>
<br>
<br>
<div id="content"></div>
<script>
$(document).ready(function () {
// Update content div with dynamic content
$('#btnDisplayServerContent').click( function() {
// Get username from input field
var userName = $('#userName').val();
// Make Ajax call to server, passing user name as argument
$.ajax({
url: 'ajax_Demo2?OpenAgent',
data: {name: userName},
cache: false
}).done(function(data) {
$('#content').html(data);
});
});
});
</script>
</body>
</html>
Demo 2 – Web page
24. Option Public
Option Declare
Use "Class.URL"
Sub Initialize
'--- Local Notes classes used in agent
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
'--- Custom classes
Dim url As URLData
'*** Create new URLData object
Set url = New URLData()
'*** MIME Header to tell browser what kind of data we will return
Print "content-type: text/html"
'*** Check reqired values for this agent
If url.IsValue("name")=False Then
Print "Missing argument 'name'."
Exit Sub
End If
'*** Process name argument
If url.GetValue("name")="" Then
Print "'Name' is empty."
Else
Print "Hello, " + url.GetValue("name") + "!"
End If
End Sub
Demo 2 – Lotusscript agent
25. Class URLData
p_urldata List As String
Public Sub New()
Dim session As New NotesSession
Dim webform As NotesDocument
Dim tmp As String
Dim tmparr As Variant
Dim tmparg As Variant
Dim i As Integer
'*** Get document context (in-memory NotesDocument)
Set webform = session.DocumentContext
'*** Get HTTP GET argument(s) after ?OpenAgent
tmp = FullTrim(StrRight(webform.GetItemValue("Query_String")(0),“OpenAgent&"))
If tmp = "" Then
'*** Get HTTP POST argument(s)
tmp = FullTrim(webform.GetItemValue("Request_Content")(0)))
End If
'*** Separate name-value pairs into array
tmparr = Split(tmp,"&")
'*** Loop through array, split each name-value/argument
For i = LBound(tmparr) To UBound(tmparr)
tmparg = Split(tmparr(i),"=")
p_urldata(LCase(tmparg(0))) = Decode(tmparg(1))
Next
End Sub
Demo 2 – URL Class
26. %REM
Function GetValue
%END REM
Public Function GetValue(argname As String) As String
If IsValue(argname) Then
GetValue = p_urldata(LCase(argname))
Else
GetValue = ""
End If
End Function
%REM
Function IsValue
%END REM
Public Function IsValue(argname As String) As Boolean
IsValue = IsElement(p_urldata(LCase(argname)))
End Function
'*** Private functions for this class
Private Function Decode(txt As String) As String
Dim tmp As Variant
Dim tmptxt As String
tmptxt = Replace(txt,"+"," ")
tmp = Evaluate(|@URLDecode("Domino";"| & tmptxt & |")|)
Decode = tmp(0)
End Function
End Class
Demo 2 – URL Class
28. Status - success or error
Multiple values
Error message
Case sensitive!
Demo 3 – Return JSON data
29. Demo 3 – Lotusscript JSON class
Simplify JSON creation
Add values (strings) and fix quotes within value
Add boolean values (true/false)
Set status (success or error)
Send MIME type and JSON string back
30. Demo 3 – Lotusscript agent
Option Public
Option Declare
Use "Class.JSON"
Sub Initialize
'--- Custom class
Dim json As JSONData
'*** Create new JSONData object
Set json = New JSONData()
'*** Generate JSON to return
Call json.SetValue("PhoneNumber", "817-555-1212")
Call json.SetValue("Email", "texasswede@gmail.com")
Call json.SetValue("Name", "Karl-Henry Martinsson")
json.success = True
Call json.SendToBrowser()
End Sub
31. <body>
<br>
<button id="btnDisplayServerContent">Load user info</button>
<br>
<br>
<div id="userInfo">
<div>
User Name: <span id="userName"></span>
</div>
<div>
Phone number: <span id="userPhoneNumber"></span>
</div>
<div>
Email Address: <span id="userEmail"></span>
</div>
</div>
<div id="errorInfo"></div>
</body>
Use span elements to hold values
id attribute used to identify element
Must be unique on page
Demo 3 – Return JSON data
32. $.ajax({
url: 'ajax_Demo3?OpenAgent',
cache: false
}).success(function(data) {
if(data.status=="success") {
// Populate the different fields and display the section
$('#userPhoneNumber').html(data.PhoneNumber);
$('#userEmail').html(data.Email);
$('#userName').html(data.Name);
$("#userInfo").fadeIn(1500);
} else {
// Display error message passed from server
$("#errorInfo").html(data.errormsg);
$("#errorInfo").fadeIn(1000);
}
});
Very little code needed
Put values into specified elements
Case is important!
Demo 3 – Return JSON data
34. Open source front-end framework
CSS + some jQuery
Responsive
Themes, color schemes and plugins
CDN or local copy
3rd party resources and plugins
Twitter Bootstrap
36. The password reset application pictured above is a free download.
You can get it at http://blog.texasswede.com/free-software-password-reset-for-notesdomino/
Another Bootstrap web application
37. Rapid development
Responsive
Cross-browser
Plenty of resources
Actively being developed
Benefits of using Bootstrap
38. Only supporting the latest browsers
Major changes between v2 and v3
Version specific plugins
Some plugins not themeable
Potential issues with Bootstrap
39. Viewport meta tag – control scaling
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Demo 4 - MWLUG 2015</title>
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="demo4.css" rel="stylesheet">
Using Bootstrap
40. Minified Bootstrap from BootstrapCDN.com
// - works with and without SSL
• Will not work on local webpages, page must be on a server
Local CSS located after Bootstrap CSS
Using Bootstrap
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Demo 4 - MWLUG 2015</title>
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="demo4.css" rel="stylesheet">
41. Link to Bootstrap and local CSS file
Local CSS used for minor tweaks
Bootstrap markup in HTML
Two columns
• Button in left column
• Result in right column
Responsive - columns will stack
Demo 4 – Adding Bootstrap
43. demo4.css
container {
margin-top: 20px;
}
label {
font-size: 10pt;
margin-bottom: 0px;
margin-top: 10px;
}
label:first-child {
margin-top: 0px;
}
.jsonData {
font-size: 12pt;
}
Add 20 pixel margin to top of page
Make label text smaller, remove bottom margin and add
top margin, except on the first label
Set the text size of JSON data returned to 12pt
Demo 4 – Adding Bootstrap
44. Demo 4 – Adding Bootstrap
jQuery
// Hide error section and user info section
$("#errorInfo").hide();
$("#userInfo").hide();
// Update content div with dynamic content
$('#btnDisplayServerContent').click( function() {
// Make Ajax call to server
$.ajax({
url: 'ajax_Demo3?OpenAgent',
cache: false
}).success(function(data) {
if(data.status=="success") {
// Populate the different fields and display the section
$('#userPhoneNumber').html(data.PhoneNumber);
$('#userEmail').html(data.Email);
$('#userName').html(data.Name);
$("#userInfo").fadeIn(1500);
} else {
// Display error message passed from server
$("#errorInfo").html(data.errormsg);
$("#errorInfo").fadeIn(1000);
}
});
});
46. data-json=”JSON_data_element”
data- prefix is ”standard”
.each()
Read value and get corresponding JSON
• $(this) – current element in jQuery
• data[”Name”] will return the JSON value “Name”
Demo 5 – Process JSON
47. jQuery
// For each element with class jsonData
$(".jsonData").each( function() {
// Get the field name from the custom attribute data-json
// and set the content of the current element to
// the corresponding JSON value
jsonfield = $(this).attr("data-json");
$(this).html(data[jsonfield]);
});
HTML
<div id="userInfo" class="well col-md-6">
<label>User Name:</label> <div class="jsonData" id=user"Name" data-json="Name"></div>
<label>Phone number:</label> <div class="jsonData" id="userPhoneNumber" data-json="PhoneNumber"></div>
<label>Email Address:</label> <div class="jsonData" id="userEmail" data-json="Email"></div>
</div>
$("div[data-json]").each( function() {
Demo 5 – Process JSON
49. JSON name = id of element to put data in
Less HTML markup
Still very little code, and very flexible
Add # in front of element name!
jQuery
$.each(data, function(id, item) {
elementName = "#" + id;
elementValue = data[id];
$(elementName).html(elementValue);
});
HTML
<label>User Name:</label> <div id="Name"></div>
<label>Phone number:</label> <div id="PhoneNumber"></div>
<label>Email Address:</label> <div id="Email"></div>
Demo 6 – Process JSON (another way)
51. Demo 7 – Bootstrap plugin
Plugin by @wenzhixin
Get it at http://bootstrap-table.wenzhixin.net.cn/
CDN hosted version at CloudFlare.com
Minimal HTML markup
Javascript mainly to define columns and settings
53. Demo 7 – Bootstrap Table plugin
Lotusscript code (partial)
'*** Get all documents in view to process
Set db = session.CurrentDatabase
Set view = db.GetView("(LookupContactsByLastName)")
Set col = view.AllEntries
'*** Start of JSON string
jsonString = “”
'*** Loop through all entries and build JSON to return
Set entry = col.GetFirstEntry
Do Until entry Is Nothing
'*** Build JSON for each entry and add to string
Set json = New JSONData()
Call json.SetValue("LastName", CStr(entry.ColumnValues(0)))
Call json.SetValue("FirstName", CStr(entry.ColumnValues(1)))
Call json.SetValue("Company", CStr(entry.ColumnValues(2)))
Call json.SetValue("Address", CStr(entry.ColumnValues(3)))
Call json.SetValue("City", CStr(entry.ColumnValues(4)))
Call json.SetValue("State", CStr(entry.ColumnValues(5)))
Call json.SetValue("ZIP", CStr(entry.ColumnValues(6)))
Call json.SetValue("DocUNID", CStr(entry.ColumnValues(9)))
'*** Add new JSON to existing JSON string
jsonString = jsonString + json.GetJSON() + "," + Chr$(13)
Set entry = col.GetNextEntry(entry)
Loop
'*** Remove the trailing comma and line break if we have data
If Len(jsonString) > 4 then
jsonString = Left$(jsonString,Len(jsonString)-2)
End If
'*** Add brackets for array
jsonString = "[ " + Chr$(13) + jsonString + Chr$(13) + “ ]“
'*** MIME Header to tell browser what kind of data we will send
Print "content-type: application/json"
'*** Send JSON back to browser
Print jsonString
56. Demo 8 – Simple contact database
Table of contacts – use bootstrap-table plugin
Click on user to display more details about them
Buttons
• Edit
• Save
• New
• Delete
Add refresh/reload of table when updated
57. Demo 8 – Simple contact database
Lotusscript agents needed
• ajax_Demo8_GetAllContacts (reused from Demo 7)
• ajax_Demo8_GetContactDetails
• ajax_Demo8_SaveContact
o If DocUNID is blank, create new contact
o Otherwise update existing contact
• ajax_Demo8_DeleteContact
HTML page changes
• Add section for contact details
• Detect click on row to display details
• Add buttons and jQuery code
59. jQuery – Save button
$("#btnSaveContact").on("click", function() {
$("#btnSaveContact").hide();
var json = new Object();
// Store field values in JSON object
var docunid = $("#docUNID").attr("data-UNID");
json["DocUNID"] = docunid;
$('input[data-notesfield]').each( function() {
var id = $(this).attr("id");
var notesfield = $(this).attr("data-notesfield");
json[notesfield] = $(this).val();
});
// Perform a call to the server to save values
$.ajax({
url: "ajax_Demo8_SaveContact?OpenAgent",
type: "POST",
data: json
}).done(function(data) {
if (data.status=="error") {
alert("Failure: " + data.msg);
} else if (data.status=="success") {
setReadMode(); // Convert INPUT back to DIV
$("#contactTable").bootstrapTable("refresh", {silent: true});
}).fail( function(e) {
alert("Failure!","Failed to save contact. Error: " + e.errorThrown);
});
$("#btnEditContact").show();
});
Demo 8 – Simple contact database
60. jQuery – Delete button
$("#btnDeleteContact").on("click", function(e) {
var docunid = $("#docUNID").attr("data-UNID");
$.ajax({
url: "ajax_Demo8_DeleteContact?OpenAgent",
type: "POST",
data: {DocUNID: docunid }
}).done(function(data) {
if (data.status=="error") {
alert("Failure: " + data.msg);
} else if (data.status=="success") {
$("#contactTable").bootstrapTable("refresh", {silent: true});
// Empty all input fields
$('input[data-notesfield]').each( function() {
$(this).val("");
});
// Empty all div with Notes data
$('div[data-notesfield]').each( function() {
$(this).html("");
});
// Empty hidden DocUNID storage
$("#docUNID").attr("data-UNID","")
$("#btnDeleteContact").hide();
$("#btnEditContact").hide();
}
}).fail( function(e) {
alert("Failure!","Failed to delete contact. Error: " + e.errorThrown);
});
});
Demo 8 – Simple contact database
61. jQuery – Detect click on table row
// Detect click on row in table
$("#contactTable").on('click-row.bs.table', function (e, row, $element) {
// Convert INPUT fields back to DIV just in case
setReadMode();
// Hide save button if visible
$("#btnSaveContact").hide();
// Get DocUNID value in table and load corresponding values from server
var unid = row.DocUNID;
displayDetails(unid);
});
Demo 8 – Simple contact database
62. jQuery – Load contact details from server and display on page
// Get contact details from Domino server and populate fields
// using the DocUIND value as lookup key
function displayDetails(docunid) {
$.ajax({
url: 'ajax_Demo8_GetContactDetails?OpenAgent',
data: {DocUNID: docunid},
cache: false
}).success(function(data) {
if(data.status=="success") {
// For each element with data-notesfield attribute
$('div[data-notesfield]').each( function() {
notesfield = $(this).attr("data-notesfield");
if (data[notesfield]!=null) {
fieldvalue = data[notesfield];
$(this).html(fieldvalue);
}
});
// Store DocUNID in enmpty div for later use
$("#docUNID").attr("data-UNID",data.DocUNID);
// Display previously hidden editand delete buttons
$("#btnEditContact").show();
$("#btnDeleteContact").show();
}
});
}
Demo 8 – Simple contact database
63. jQuery – Change between DIV and INPUT
// Put contact details into edit mode by changing DIV to INPUT
function editContact() {
$("#btnEditContact").hide();
// Change all div with Notes data to input
$('div[data-notesfield]').each( function() {
var id = $(this).attr("id");
var notesfield = $(this).attr("data-notesfield");
var input = "<input class='jsonData inputNotesField form-control input-sm' id='" + id
input = input + "' data-notesfield='" + notesfield + "' value='" + $(this).html() + "'></input>";
$(this).replaceWith(input)
});
$("#btnSaveContact").show();
$("#btnEditContact").hide();
}
// Put contact details into read mode by changing INPUT to DIV
function setReadMode() {
$('input[data-notesfield]').each( function() {
var id = $(this).attr("id");
var notesfield = $(this).attr("data-notesfield");
var div = "<div class='jsonData displayNotesField' id='" + id
div = div + "' data-notesfield='" + notesfield + "'>" + $(this).val() + "</div>";
$(this).replaceWith(div)
});
}
Demo 8 – Simple contact database
65. Similar to Demo 8, but using FullCalendar plugin
Get it at http://fullcalendar.io
Lotusscript agents
• ajax_Demo9_GetAllEvents
• Returning events between specific days
• Calendar automatically sends start and end date
• ajax_Demo8_GetEventDetails
• ajax_Demo8_UpdateEvent
• Triggered when moving event or changing duration
• Arguments: DocUNID, start date and end date
Demo 9 – Calendar using Domino data
66. Calendar points to JSON of event data
Demo 9 – Calendar using Domino data
jQuery – Display calendar and load JSON of event data from server
var eventSource = 'ajax_demo9_GetAllEvents?OpenAgent';
$("#notesCalendar").fullCalendar({
events: eventSource
});
Calendar adds start and end dates to URL
Agent returns events within date range
67. Demo 9 – Calendar using Domino data
Lotusscript agent ajax_Demo9_GetAllEvents (partial code)
'*** Local variables to hold arguments passed from URL
Dim startdate As String
Dim enddate As String
'*** Other local variables
Dim jsontext As String
'*** Create new URLData object
Set url = New URLData()
'*** Create new JSONData object
Set json = New JSONData()
'*** Check start date and convert from ISO to US date format
If url.IsValue("start") Then
startdate = ISOtoUS(url.GetValue("start"))
Else
startdate = "01/01/1980"
End If
'*** Check end date and convert to US date format
If url.IsValue("end") Then
enddate = ISOtoUS(url.GetValue("end"))
Else
enddate = "12/31/2199"
End If
68. Demo 9 – Calendar using Domino data
Lotusscript agent ajax_Demo9_GetAllEvents (partial code)
'*** Send MIME header to browser
Print "content-type: application/json"
jsontext = ""
Set db = session.CurrentDatabase
Set view = db.GetView("Events")
Set col = view.AllEntries
Set entry = col.GetFirstEntry()
Do Until entry Is Nothing
If CDat(entry.ColumnValues(0))>=CDat(startdate) Then
If CDat(entry.ColumnValues(0))<=CDat(enddate) Then
Call json.SetValue("id", CStr(entry.ColumnValues(5)))
Call json.SetValue("title",CStr(entry.ColumnValues(3)))
Call json.SetValue("start", Format$(CDat(entry.ColumnValues(0)),"mm/dd/yyyy hh:nn ampm"))
Call json.SetValue("end", Format$(entry.ColumnValues(1),"mm/dd/yyyy hh:nn ampm"))
'*** Make the entry editable in calendar (allow changing date/time)
Call json.SetBoolean("editable", True)
End If
End If
jsontext = jsontext + json.GetJSON() + "," + Chr$(13)
Set entry = col.GetNextEntry(entry)
Loop
If Len(jsontext)>4 Then
jsontext = Left$(jsontext,Len(jsontext)-2)
End If
Print "[ " + jsontext + " ]"
69. Demo 9 – Calendar using Domino data
FullCalendar plugin – Trigger code on click, resize and drop (move)
…
eventClick: function(calEvent, jsEvent, view) {
var unid = calEvent.id;
displayEventDetails(unid);
},
eventResize: function(event, delta, revertFunc) {
if (!confirm(event.title + " will now end at " + event.end.format("h:mm a") + "nAre you sure?")) {
revertFunc();
} else {
var unid = event.id;
updateEvent(unid,event.start.format("MM/DD/YYYY hh:mm a"),event.end.format("MM/DD/YYYY hh:mm a"));
displayEventDetails(unid)
}
},
eventDrop: function(event, delta, revertFunc) {
var prompt = event.title + "<br>was moved to " + event.start.format("MM/DD/YYYY")
prompt = prompt + " at " + event.start.format("h:mm a");
bootbox.confirm(prompt + "<br>Are you sure you want to do that?", function(result) {
if(result==true) {
var unid = event.id;
updateEvent(unid,event.start.format("MM/DD/YYYY hh:mm a"),event.end.format("MM/DD/YYYY hh:mm a"));
displayEventDetails(unid)
} else {
revertFunc();
}
});
}
…
70. Demo 9 – Calendar using Domino data
Javascript code – Update event on server
function updateEvent(docunid,startDT,endDT) {
var json = new Object();
json["DocUNID"] = docunid;
json["EventStart"] = startDT;
json["EventEnd"] = endDT;
// Perform a call to the server to save new event date/time
$.ajax({
url: "ajax_Demo9_UpdateEvent?OpenAgent",
type: "POST",
data: json
}).done(function(data) {
if (data.status=="error") {
bootstrapAlert(data.msg,"danger");
} else if (data.status=="success") {
bootstrapAlert(data.msg,"success");
}
}).fail( function(e) {
bootstrapAlert("Failed to create progress note. Error: " + e.errorThrown,"danger");
});
}
71. Demo 9 – Calendar using Domino data
Lotusscript agent ajax_Demo9_UpdateEvent (partial code)
'--- Local variables
Dim startDate As String
Dim endDate As String
'*** Get document
Set db = session.CurrentDatabase
If url.GetValue("DocUNID")<>"" Then
Set doc = db.GetDocumentByUNID(url.GetValue("DocUNID"))
End If
'*** Check that we found a document, otherwise exit
If doc Is Nothing Then
Set json = New JSONData()
json.success = False
json.SetErrorMsg("Failed to locate document '" & url.GetValue("DocUNID"))
Call json.SendToBrowser()
Exit Sub
End If
Call doc.ReplaceItemValue("EventStart",CDat(url.GetValue("EventStart")))
Call doc.ReplaceItemValue("EventEnd",CDat(url.GetValue("EventEnd")))
Call doc.Save(True,False)
Set json = New JSONData()
json.success = True
json.SetMsg("Updated '" & doc.GetItemValue("EventTitle")(0) & "' with new date/time")
Call json.SendToBrowser()
73. HTML
<label>Axis II</label>
<div class="MagicSuggest" id="DSM4Axis2" name="DSM4Axis2"></div>
jQuery
// Axis II
var DSM4Axis2 = $('#DSM4Axis2').magicSuggest({
name: 'DSM4Axis2',
resultAsString: true,
Width: 630,
MaxDropHeight: 200,
style: 'height: 28px;',
displayField: 'description',
valueField: 'id',
sortOrder: 'description',
emptyText: 'Select value for Axis II (DSM-IV)',
data: '/database.nsf/ajax_GetDSM4Codes?OpenAgent&Axis=2'
});
List of medical codes in Domino
• Consumed in a drop-down
• MagicSuggest plugin: http://nicolasbize.com/magicsuggest/
JSON – Real Life Example
75. Summary
Ajax/JSON efficient to access Domino data
CRUD using server based agents (Lotusscript)
jQuery and Bootstrap to speed up development
Plugins available for free
Some new easy-to-learn knowledge required
Skills beneficial on other platforms as well