Hands on Pier

761 views

Published on

Hands on Pier. Tudor Girba, ESUG 2008, Amsterdam

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
761
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Hands on Pier

  1. 1. www.tudorgirba.com hands on
  2. 2. ESUG 2008© Tudor Gîrba Roadmap •About Pier •Pier is not just a wiki, it is a content management system (CMS) based on Magritte and Seaside •Pier is open source under the MIT license •Pier from the outside •Demos •Pier from the inside •Architecture •Extensions 2
  3. 3. CMS, easy, cool, free
  4. 4. Who builds
  5. 5. Lukas Renggli Michel Bany Matthias Berth Damien Cassou Tudor Gîrba Dale Henrichs Keith Hodges Ramon Leon Nik Lutz Philippe Marshall Damien Pollet Niall Ross
  6. 6. Lukas Renggli Michel Bany Matthias Berth Damien Cassou Tudor Gîrba Dale Henrichs Keith Hodges Ramon Leon Nik Lutz Philippe Marshall Damien Pollet Niall Ross
  7. 7. Why do I present it?
  8. 8. CMS, easy, cool, free
  9. 9. 1from the outside
  10. 10. = CMS
  11. 11. How mature is
  12. 12. www.seaside.st
  13. 13. choose.s-i.ch
  14. 14. moose.unibe.ch
  15. 15. www.esug.org
  16. 16. www.lukas-renggli.ch
  17. 17. www.tudorgirba.com
  18. 18. How extensible is
  19. 19. Citezen LightBox Poll Post ticker Randomizer Search StehlDichEin Top Feeder Twitter
  20. 20. How to customize the look of
  21. 21. 2from the inside
  22. 22. Structure
  23. 23. Structure * children
  24. 24. Structure Page File * children
  25. 25. Structure Page File Blog * children
  26. 26. Structure Page File Blog Context * children *
  27. 27. Structure Page File Blog Context Command Edit Login * children *
  28. 28. Kernel Structure Page File Blog Context Command Edit Login * children *
  29. 29. Kernel Structure Page File Blog Context Command Edit Login Persistency * children * *
  30. 30. Kernel Structure Page File Blog Context Command Edit Login Persistency * children * * environment
  31. 31. Kernel Structure Page File Blog Context Command Edit Login Persistency * children root * * environment View Browse Changes
  32. 32. Kernel Structure Page File Blog Context Command Edit Login Persistency * children root * * Component environment View Browse Changes PostTicker
  33. 33. is based on Magritte describe once, get everywhere
  34. 34. Any Seaside application can be a widget
  35. 35. Persistency: Gemstone, image
  36. 36. CMS, easy, cool, free
  37. 37. 3from the ...
  38. 38. 'From Squeak3.9.1 of 2 March 2008 [latest update: #7075] on 27 August 2008 at 10:18:30 am'! ISComponent subclass: #ISPier instanceVariableNames: 'context' classVariableNames: '' poolDictionaries: '' category: 'ISea-Tests'! !ISPier methodsFor: 'rendering-command' stamp: 'lr 8/27/2008 07:30'! renderCommand: aString on: html self renderHeading: [ self renderCommandHeadingOn: html ] contents: [ self renderCommandBodyOn: html ] animation: aString on: html! ! !ISPier methodsFor: 'rendering-command' stamp: 'lr 8/27/2008 07:32'! renderCommandBodyOn: html context command isView ifTrue: [ ^ self renderViewOn: html ]. html form: [ ISMagritte new start: context command description object: context command on: html ]! ! !ISPier methodsFor: 'rendering-command' stamp: 'lr 8/27/2008 09:36'! renderCommandHeadingOn: html html isea button beBack; beLeft; beCancel; callback: [ context := context structure: context structure ]; response: [ :renderer | self renderChildren: 'push_left_to_right' on: renderer ]; with: (context command isView ifTrue: [ 'Up' ] ifFalse: [ context command cancelButton value ]). html heading: context command label. context command isView ifFalse: [ html isea button beBlue; beRight; callback: [ self execute ]; response: [ :renderer | context command isView ifTrue: [ self renderChildren: 'push_left_to_right' on: renderer ] ifFalse: [ self renderCommand: 'push_right_to_left' on: renderer ] ]; with: context command saveButton value ]! ! !ISPier methodsFor: 'rendering-command' stamp: 'lr 8/27/2008 09:41'! renderViewOn: html PRCurrentContext use: self during: [ html div style: 'padding: 10px; background: #fff; height: 100%'; with: [ ISRenderer new start: context structure in: self on: html ] ]! ! !ISPier methodsFor: 'initialization' stamp: 'tg 8/14/2008 14:54'! initialize super initialize. context := PRContext kernel: PRKernel instances anyOne! ! !ISPier methodsFor: 'rendering' stamp: 'lr 8/27/2008 07:31'! renderContentOn: html self renderChildren: nil on: html! ! !ISPier methodsFor: 'rendering-children' stamp: 'lr 8/27/2008 00:23'! renderChildren: aString on: html self renderHeading: [ self renderChildrenHeadingOn: html ] contents: [ self renderChildrenBodyOn: html ] animation: aString on: html! ! !ISPier methodsFor: 'rendering-children' stamp: 'lr 8/27/2008 09:08'! renderChildrenBodyOn: html html isea list list: context enumerator contents; labels: [ :each | each title ]; callback: [ :value | context := context structure: value ]; response: [ :renderer | self renderChildren: 'push_right_to_left' on: renderer ]. context commands do: [ :each | html isea action class: 'tallButton black right'; callback: [ context := context command: each new ]; response: [ :renderer | context command isQuick ifTrue: [ self execute. self renderChildren: 'push_left_to_right' on: renderer ] ifFalse: [ self renderCommand: 'push_right_to_left' on: renderer ] ]; with: each label ]! ! !ISPier methodsFor: 'rendering-children' stamp: 'lr 8/27/2008 07:32'! renderChildrenHeadingOn: html context structure parent notNil ifTrue: [ html isea button beBack; beLeft; beCancel; callback: [ context := context structure: context structure parent ]; response: [ :renderer | self renderChildren: 'push_left_to_right' on: renderer ]; with: 'Up' ]. html heading: context structure title. (PREditCommand isValidIn: self context) ifTrue: [ html isea button beRight; beCancel; callback: [ context := context command: PREditCommand new ]; response: [ :renderer | self renderCommand: 'push_right_to_left' on: renderer ]; with: 'Edit' ] ifFalse: [ html isea button beRight; beCancel; callback: [ context := context command: PULogin new ]; response: [ :renderer | self renderCommand: 'push_right_to_left' on: renderer ]; with: 'Login' ]! ! !ISPier methodsFor: 'accessing' stamp: 'lr 8/27/2008 07:33'! context ^ context! ! !ISPier methodsFor: 'accessing' stamp: 'lr 8/27/2008 09:18'! context: aContext context := aContext! ! !ISPier methodsFor: 'actions' stamp: 'lr 8/27/2008 09:12'! execute PRCurrentContext use: self during: [ [ context command execute ] on: Error do: [ :err | Transcript show: err description; cr. ^ context := context structure: context structure ]. context := context command answer ]! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! ISPier class instanceVariableNames: ''! !ISPier class methodsFor: 'initialization' stamp: 'lr 8/27/2008 00:12'! initialize | application | application := self registerAsApplication: 'isea/pier'. application libraries do: [ :each | application removeLibrary: each ]. application preferenceAt: #deploymentMode put: true. application addLibrary: ISLibrary! ! ISPier initialize!
  39. 39. 'From Squeak3.9.1 of 2 March 2008 [latest update: #7075] on 27 August 2008 at 10:18:30 am'! ISComponent subclass: #ISPier instanceVariableNames: 'context' classVariableNames: '' poolDictionaries: '' category: 'ISea-Tests'! !ISPier methodsFor: 'rendering-command' stamp: 'lr 8/27/2008 07:30'! renderCommand: aString on: html self renderHeading: [ self renderCommandHeadingOn: html ] contents: [ self renderCommandBodyOn: html ] animation: aString on: html! ! !ISPier methodsFor: 'rendering-command' stamp: 'lr 8/27/2008 07:32'! renderCommandBodyOn: html context command isView ifTrue: [ ^ self renderViewOn: html ]. html form: [ ISMagritte new start: context command description object: context command on: html ]! ! !ISPier methodsFor: 'rendering-command' stamp: 'lr 8/27/2008 09:36'! renderCommandHeadingOn: html html isea button beBack; beLeft; beCancel; callback: [ context := context structure: context structure ]; response: [ :renderer | self renderChildren: 'push_left_to_right' on: renderer ]; with: (context command isView ifTrue: [ 'Up' ] ifFalse: [ context command cancelButton value ]). html heading: context command label. context command isView ifFalse: [ html isea button beBlue; beRight; callback: [ self execute ]; response: [ :renderer | context command isView ifTrue: [ self renderChildren: 'push_left_to_right' on: renderer ] ifFalse: [ self renderCommand: 'push_right_to_left' on: renderer ] ]; with: context command saveButton value ]! ! !ISPier methodsFor: 'rendering-command' stamp: 'lr 8/27/2008 09:41'! renderViewOn: html PRCurrentContext use: self during: [ html div style: 'padding: 10px; background: #fff; height: 100%'; with: [ ISRenderer new start: context structure in: self on: html ] ]! ! !ISPier methodsFor: 'initialization' stamp: 'tg 8/14/2008 14:54'! initialize super initialize. context := PRContext kernel: PRKernel instances anyOne! ! !ISPier methodsFor: 'rendering' stamp: 'lr 8/27/2008 07:31'! renderContentOn: html self renderChildren: nil on: html! ! !ISPier methodsFor: 'rendering-children' stamp: 'lr 8/27/2008 00:23'! renderChildren: aString on: html self renderHeading: [ self renderChildrenHeadingOn: html ] contents: [ self renderChildrenBodyOn: html ] animation: aString on: html! ! !ISPier methodsFor: 'rendering-children' stamp: 'lr 8/27/2008 09:08'! renderChildrenBodyOn: html html isea list list: context enumerator contents; labels: [ :each | each title ]; callback: [ :value | context := context structure: value ]; response: [ :renderer | self renderChildren: 'push_right_to_left' on: renderer ]. context commands do: [ :each | html isea action class: 'tallButton black right'; callback: [ context := context command: each new ]; response: [ :renderer | context command isQuick ifTrue: [ self execute. self renderChildren: 'push_left_to_right' on: renderer ] ifFalse: [ self renderCommand: 'push_right_to_left' on: renderer ] ]; with: each label ]! ! !ISPier methodsFor: 'rendering-children' stamp: 'lr 8/27/2008 07:32'! renderChildrenHeadingOn: html context structure parent notNil ifTrue: [ html isea button beBack; beLeft; beCancel; callback: [ context := context structure: context structure parent ]; response: [ :renderer | self renderChildren: 'push_left_to_right' on: renderer ]; with: 'Up' ]. html heading: context structure title. (PREditCommand isValidIn: self context) ifTrue: [ html isea button beRight; beCancel; callback: [ context := context command: PREditCommand new ]; response: [ :renderer | self renderCommand: 'push_right_to_left' on: renderer ]; with: 'Edit' ] ifFalse: [ html isea button beRight; beCancel; callback: [ context := context command: PULogin new ]; response: [ :renderer | self renderCommand: 'push_right_to_left' on: renderer ]; with: 'Login' ]! ! !ISPier methodsFor: 'accessing' stamp: 'lr 8/27/2008 07:33'! context ^ context! ! !ISPier methodsFor: 'accessing' stamp: 'lr 8/27/2008 09:18'! context: aContext context := aContext! ! !ISPier methodsFor: 'actions' stamp: 'lr 8/27/2008 09:12'! execute PRCurrentContext use: self during: [ [ context command execute ] on: Error do: [ :err | Transcript show: err description; cr. ^ context := context structure: context structure ]. context := context command answer ]! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! ISPier class instanceVariableNames: ''! !ISPier class methodsFor: 'initialization' stamp: 'lr 8/27/2008 00:12'! initialize | application | application := self registerAsApplication: 'isea/pier'. application libraries do: [ :each | application removeLibrary: each ]. application preferenceAt: #deploymentMode put: true. application addLibrary: ISLibrary! ! ISPier initialize! ~100 lines of code
  40. 40. CMS, easy, cool, free www.lukas-renggli.ch/smalltalk/pier
  41. 41. Tudor Gîrba www.tudorgirba.com creativecommons.org/licenses/by/3.0/

×