SlideShare una empresa de Scribd logo
1 de 11
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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 a 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
Mathematics grade-3-1.1Mathematics grade-3-1.1
Mathematics grade-3-1.1Benficious
 
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
 
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 a 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
Mathematics grade-3-1.1Mathematics grade-3-1.1
Mathematics grade-3-1.1
 
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
 
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
 

Más de 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
 

Más de 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
 

Último

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Último (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

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