SlideShare a Scribd company logo
1 of 11
Download to read offline
KSS Techniques
                                    Plone Symposium East 2008




       Author:       Joel Burton <joel@joelburton.com>
       Copyright:    Copyright 2007 Joel Burton. All rights reserved.
       Covering:     Plone 2.5 or newer
       Notice:       Distribution outside of presentation prohibited.
       Company:      PloneBootcamps: www.plonebootcamps.com



Contents
1   KSS Techniques                                                                                                                                                                2
    1.1 Overview . . . . . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   2
        1.1.1 Who Am I? . . . . . . .         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   2
        1.1.2 Overview . . . . . . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   2
        1.1.3 Challenges of JavaScript        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   2
        1.1.4 What is KSS? . . . . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   3
    1.2 Client-Side . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   3
        1.2.1 Simple Message . . . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   3
        1.2.2 KSS . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   3
        1.2.3 KSS . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   3
        1.2.4 KSS . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   3
        1.2.5 KSS . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   4
        1.2.6 KSS . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   4
        1.2.7 Parameter Provider . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   4
        1.2.8 Parameter Provider . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   4
        1.2.9 Registering KSS . . . . .       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   4
    1.3 Server-Side . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   5
        1.3.1 Server-Side . . . . . . .       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   5
        1.3.2 Book Order Form . . . .         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   5
        1.3.3 KSS . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   5
        1.3.4 Script . . . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   5
        1.3.5 Script . . . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   6
        1.3.6 Script . . . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   6
        1.3.7 No Submit KSS . . . . .         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   6
        1.3.8 No Submit KSS . . . . .         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   7
        1.3.9 Report Data . . . . . . .       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   7
        1.3.10 Book Report . . . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   7
        1.3.11 Updating in KSS . . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   7
        1.3.12 Updating Script . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   8
        1.3.13 Updating Automatically         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   8
        1.3.14 Updating Script . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   8
    1.4 KSS Cheat Sheet . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   8
        1.4.1 Events: Basic . . . . . .       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   8



                                                                  1
1 KSS TECHNIQUES


         1.4.2    Events: Mouse . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .    9
         1.4.3    Events: Form . . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .    9
         1.4.4    Events: Automatic . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .    9
         1.4.5    Actions: Changing HTML . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .    9
         1.4.6    Actions: Attributes . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .    9
         1.4.7    Actions: CSS Classes . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   10
         1.4.8    Actions: Form Elements . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   10
         1.4.9    Actions: Debugging . . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   10
         1.4.10   Parameter Providers: Forms .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   10
         1.4.11   Parameter Providers: Content        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   10
         1.4.12   Command Sets: Core . . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   11
         1.4.13   Commands Sets: Zope + Plone         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   11
         1.4.14   Debugging KSS . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   11
         1.4.15   Future of KSS . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   11
         1.4.16   Thanks! . . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   11




1 KSS Techniques


1.1     Overview


1.1.1   Who Am I?
   • Plone Trainer / Developer
         – Offers training at http://plonebootcamps.com
         – Definitely not a JavaScript expert!



1.1.2   Overview
   • Why KSS?
   • Client-side convenience
   • Server-side power
   • Quick reference guide



1.1.3   Challenges of JavaScript
   • Another language!
   • Browser incompatibilities persist
   • Even when done correctly ...
         – Do it again in Python




                                                          2
1.2 Client-Side                                                      1 KSS TECHNIQUES


1.1.4   What is KSS?
   • “Kinetic Style Sheets”
          – “Power of JS, syntax of CSS”
          – Allows you to declare behavior
          – Includes AJAX library
   • Very powerful, very cool!



1.2     Client-Side


1.2.1   Simple Message
        <form>                            Show button
          <input type="submit" id="logButton" name="log"
               value="Show Message" />
        </form>

        <fieldset>                        Show message
          <legend>Message:</legend>
          <p id="message"
              tal:condition="exists: request/log">Clicked (non-KSS)</p>
        </fieldset>



1.2.2   KSS
        #logButton:click {
          action-client: alert;
          alert-message: "Clicked!";
        }



1.2.3   KSS
        #logButton:click {               Identifer & event
          action-client: alert;          Client action: alert
          alert-message: "Clicked!";     Parameters for alert
        }



1.2.4   KSS
        #logButton:click {
          action-client: replaceInnerHTML;               Action
          replaceInnerHTML-kssSelector: "#message";      Where
          replaceInnerHTML-html: "Clicked (via KSS)";
        }




                                                3
1.2 Client-Side                                                          1 KSS TECHNIQUES


1.2.5   KSS
        #logButton:click {
          action-client: replaceInnerHTML;                  Action
          replaceInnerHTML-kssSelector: "#message";         Where
          replaceInnerHTML-html: "Clicked (via KSS)";
        }
        <p id="message">Clicked (non-KSS)</p>



1.2.6   KSS
        #logButton:click {
          evt-click-preventdefault: True;        Don’t do normal thing

            action-client: replaceInnerHTML;
            replaceInnerHTML-kssSelector: "#message";
            replaceInnerHTML-html: "Clicked (via KSS)";
        }



