seaside advanced topics

12
Seaside Advanced Topics

Upload: esug

Post on 20-May-2015

198 views

Category:

Software


3 download

DESCRIPTION

Title: Seaside Advanced Topics Speaker: Johan Brichau Title: Advanced Seaside Speaker: Philippe Marshall Thu, August 21, 2:00pm – 3:30pm Video: https://www.youtube.com/watch?v=YsA4gNcBKak Description Abstract: If you want to know everything about building sophisticated web applications with Seaside using tightly-integrated client-side libraries and frameworks (jQuery, jQuery++, jQuery-UI, Bootstrap, jQuery-Mobile,...), transparent persistence, RESTful webservices, etc or just about what's new in Seaside, then this tutorial is for you. We will skip the basics (see the excellent online tutorials [1][2] and book [3]) and jump right into the advanced uses of jQuery, the intricate details of ajax callbacks, the extensible framework, the transparent persistence in GemStone Web Edition (GLASS), and much more. We will reserve ample time for Q&A, so bring your questions to the session. Bio: Philippe Marshall has been part of the core Seaside team for several years. He holds a MSc CompSci from the University of Bern and has previously held talks at ESUG. Dale Henrich has been working in Smalltalk since 1985 when he developed an internal application on the Tektronix 4404. The internal application was used at Tektronix for at least 20 years and may still be in use today! Since 1985 he has been lucky enough to work in Smalltalk nearly full-time, spending the last 15 years at GemStone (now GemTalk Systems) give or take a couple of years. Johan Brichau is co-founder and development lead at Yesplan.be, a "Seaside under GLASS"-based web application for event management currently used by over 80 cultural organisations in Belgium and The Netherlands.

TRANSCRIPT

Page 1: Seaside Advanced Topics

SeasideAdvanced Topics

Page 2: Seaside Advanced Topics

Topics

• Advanced jQuery and Seaside <-> Javascript!

• New since 3.1:!

• RESTfulComponentFilter!

• SessionTrackingStrategy!

• GsDevKit!

• Your questions…

Page 3: Seaside Advanced Topics

Getting Started

• Download Pharo 3 from http://www.pharo.org!

• Download zipfile with pre-loaded image from:

http://bit.ly/1ySPvgs

Page 4: Seaside Advanced Topics

Webpage to Webapp

• STEP 1: ajaxify the TODO application!

WATODO>>renderAddNewTodoOn:

WATODOItem>>renderContentOn:

!

use jQuery AJAX form serialization

use jQuery DOM manipulation to update the client

Page 5: Seaside Advanced Topics

Webpage to Webapp

• STEP 2: Reduce requests to the server: combine ajax calls

Page 6: Seaside Advanced Topics

Combining AJAX CallbacksPrimary ajax callbacks:!

• #callback:!

• All response rendering callbacks!

#script:, #html:, #json:, #text:, #respond:

Secondary ajax callbacks:!

• #callback:value:!

• Convenience callbacks!

• #callback:json:, #callback:passengers, …!

• #serialize*:

Only 1 per request

Multiple per request

Page 7: Seaside Advanced Topics

+200 locations

1 - 2

mon

ths

Page 8: Seaside Advanced Topics

title

group

in-place editing info bubbles

group visualization

Page 9: Seaside Advanced Topics
Page 10: Seaside Advanced Topics

Webpage to Webapp

• STEP 3: Scale it by working with delegated events!

!

! Use passengers server-side for each separate element!

! Use top-level event handler doing a passenger lookup

Page 11: Seaside Advanced Topics

Working with JS libraries

• Javascript framework calling back to Seaside!

• Url!

• Function

Page 12: Seaside Advanced Topics

JS calling back into Seaside

• Wrap a jQuery ajax callback in a JS function!

• Easiest using existing jQuery wrapper code and JS generation!

• Not always possible if the library requires a url!

• Generate a url to an action callback!

• Requires a bit more understanding of how callbacks work!

• (Implement once, reuse all the time)