1.2.7   Parameter Provider
        #logButton:click {
          evt-click-preventdefault: True;        Don’t do normal thing

            action-client: replaceInnerHTML;
            replaceInnerHTML-kssSelector: currentFormVar(’note’);
            replaceInnerHTML-html: "Clicked (via KSS)";
        }



1.2.8   Parameter Provider
        #logButton:click {
          evt-click-preventdefault: True;        Don’t do normal thing

            action-client: replaceInnerHTML;
            replaceInnerHTML-kssSelector: currentFormVar(’note’);
            replaceInnerHTML-html: "Clicked (via KSS)";
        }
        <input type="text" name="note" />



1.2.9   Registering KSS
   • Add your KSS file name to portal_kss
            – Just like portal_css
            – Put into debug mode to avoid cache problems




                                                  4
1.3 Server-Side                                                        1 KSS TECHNIQUES


1.3     Server-Side


1.3.1   Server-Side
   • Call server-side scripts via AJAX

            – Get results without page refresh
                ∗ Can show results
                ∗ Log them
                ∗ Do side-actions, etc.



1.3.2   Book Order Form
        <form action="order_form">

            <input type="text" id="numcopies" name="numcopies"
                tal:attributes="value numCopies" />

            copies of <b>Mega Plone Development</b> at $19.99 =

            <span id="total" tal:content="cost">[cost]</span>

            <input type="submit" id="updateButton" value="Update" />

        </form>



1.3.3   KSS
        #updateButton:click {
          evt-click-preventdefault: True;            Skip regular

            action-server: kssOrderCalculate;        Call script
            kssOrderCalculate-qty:
                currentFormVar(’numcopies’);         Pass #
        }



1.3.4   Script
   • orderCalculate.py (PythonScript):

              qty = int(qty)
              return qty * 19.99




                                                 5
1.3 Server-Side                                                        1 KSS TECHNIQUES


1.3.5   Script
   • kssOrderCalculate.py (PythonScript):

            from kss.core.ttwapi import (
                startKSSCommands,
                getKSSCommandSet,
                renderKSSCommands )

            startKSSCommands(context, context.REQUEST)
            core = getKSSCommandSet(’core’)

            answer = str(context.orderCalculate(qty))

            core.replaceInnerHTML(’#total’, answer)

            return renderKSSCommands()



1.3.6   Script
   • kssOrderCalculate.py (PythonScript):

            from kss.core.ttwapi import (                boilerplate
                startKSSCommands,
                getKSSCommandSet,
                renderKSSCommands )

            startKSSCommands(context, context.REQUEST) boilerplate
            core = getKSSCommandSet(’core’)

            answer = str(context.orderCalculate(qty))    get answer

            core.replaceInnerHTML(’#total’, answer)      replace

            return renderKSSCommands()                   boilerplate



1.3.7   No Submit KSS
        #updateButton:load {
          action-client: deleteNode;
        }

        #numcopies:change {
          action-server: kssOrderCalculate;
          kssOrderCalculate-qty: currentFormVar(’numcopies’);
        }




                                             6
1.3 Server-Side                                                       1 KSS TECHNIQUES


1.3.8    No Submit KSS
         #updateButton:load {                Get rid of button
           action-client: deleteNode;
         }

         #numcopies:change {               Update on change
           action-server: kssOrderCalculate;
           kssOrderCalculate-qty: currentFormVar(’numcopies’);
         }



1.3.9    Report Data
         def getSalesData(self):

             qty = random.randint(1,20)
             total = qty * 19.99

             return [{
                 ’id’:’mpd’,
                 ’title’:’Mega Plone Development’,
                 ’qty’: qty,
                 ’total’: total
             }]



1.3.10       Book Report
         <tr tal:repeat="book books">
           <td class="title"
               tal:attributes="id string:${book/id}-title"
               tal:content="book/title"></td>
           <td class="qty"
               tal:attributes="id string:${book/id}-qty"
               tal:content="book/qty"></td>
           <td class="cost"
               tal:attributes="id string:${book/id}-cost"
               tal:content="book/total"></td>
         </tr>



1.3.11       Updating in KSS
         #salesUpdate:click {
           evt-click-preventdefault: True;      Skip regular

             action-server: kssUpdateBook;      Call script
             kssUpdateBook-bookid: "mpd";       Pass book to update
         }




                                                7
1.4 KSS Cheat Sheet                                                     1 KSS TECHNIQUES


1.3.12    Updating Script
         class KSSSalesReport(PloneKSSView):     Simplifies our work
           @kssaction                            By doing boilerplate
           def __call__(self, bookid):

             qty = random.randint(21,40)
             total = qty * 19.99

             core = self.getCommandSet(’core’)
             core.replaceInnerHTML(’#%s-qty’ % bookid, str(qty))
             core.replaceInnerHTML(’#%s-cost’ % bookid, str(total))



1.3.13    Updating Automatically
         #salesUpdate:load {               Get rid of button
           action-client: deleteNode;
         }

         #sales:timeout {               Refresh every 2 secs
           evt-timeout-delay:    2000;
           action-server:        kssUpdateBook;
           kssUpdateBook-bookid: "mpd";
         }



1.3.14    Updating Script
         class KSSSalesReport(PloneKSSView):
           @kssaction
           def __call__(self, bookid):

             qty = random.randint(21,40)
             total = qty * 19.99

             core = self.getCommandSet(’core’)
             core.replaceInnerHTML(’#%s-qty’ % bookid, str(qty))
             core.replaceInnerHTML(’#%s-cost’ % bookid, str(total))




1.4      KSS Cheat Sheet


1.4.1    Events: Basic
   • click

   • dblclick

   • load : Done on page load




                                                 8
1.4 KSS Cheat Sheet                                                         1 KSS TECHNIQUES


         – Useful for hiding stuff when KSS active



1.4.2   Events: Mouse
   • mousedown, mouseup
   • mouseover, mouseout



1.4.3   Events: Form
   • blur : leaving a field
   • focus : entering a field
   • change : field value changes
   • select : trigger when drop-down changes
   • submit : on form submission



1.4.4   Events: Automatic
   • timeout : done automatically after expiration
         – evt-timeout-delay : period in milliseconds
         – evt-timeout-repeat : (default true)



1.4.5   Actions: Changing HTML
   • replaceInnerHTML : Replace all children of the given node with the given content.
         – html: the html to insert
   • insertHTMLAfter : Add HTML after given node.
         – html: the html to insert
   • deleteNode : Delete the node.



1.4.6   Actions: Attributes
   • setAttribute : Sets a given HTML attribute of the node.
         – name: the attribute name.
         – value: the attribute value to set
   • setStyle : Sets a given style element on the node.
         – name: the name of the style element.
         – value: the style element value to set




                                                    9
1.4 KSS Cheat Sheet                                                              1 KSS TECHNIQUES


1.4.7    Actions: CSS Classes
   • addClass : Add a class to the classes of the node.

          – value: the name of the class

   • removeClass : Remove a class from the classes of the node.
          – value: the name of the class

   • toggleClass : Toggle class on node.

          – value: the name of the class



1.4.8    Actions: Form Elements
   • focus : Focus the given node that is a form input.



1.4.9    Actions: Debugging
   • error : Throws an exception, when executed.

   • log : Logs an informational message.

          – message

   • alert : Javascript alert box.

          – message



1.4.10    Parameter Providers: Forms
   • formVar(formname, varname)

          – Produces the value of a given variable within a given form.

   • currentFormVar(varname)

          – Produces the value of a given variable within the current form.



1.4.11    Parameter Providers: Content
   • nodeAttr(attrname)

          – Produces the value of a given html attribute of the selected node.

   • nodeContent()

          – Produces the textual content of the node. Newlines are converted to spaces.




                                                   10
1.4 KSS Cheat Sheet                                            1 KSS TECHNIQUES


1.4.12   Command Sets: Core
   • Commands are things used by scripts

   • core command set are the same as the “actions”

         – setAttribute, addClass, etc.



1.4.13   Commands Sets: Zope + Plone
   • Additional command sets for Zope and Plone specific stuff

         – Refreshing a viewlet
         – Refreshing a portlet
         – ... and more!



1.4.14   Debugging KSS
   • Use Firebug!

         – Turn on portal_javascript debugging
         – Messages come out to Firebug console

   • Try your scripts from URL directly



1.4.15   Future of KSS
   • Other JavaScript libraries

         – For people who want to tinker deeply

   • Possibly non-JS backends?

   • In any event ...

         – ... lots more interactivity!



1.4.16   Thanks!
   • Questions?
   • Handouts at

           http://plonebootcamps.com/resources




                                                  11

More Related Content

What's hot

Cinelerra Video Editing Manual
Cinelerra Video Editing ManualCinelerra Video Editing Manual
Cinelerra Video Editing Manualduquoi
 
Winning noble
Winning nobleWinning noble
Winning noblestryfe10
 
Documentation - LibraryRandom
Documentation - LibraryRandomDocumentation - LibraryRandom
Documentation - LibraryRandomMichel Alves
 
Building a humane CMS for Plone: updated tutorial
Building a humane CMS for Plone: updated tutorialBuilding a humane CMS for Plone: updated tutorial
Building a humane CMS for Plone: updated tutorialVincenzo Barone
 
Symbol from NEM Whitepaper 0.9.6.3
Symbol from NEM Whitepaper 0.9.6.3Symbol from NEM Whitepaper 0.9.6.3
Symbol from NEM Whitepaper 0.9.6.3Alexander Schefer
 
The Eagle The Beautiful Creation of God Ethomology
The Eagle The Beautiful Creation of God EthomologyThe Eagle The Beautiful Creation of God Ethomology
The Eagle The Beautiful Creation of God EthomologySister Lara
 
Cuda toolkit reference manual
Cuda toolkit reference manualCuda toolkit reference manual
Cuda toolkit reference manualPiyush Mittal
 
Concept mapping patient initials, age, gender and admitting d
Concept mapping patient initials, age, gender and admitting dConcept mapping patient initials, age, gender and admitting d
Concept mapping patient initials, age, gender and admitting dARIV4
 
REDI - Resiliency rating
REDI - Resiliency ratingREDI - Resiliency rating
REDI - Resiliency ratingDISSIPATOR
 

What's hot (14)

Cinelerra Video Editing Manual
Cinelerra Video Editing ManualCinelerra Video Editing Manual
Cinelerra Video Editing Manual
 
Winning noble
Winning nobleWinning noble
Winning noble
 
Documentation - LibraryRandom
Documentation - LibraryRandomDocumentation - LibraryRandom
Documentation - LibraryRandom
 
Time series
Time seriesTime series
Time series
 
Red hat enterprise_linux-7-system_administrators_guide-en-us
Red hat enterprise_linux-7-system_administrators_guide-en-usRed hat enterprise_linux-7-system_administrators_guide-en-us
Red hat enterprise_linux-7-system_administrators_guide-en-us
 
Building a humane CMS for Plone: updated tutorial
Building a humane CMS for Plone: updated tutorialBuilding a humane CMS for Plone: updated tutorial
Building a humane CMS for Plone: updated tutorial
 
Symbol from NEM Whitepaper 0.9.6.3
Symbol from NEM Whitepaper 0.9.6.3Symbol from NEM Whitepaper 0.9.6.3
Symbol from NEM Whitepaper 0.9.6.3
 
The Eagle The Beautiful Creation of God Ethomology
The Eagle The Beautiful Creation of God EthomologyThe Eagle The Beautiful Creation of God Ethomology
The Eagle The Beautiful Creation of God Ethomology
 
Dsa
DsaDsa
Dsa
 
R Lang
R LangR Lang
R Lang
 
Bash
BashBash
Bash
 
Cuda toolkit reference manual
Cuda toolkit reference manualCuda toolkit reference manual
Cuda toolkit reference manual
 
Concept mapping patient initials, age, gender and admitting d
Concept mapping patient initials, age, gender and admitting dConcept mapping patient initials, age, gender and admitting d
Concept mapping patient initials, age, gender and admitting d
 
REDI - Resiliency rating
REDI - Resiliency ratingREDI - Resiliency rating
REDI - Resiliency rating
 

Viewers also liked

Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Jeffrey Clark
 
DIY Intranet Wiki
DIY Intranet WikiDIY Intranet Wiki
DIY Intranet Wikiguestea9cfd
 
Plone I18n Tutorial - Hanno Schlichting
Plone I18n Tutorial - Hanno SchlichtingPlone I18n Tutorial - Hanno Schlichting
Plone I18n Tutorial - Hanno SchlichtingJeffrey Clark
 
Zpugdc2007 101105081808-phpapp01
Zpugdc2007 101105081808-phpapp01Zpugdc2007 101105081808-phpapp01
Zpugdc2007 101105081808-phpapp01Jeffrey Clark
 

Viewers also liked (9)

Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008
 
Kss Extjs
Kss ExtjsKss Extjs
Kss Extjs
 
Top Ten Test
Top Ten TestTop Ten Test
Top Ten Test
 
DIY Intranet Wiki
DIY Intranet WikiDIY Intranet Wiki
DIY Intranet Wiki
 
Plone I18n Tutorial - Hanno Schlichting
Plone I18n Tutorial - Hanno SchlichtingPlone I18n Tutorial - Hanno Schlichting
Plone I18n Tutorial - Hanno Schlichting
 
Simplifying Plone
Simplifying PloneSimplifying Plone
Simplifying Plone
 
Opensourceweblion
OpensourceweblionOpensourceweblion
Opensourceweblion
 
The PSF and You
The PSF and YouThe PSF and You
The PSF and You
 
Zpugdc2007 101105081808-phpapp01
Zpugdc2007 101105081808-phpapp01Zpugdc2007 101105081808-phpapp01
Zpugdc2007 101105081808-phpapp01
 

Similar to KSS Techniques - Joel Burton

Motorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guideMotorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guideAdvantec Distribution
 
Reverse engineering for_beginners-en
Reverse engineering for_beginners-enReverse engineering for_beginners-en
Reverse engineering for_beginners-enAndri Yabu
 
Creating Scientific Posters
Creating Scientific PostersCreating Scientific Posters
Creating Scientific Postersemphemory
 
Guía de administración de Asterisk
Guía de administración de AsteriskGuía de administración de Asterisk
Guía de administración de AsteriskCef Espinoza
 
Motorola ws2000 wireless switch cli reference guide
Motorola ws2000 wireless switch cli reference guideMotorola ws2000 wireless switch cli reference guide
Motorola ws2000 wireless switch cli reference guideAdvantec Distribution
 
Motorola ws2000 wireless switch cli reference guide
Motorola ws2000 wireless switch cli reference guideMotorola ws2000 wireless switch cli reference guide
Motorola ws2000 wireless switch cli reference guideAdvantec Distribution
 
Mathematics grade-3-1.1 (4) compressed
Mathematics grade-3-1.1 (4) compressedMathematics grade-3-1.1 (4) compressed
Mathematics grade-3-1.1 (4) compressedBenficious
 
Mathematics grade-3-1.1
Mathematics grade-3-1.1Mathematics grade-3-1.1
Mathematics grade-3-1.1Benficious
 
Ibm info sphere datastage data flow and job design
Ibm info sphere datastage data flow and job designIbm info sphere datastage data flow and job design
Ibm info sphere datastage data flow and job designdivjeev
 

Similar to KSS Techniques - Joel Burton (20)

Networkx 0.99
Networkx 0.99Networkx 0.99
Networkx 0.99
 
Latex2e
Latex2eLatex2e
Latex2e
 
R Ints
R IntsR Ints
R Ints
 
Code Conventions
Code ConventionsCode Conventions
Code Conventions
 
Mi ps
Mi psMi ps
Mi ps
 
LSI_SAS2008_Manual_v100.pdf
LSI_SAS2008_Manual_v100.pdfLSI_SAS2008_Manual_v100.pdf
LSI_SAS2008_Manual_v100.pdf
 
Openstack InstallGuide.pdf
Openstack InstallGuide.pdfOpenstack InstallGuide.pdf
Openstack InstallGuide.pdf
 
Math
MathMath
Math
 
By d ui_styleguide_2012_fp35
By d ui_styleguide_2012_fp35By d ui_styleguide_2012_fp35
By d ui_styleguide_2012_fp35
 
Motorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guideMotorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guide
 
Reverse engineering for_beginners-en
Reverse engineering for_beginners-enReverse engineering for_beginners-en
Reverse engineering for_beginners-en
 
Manual doctrine jog
Manual doctrine jogManual doctrine jog
Manual doctrine jog
 
Creating Scientific Posters
Creating Scientific PostersCreating Scientific Posters
Creating Scientific Posters
 
Guía de administración de Asterisk
Guía de administración de AsteriskGuía de administración de Asterisk
Guía de administración de Asterisk
 
Tortoise svn 1.7-en
Tortoise svn 1.7-enTortoise svn 1.7-en
Tortoise svn 1.7-en
 
Motorola ws2000 wireless switch cli reference guide
Motorola ws2000 wireless switch cli reference guideMotorola ws2000 wireless switch cli reference guide
Motorola ws2000 wireless switch cli reference guide
 
Motorola ws2000 wireless switch cli reference guide
Motorola ws2000 wireless switch cli reference guideMotorola ws2000 wireless switch cli reference guide
Motorola ws2000 wireless switch cli reference guide
 
Mathematics grade-3-1.1 (4) compressed
Mathematics grade-3-1.1 (4) compressedMathematics grade-3-1.1 (4) compressed
Mathematics grade-3-1.1 (4) compressed
 
Mathematics grade-3-1.1
Mathematics grade-3-1.1Mathematics grade-3-1.1
Mathematics grade-3-1.1
 
Ibm info sphere datastage data flow and job design
Ibm info sphere datastage data flow and job designIbm info sphere datastage data flow and job design
Ibm info sphere datastage data flow and job design
 

More from Jeffrey Clark

Python memory management_v2
Python memory management_v2Python memory management_v2
Python memory management_v2Jeffrey Clark
 
Jwt with flask slide deck - alan swenson
Jwt with flask   slide deck - alan swensonJwt with flask   slide deck - alan swenson
Jwt with flask slide deck - alan swensonJeffrey Clark
 
Genericmeetupslides 110607190400-phpapp02
Genericmeetupslides 110607190400-phpapp02Genericmeetupslides 110607190400-phpapp02
Genericmeetupslides 110607190400-phpapp02Jeffrey Clark
 
Pyramiddcpythonfeb2013 131006105131-phpapp02
Pyramiddcpythonfeb2013 131006105131-phpapp02Pyramiddcpythonfeb2013 131006105131-phpapp02
Pyramiddcpythonfeb2013 131006105131-phpapp02Jeffrey Clark
 
Zpugdc deformpresentation-100709203803-phpapp01
Zpugdc deformpresentation-100709203803-phpapp01Zpugdc deformpresentation-100709203803-phpapp01
Zpugdc deformpresentation-100709203803-phpapp01Jeffrey Clark
 
Zpugdccherry 101105081729-phpapp01
Zpugdccherry 101105081729-phpapp01Zpugdccherry 101105081729-phpapp01
Zpugdccherry 101105081729-phpapp01Jeffrey Clark
 
Using Grok to Walk Like a Duck - Brandon Craig Rhodes
Using Grok to Walk Like a Duck - Brandon Craig RhodesUsing Grok to Walk Like a Duck - Brandon Craig Rhodes
Using Grok to Walk Like a Duck - Brandon Craig RhodesJeffrey Clark
 
What Makes A Great Dev Team - Mike Robinson
What Makes A Great Dev Team - Mike RobinsonWhat Makes A Great Dev Team - Mike Robinson
What Makes A Great Dev Team - Mike RobinsonJeffrey Clark
 
What Makes A Great Dev Team - Mike Robinson
What Makes A Great Dev Team - Mike RobinsonWhat Makes A Great Dev Team - Mike Robinson
What Makes A Great Dev Team - Mike RobinsonJeffrey Clark
 
Real World Intranets - Joel Burton
Real World Intranets - Joel BurtonReal World Intranets - Joel Burton
Real World Intranets - Joel BurtonJeffrey Clark
 
State Of Zope 3 - Stephan Richter
State Of Zope 3 - Stephan RichterState Of Zope 3 - Stephan Richter
State Of Zope 3 - Stephan RichterJeffrey Clark
 

More from Jeffrey Clark (16)

Python memory management_v2
Python memory management_v2Python memory management_v2
Python memory management_v2
 
Python meetup
Python meetupPython meetup
Python meetup
 
Jwt with flask slide deck - alan swenson
Jwt with flask   slide deck - alan swensonJwt with flask   slide deck - alan swenson
Jwt with flask slide deck - alan swenson
 
Genericmeetupslides 110607190400-phpapp02
Genericmeetupslides 110607190400-phpapp02Genericmeetupslides 110607190400-phpapp02
Genericmeetupslides 110607190400-phpapp02
 
Pyramiddcpythonfeb2013 131006105131-phpapp02
Pyramiddcpythonfeb2013 131006105131-phpapp02Pyramiddcpythonfeb2013 131006105131-phpapp02
Pyramiddcpythonfeb2013 131006105131-phpapp02
 
Dc python meetup
Dc python meetupDc python meetup
Dc python meetup
 
Zpugdc deformpresentation-100709203803-phpapp01
Zpugdc deformpresentation-100709203803-phpapp01Zpugdc deformpresentation-100709203803-phpapp01
Zpugdc deformpresentation-100709203803-phpapp01
 
Zpugdccherry 101105081729-phpapp01
Zpugdccherry 101105081729-phpapp01Zpugdccherry 101105081729-phpapp01
Zpugdccherry 101105081729-phpapp01
 
Tornado
TornadoTornado
Tornado
 
Science To Bfg
Science To BfgScience To Bfg
Science To Bfg
 
Using Grok to Walk Like a Duck - Brandon Craig Rhodes
Using Grok to Walk Like a Duck - Brandon Craig RhodesUsing Grok to Walk Like a Duck - Brandon Craig Rhodes
Using Grok to Walk Like a Duck - Brandon Craig Rhodes
 
What Makes A Great Dev Team - Mike Robinson
What Makes A Great Dev Team - Mike RobinsonWhat Makes A Great Dev Team - Mike Robinson
What Makes A Great Dev Team - Mike Robinson
 
What Makes A Great Dev Team - Mike Robinson
What Makes A Great Dev Team - Mike RobinsonWhat Makes A Great Dev Team - Mike Robinson
What Makes A Great Dev Team - Mike Robinson
 
Real World Intranets - Joel Burton
Real World Intranets - Joel BurtonReal World Intranets - Joel Burton
Real World Intranets - Joel Burton
 
State Of Zope 3 - Stephan Richter
State Of Zope 3 - Stephan RichterState Of Zope 3 - Stephan Richter
State Of Zope 3 - Stephan Richter
 
Zenoss: Buildout
Zenoss: BuildoutZenoss: Buildout
Zenoss: Buildout
 

Recently uploaded

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
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
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
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
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

KSS Techniques - Joel Burton

  • 1. KSS Techniques Plone Symposium East 2008 Author: Joel Burton <joel@joelburton.com> Copyright: Copyright 2007 Joel Burton. All rights reserved. Covering: Plone 2.5 or newer Notice: Distribution outside of presentation prohibited. Company: PloneBootcamps: www.plonebootcamps.com Contents 1 KSS Techniques 2 1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.1 Who Am I? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.3 Challenges of JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.4 What is KSS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 Client-Side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.1 Simple Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.2 KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.3 KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.4 KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.5 KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.6 KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.7 Parameter Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.8 Parameter Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.9 Registering KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 Server-Side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3.1 Server-Side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3.2 Book Order Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3.3 KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3.4 Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3.5 Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3.6 Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3.7 No Submit KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3.8 No Submit KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3.9 Report Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3.10 Book Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3.11 Updating in KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3.12 Updating Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3.13 Updating Automatically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3.14 Updating Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4 KSS Cheat Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4.1 Events: Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1
  • 2. 1 KSS TECHNIQUES 1.4.2 Events: Mouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.3 Events: Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.4 Events: Automatic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.5 Actions: Changing HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.6 Actions: Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.7 Actions: CSS Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.4.8 Actions: Form Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.4.9 Actions: Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.4.10 Parameter Providers: Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.4.11 Parameter Providers: Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.4.12 Command Sets: Core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.4.13 Commands Sets: Zope + Plone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.4.14 Debugging KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.4.15 Future of KSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.4.16 Thanks! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1 KSS Techniques 1.1 Overview 1.1.1 Who Am I? • Plone Trainer / Developer – Offers training at http://plonebootcamps.com – Definitely not a JavaScript expert! 1.1.2 Overview • Why KSS? • Client-side convenience • Server-side power • Quick reference guide 1.1.3 Challenges of JavaScript • Another language! • Browser incompatibilities persist • Even when done correctly ... – Do it again in Python 2
  • 3. 1.2 Client-Side 1 KSS TECHNIQUES 1.1.4 What is KSS? • “Kinetic Style Sheets” – “Power of JS, syntax of CSS” – Allows you to declare behavior – Includes AJAX library • Very powerful, very cool! 1.2 Client-Side 1.2.1 Simple Message <form> Show button <input type="submit" id="logButton" name="log" value="Show Message" /> </form> <fieldset> Show message <legend>Message:</legend> <p id="message" tal:condition="exists: request/log">Clicked (non-KSS)</p> </fieldset> 1.2.2 KSS #logButton:click { action-client: alert; alert-message: "Clicked!"; } 1.2.3 KSS #logButton:click { Identifer & event action-client: alert; Client action: alert alert-message: "Clicked!"; Parameters for alert } 1.2.4 KSS #logButton:click { action-client: replaceInnerHTML; Action replaceInnerHTML-kssSelector: "#message"; Where replaceInnerHTML-html: "Clicked (via KSS)"; } 3
  • 4. 1.2 Client-Side 1 KSS TECHNIQUES 1.2.5 KSS #logButton:click { action-client: replaceInnerHTML; Action replaceInnerHTML-kssSelector: "#message"; Where replaceInnerHTML-html: "Clicked (via KSS)"; } <p id="message">Clicked (non-KSS)</p> 1.2.6 KSS #logButton:click { evt-click-preventdefault: True; Don’t do normal thing action-client: replaceInnerHTML; replaceInnerHTML-kssSelector: "#message"; replaceInnerHTML-html: "Clicked (via KSS)"; } 1.2.7 Parameter Provider #logButton:click { evt-click-preventdefault: True; Don’t do normal thing action-client: replaceInnerHTML; replaceInnerHTML-kssSelector: currentFormVar(’note’); replaceInnerHTML-html: "Clicked (via KSS)"; } 1.2.8 Parameter Provider #logButton:click { evt-click-preventdefault: True; Don’t do normal thing action-client: replaceInnerHTML; replaceInnerHTML-kssSelector: currentFormVar(’note’); replaceInnerHTML-html: "Clicked (via KSS)"; } <input type="text" name="note" /> 1.2.9 Registering KSS • Add your KSS file name to portal_kss – Just like portal_css – Put into debug mode to avoid cache problems 4
  • 5. 1.3 Server-Side 1 KSS TECHNIQUES 1.3 Server-Side 1.3.1 Server-Side • Call server-side scripts via AJAX – Get results without page refresh ∗ Can show results ∗ Log them ∗ Do side-actions, etc. 1.3.2 Book Order Form <form action="order_form"> <input type="text" id="numcopies" name="numcopies" tal:attributes="value numCopies" /> copies of <b>Mega Plone Development</b> at $19.99 = <span id="total" tal:content="cost">[cost]</span> <input type="submit" id="updateButton" value="Update" /> </form> 1.3.3 KSS #updateButton:click { evt-click-preventdefault: True; Skip regular action-server: kssOrderCalculate; Call script kssOrderCalculate-qty: currentFormVar(’numcopies’); Pass # } 1.3.4 Script • orderCalculate.py (PythonScript): qty = int(qty) return qty * 19.99 5
  • 6. 1.3 Server-Side 1 KSS TECHNIQUES 1.3.5 Script • kssOrderCalculate.py (PythonScript): from kss.core.ttwapi import ( startKSSCommands, getKSSCommandSet, renderKSSCommands ) startKSSCommands(context, context.REQUEST) core = getKSSCommandSet(’core’) answer = str(context.orderCalculate(qty)) core.replaceInnerHTML(’#total’, answer) return renderKSSCommands() 1.3.6 Script • kssOrderCalculate.py (PythonScript): from kss.core.ttwapi import ( boilerplate startKSSCommands, getKSSCommandSet, renderKSSCommands ) startKSSCommands(context, context.REQUEST) boilerplate core = getKSSCommandSet(’core’) answer = str(context.orderCalculate(qty)) get answer core.replaceInnerHTML(’#total’, answer) replace return renderKSSCommands() boilerplate 1.3.7 No Submit KSS #updateButton:load { action-client: deleteNode; } #numcopies:change { action-server: kssOrderCalculate; kssOrderCalculate-qty: currentFormVar(’numcopies’); } 6
  • 7. 1.3 Server-Side 1 KSS TECHNIQUES 1.3.8 No Submit KSS #updateButton:load { Get rid of button action-client: deleteNode; } #numcopies:change { Update on change action-server: kssOrderCalculate; kssOrderCalculate-qty: currentFormVar(’numcopies’); } 1.3.9 Report Data def getSalesData(self): qty = random.randint(1,20) total = qty * 19.99 return [{ ’id’:’mpd’, ’title’:’Mega Plone Development’, ’qty’: qty, ’total’: total }] 1.3.10 Book Report <tr tal:repeat="book books"> <td class="title" tal:attributes="id string:${book/id}-title" tal:content="book/title"></td> <td class="qty" tal:attributes="id string:${book/id}-qty" tal:content="book/qty"></td> <td class="cost" tal:attributes="id string:${book/id}-cost" tal:content="book/total"></td> </tr> 1.3.11 Updating in KSS #salesUpdate:click { evt-click-preventdefault: True; Skip regular action-server: kssUpdateBook; Call script kssUpdateBook-bookid: "mpd"; Pass book to update } 7
  • 8. 1.4 KSS Cheat Sheet 1 KSS TECHNIQUES 1.3.12 Updating Script class KSSSalesReport(PloneKSSView): Simplifies our work @kssaction By doing boilerplate def __call__(self, bookid): qty = random.randint(21,40) total = qty * 19.99 core = self.getCommandSet(’core’) core.replaceInnerHTML(’#%s-qty’ % bookid, str(qty)) core.replaceInnerHTML(’#%s-cost’ % bookid, str(total)) 1.3.13 Updating Automatically #salesUpdate:load { Get rid of button action-client: deleteNode; } #sales:timeout { Refresh every 2 secs evt-timeout-delay: 2000; action-server: kssUpdateBook; kssUpdateBook-bookid: "mpd"; } 1.3.14 Updating Script class KSSSalesReport(PloneKSSView): @kssaction def __call__(self, bookid): qty = random.randint(21,40) total = qty * 19.99 core = self.getCommandSet(’core’) core.replaceInnerHTML(’#%s-qty’ % bookid, str(qty)) core.replaceInnerHTML(’#%s-cost’ % bookid, str(total)) 1.4 KSS Cheat Sheet 1.4.1 Events: Basic • click • dblclick • load : Done on page load 8
  • 9. 1.4 KSS Cheat Sheet 1 KSS TECHNIQUES – Useful for hiding stuff when KSS active 1.4.2 Events: Mouse • mousedown, mouseup • mouseover, mouseout 1.4.3 Events: Form • blur : leaving a field • focus : entering a field • change : field value changes • select : trigger when drop-down changes • submit : on form submission 1.4.4 Events: Automatic • timeout : done automatically after expiration – evt-timeout-delay : period in milliseconds – evt-timeout-repeat : (default true) 1.4.5 Actions: Changing HTML • replaceInnerHTML : Replace all children of the given node with the given content. – html: the html to insert • insertHTMLAfter : Add HTML after given node. – html: the html to insert • deleteNode : Delete the node. 1.4.6 Actions: Attributes • setAttribute : Sets a given HTML attribute of the node. – name: the attribute name. – value: the attribute value to set • setStyle : Sets a given style element on the node. – name: the name of the style element. – value: the style element value to set 9
  • 10. 1.4 KSS Cheat Sheet 1 KSS TECHNIQUES 1.4.7 Actions: CSS Classes • addClass : Add a class to the classes of the node. – value: the name of the class • removeClass : Remove a class from the classes of the node. – value: the name of the class • toggleClass : Toggle class on node. – value: the name of the class 1.4.8 Actions: Form Elements • focus : Focus the given node that is a form input. 1.4.9 Actions: Debugging • error : Throws an exception, when executed. • log : Logs an informational message. – message • alert : Javascript alert box. – message 1.4.10 Parameter Providers: Forms • formVar(formname, varname) – Produces the value of a given variable within a given form. • currentFormVar(varname) – Produces the value of a given variable within the current form. 1.4.11 Parameter Providers: Content • nodeAttr(attrname) – Produces the value of a given html attribute of the selected node. • nodeContent() – Produces the textual content of the node. Newlines are converted to spaces. 10
  • 11. 1.4 KSS Cheat Sheet 1 KSS TECHNIQUES 1.4.12 Command Sets: Core • Commands are things used by scripts • core command set are the same as the “actions” – setAttribute, addClass, etc. 1.4.13 Commands Sets: Zope + Plone • Additional command sets for Zope and Plone specific stuff – Refreshing a viewlet – Refreshing a portlet – ... and more! 1.4.14 Debugging KSS • Use Firebug! – Turn on portal_javascript debugging – Messages come out to Firebug console • Try your scripts from URL directly 1.4.15 Future of KSS • Other JavaScript libraries – For people who want to tinker deeply • Possibly non-JS backends? • In any event ... – ... lots more interactivity! 1.4.16 Thanks! • Questions? • Handouts at http://plonebootcamps.com/resources 11