A hands-on workshop on how to use Zope3 Views and Viewlets in Products targeted for Plone 3.0 (and why you would want to do so). Special emphasis will be on best practices in general, handling and validation of forms and how Zope3's shiny new toys make it easier to write reusable code and cleaner markup. Finally, the talk will deal with how Views and Viewlets can help you make your product better cacheable. Although the talk is targeted at Plone integrators who already have experience using the older CMF-based approach it will also try to address people new to Plone who want to customize it in a future-proof manner.
Using Kotlin coroutines it’s really easy to execute a task in a background thread and update the UI based on the result. Just enter the coroutine world using the launch method and then change thread using withContext. It’s even simpler if the task is an http call (thanks to coroutines support in retrofit) or a database query (thanks to Room). The final code is the same we’d use to execute synchronous code. But coroutines are more than just a tool to switch thread, we can use them to execute tasks in parallel. The code is still really easy to read but sometimes it can be difficult to write: we need to pay attention to many aspects (like nested scopes, exceptions and dispatchers). In this talk we’ll see how to leverage the coroutines library to manage parallelism, from the basic concepts to some advanced example.
Testing JavaScript/CoffeeScript with Mocha and ChaiMark
Presented at the Burlington Ruby Conference on July 28th.
Learn just how easy it is to test your JavaScript and CoffeeScript code. Don't be scared by events, DOM interactions, or AJAX requests any more!
FormsKit: reactive forms driven by state. UA Mobile 2017.UA Mobile
The document discusses building dynamic forms by representing form components as an ordered collection. It proposes using a Property to observe changes to the collection of components. Based on a selected sign-in type, different components would be included through composition. A renderer generates the appropriate collection of components for a given state. Component matching and diffing algorithms could then identify changes to drive animated form updates.
Testing your JavaScript and/or CofffeeScript applications is not nearly as difficult as you think. Learn how to quickly setup Jasmine in your Rails application and start testing your *script applications now!
Presented at Confoo (Montreal, Cananda)
Let's spend some time seeing how easy it can be to set up Mocha and Chai, a testing framework for JavaScript/CoffeeScript, in your application. We'll learn how to test that our jQuery or Backbone code is doing what it supposed to. It's really not as hard as you think it might be.
This presentation will introduce AJAX in Grails through the GrailsUI plugin. We'll start with the core concepts behind the plugin and give examples of the most widely used and interesting widgets GrailsUI
provides.
Some examples will include methods of interacting with the widgets and handling events. We will also talk about how to provide proper JSON data to the widgets from the server.
The document discusses Ruby and Ruby on Rails. It notes that Ruby is an object-oriented programming language created by Yukihiro Matsumoto in 1995. Ruby on Rails is a web application framework built on Ruby that was created by David Heinemeier Hansson in 2004. It follows the model-view-controller architectural pattern, separating applications into models, views, and controllers.
Using Kotlin coroutines it’s really easy to execute a task in a background thread and update the UI based on the result. Just enter the coroutine world using the launch method and then change thread using withContext. It’s even simpler if the task is an http call (thanks to coroutines support in retrofit) or a database query (thanks to Room). The final code is the same we’d use to execute synchronous code. But coroutines are more than just a tool to switch thread, we can use them to execute tasks in parallel. The code is still really easy to read but sometimes it can be difficult to write: we need to pay attention to many aspects (like nested scopes, exceptions and dispatchers). In this talk we’ll see how to leverage the coroutines library to manage parallelism, from the basic concepts to some advanced example.
Testing JavaScript/CoffeeScript with Mocha and ChaiMark
Presented at the Burlington Ruby Conference on July 28th.
Learn just how easy it is to test your JavaScript and CoffeeScript code. Don't be scared by events, DOM interactions, or AJAX requests any more!
FormsKit: reactive forms driven by state. UA Mobile 2017.UA Mobile
The document discusses building dynamic forms by representing form components as an ordered collection. It proposes using a Property to observe changes to the collection of components. Based on a selected sign-in type, different components would be included through composition. A renderer generates the appropriate collection of components for a given state. Component matching and diffing algorithms could then identify changes to drive animated form updates.
Testing your JavaScript and/or CofffeeScript applications is not nearly as difficult as you think. Learn how to quickly setup Jasmine in your Rails application and start testing your *script applications now!
Presented at Confoo (Montreal, Cananda)
Let's spend some time seeing how easy it can be to set up Mocha and Chai, a testing framework for JavaScript/CoffeeScript, in your application. We'll learn how to test that our jQuery or Backbone code is doing what it supposed to. It's really not as hard as you think it might be.
This presentation will introduce AJAX in Grails through the GrailsUI plugin. We'll start with the core concepts behind the plugin and give examples of the most widely used and interesting widgets GrailsUI
provides.
Some examples will include methods of interacting with the widgets and handling events. We will also talk about how to provide proper JSON data to the widgets from the server.
The document discusses Ruby and Ruby on Rails. It notes that Ruby is an object-oriented programming language created by Yukihiro Matsumoto in 1995. Ruby on Rails is a web application framework built on Ruby that was created by David Heinemeier Hansson in 2004. It follows the model-view-controller architectural pattern, separating applications into models, views, and controllers.
- Ruby is an interactive, object-oriented programming language created by Yukihiro Matsumoto in 1995.
- Ruby on Rails is a web application framework built on Ruby that emphasizes convention over configuration and is optimized for programmer happiness.
- The document discusses Ruby and Ruby on Rails, providing an overview of their history, key principles like MVC, REST, and conventions used in Rails. It also provides examples of modeling data with classes and ActiveRecord in Rails.
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legione-Legion
Цель доклада — вдохновить разработчиков на более глубокое изучение возможностей Objective-C Runtime, показать способы исследования системы, воодушевить аудиторию на эксперименты.
В докладе показаны несколько примеров использования Objective-C Runtime для решения нетипичных задач. Первый пример - реализация простого KVO своими руками тремя способами. Вторым примером показана полезность исследования приватных классов. Рассказано, как во время работы программы получить информацию о протянутых IBOutlet и IBAction в xib и storyboard. В каждом примере присутствуют особенности реализации, на которых сделан акцент и показаны варианты решения или обхода.
This document provides a summary of various ActionScript methods and properties organized by category. It includes sections for common classes like MovieClip, UI components, containers, strings, sounds, and more. Each section lists relevant methods and properties in a table format for easy reference.
This document provides a cheat sheet of ActionScript methods, properties, and classes. It includes lists of common methods for classes like MovieClip, TextField, Button, and Sound. The cheat sheet acts as a quick reference guide for looking up syntax and functionality in ActionScript 2.0.
The document appears to be notes on Backbone.js. It includes summaries of Backbone models, events, views and how to bind events. It demonstrates creating a model with defaults, getting/setting attributes, and binding event handlers. It also shows creating a view with tagName, className and attributes, and logging the generated HTML element.
This document outlines topics covered in a lecture on object oriented JavaScript using the Prototype framework, including:
- Revision of object oriented JavaScript concepts like objects, prototypes, and classes
- Prototype framework utilities like $, $$ and Enumerable
- Extending DOM elements using Prototype methods
- Templates, form management, and getting element dimensions
- Event handling and classes/inheritance in Prototype
- JSON encoding/parsing
- Ajax utilities like Ajax.Request and Ajax.Updater
This document provides a summary of jQuery selectors, manipulation methods, events, AJAX functions, and utilities in 3 sentences or less:
jQuery allows selecting elements using CSS selectors, traversing and manipulating the DOM, handling events, making AJAX requests, and extending functionality through plugins. Common tasks include selecting elements by id, class, or other attributes, changing HTML and text contents, binding event handlers for page interactions, and making asynchronous HTTP requests. The cheat sheet also covers animation effects, interactivity helpers, traversing methods for navigating the DOM tree, and various utility functions for working with arrays, objects, and strings.
This document discusses changes and new features in jQuery versions 1.9, 2.0, and the use of Modernizr for browser feature detection. jQuery 1.9 removed several deprecated functions and made other API changes for consistency. New features included CSS property batching and the .finish() method. jQuery 2.0 reduced file size further and dropped support for older browsers. Modernizr detects CSS and JavaScript features and adds results to the page for conditional styling.
Single page webapps & javascript-testingsmontanari
This document discusses testing single page web applications built with AngularJS. It covers using fixtures to stub HTTP responses during functional testing. Static fixtures can return pre-defined responses from files, while dynamic fixtures allow generating responses programmatically. The jasmine.test.SinonFakeServer wrapper facilitates advanced dynamic fixtures by intercepting AJAX requests and returning fake responses, simulating network delays. This allows testing the application without changing code to use stubbed responses during tests.
This document contains code for a C# class called "test" that defines properties and validation attributes for a web form model. It includes properties for email, name, date, and other fields, along with attributes for validation rules like required, data type, length, and regular expressions. It also contains JavaScript code to add client-side validation logic and datepicker functionality to the form fields.
The document provides an overview of how to write a simplified version of Redux from scratch to gain a deeper understanding of its core principles and functionality. It explains key Redux concepts like single state tree, immutable state updates via pure reducer functions, actions to describe state changes, and the store interface. The document then walks through implementing a basic Redux-like store with methods for getState(), dispatch(), and subscribe(). It also covers combining multiple reducers into a single root reducer and managing different state slices independently. Overall, the document aims to help learn Redux fundamentals in a hands-on way through recreating the basic functionality.
El documento explica cómo usar zc.buildout para configurar un entorno de desarrollo Plone de forma automatizada. Se crea un archivo buildout.cfg que define las partes para instalar Zope, crear una instancia y agregar Plone. Esto permite generar nuevos entornos de forma rápida y consistente en comparación con hacerlo manualmente.
New in Plone 3.3. What to expect from Plone 4Quintagroup
The document discusses new features and improvements in Plone 3.3 including improved linking, resource registration, navigation, internationalization, and locking. It then outlines plans for Plone 4 which include a redesigned page composition system using blocks, increased performance, use of Dexterity for content types instead of Archetypes, upgrading to Python 2.6 and WSGI, and simplifying the Plone core.
This document provides an introduction and overview of Struts, an MVC framework for Java web applications. It discusses Struts' main components and design patterns, including:
- Struts acts as an MVC framework, providing utilities for web app development using the MVC pattern.
- The framework has 3 main components - Controller, View, and Model.
- Struts uses the standard MVC design of separating data, presentation, and business logic into separate but interacting elements.
This document provides an introduction and overview of Ruby on Rails, including what it is, its key features and benefits, and how to get started building a basic web application with Rails. Some of the key points covered include Rails' emphasis on productivity through conventions over configuration, scaffolding, and its implementation of the MVC framework and full-stack capabilities. Examples are also given of generating a controller and view to output basic text and dynamic content.
PECL Picks - Extensions to make your life betterZendCon
This document provides information about various PHP extensions available through PECL (PHP Extension Community Library). It introduces the author and their background, describes what PECL is and provides a brief history. It then discusses the current status of PECL, future plans, and how individuals can get involved. Finally, it highlights and provides code examples for several popular and useful PECL extensions, including APC, Memcache, Imagick, HTTP, UploadProgress and others.
This document provides steps to add Informix support to an existing PHP development environment using a LAMP (Linux, Apache, MySQL, PHP) stack. It describes downloading and installing XAMPP to set up the LAMP components, then downloading and installing the Informix database engine and Informix Client Software Development Kit (CSDK). Key steps include extracting the downloaded Informix packages, modifying permissions on installation files, running installation programs, verifying the PHP and database installations are working properly, and preparing to connect PHP to Informix using the CSDK libraries.
My opening talk at the European Plone symposium in Sorrento, Italy, May 2009.
About the plans and development of the Plone CMS in the near future (2009-10).
Geir Bækholt
O documento descreve o que é show cooking, que é a arte de cozinhar ao vivo e de forma interativa para o público. Ele também fornece uma receita de patê de atum, listando seus principais ingredientes como atum, pimento, sal, pimenta, maionese caseira e ovos cozidos. A receita é baseada em pesquisas do Instituto Nacional de Saúde Doutor Ricardo Jorge e do Google.
Testing your javascript code with jasmineRubyc Slides
This document discusses using Jasmine to test JavaScript code. It describes Jasmine as a behavior driven development framework for JavaScript testing. It then provides instructions on installing Jasmine, creating spec files to contain test cases, and including source code files. The document uses an example of testing a master-slave checkbox relationship to demonstrate how to set up tests, DOM elements, and code the tests against the actual code implementation.
- Ruby is an interactive, object-oriented programming language created by Yukihiro Matsumoto in 1995.
- Ruby on Rails is a web application framework built on Ruby that emphasizes convention over configuration and is optimized for programmer happiness.
- The document discusses Ruby and Ruby on Rails, providing an overview of their history, key principles like MVC, REST, and conventions used in Rails. It also provides examples of modeling data with classes and ActiveRecord in Rails.
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legione-Legion
Цель доклада — вдохновить разработчиков на более глубокое изучение возможностей Objective-C Runtime, показать способы исследования системы, воодушевить аудиторию на эксперименты.
В докладе показаны несколько примеров использования Objective-C Runtime для решения нетипичных задач. Первый пример - реализация простого KVO своими руками тремя способами. Вторым примером показана полезность исследования приватных классов. Рассказано, как во время работы программы получить информацию о протянутых IBOutlet и IBAction в xib и storyboard. В каждом примере присутствуют особенности реализации, на которых сделан акцент и показаны варианты решения или обхода.
This document provides a summary of various ActionScript methods and properties organized by category. It includes sections for common classes like MovieClip, UI components, containers, strings, sounds, and more. Each section lists relevant methods and properties in a table format for easy reference.
This document provides a cheat sheet of ActionScript methods, properties, and classes. It includes lists of common methods for classes like MovieClip, TextField, Button, and Sound. The cheat sheet acts as a quick reference guide for looking up syntax and functionality in ActionScript 2.0.
The document appears to be notes on Backbone.js. It includes summaries of Backbone models, events, views and how to bind events. It demonstrates creating a model with defaults, getting/setting attributes, and binding event handlers. It also shows creating a view with tagName, className and attributes, and logging the generated HTML element.
This document outlines topics covered in a lecture on object oriented JavaScript using the Prototype framework, including:
- Revision of object oriented JavaScript concepts like objects, prototypes, and classes
- Prototype framework utilities like $, $$ and Enumerable
- Extending DOM elements using Prototype methods
- Templates, form management, and getting element dimensions
- Event handling and classes/inheritance in Prototype
- JSON encoding/parsing
- Ajax utilities like Ajax.Request and Ajax.Updater
This document provides a summary of jQuery selectors, manipulation methods, events, AJAX functions, and utilities in 3 sentences or less:
jQuery allows selecting elements using CSS selectors, traversing and manipulating the DOM, handling events, making AJAX requests, and extending functionality through plugins. Common tasks include selecting elements by id, class, or other attributes, changing HTML and text contents, binding event handlers for page interactions, and making asynchronous HTTP requests. The cheat sheet also covers animation effects, interactivity helpers, traversing methods for navigating the DOM tree, and various utility functions for working with arrays, objects, and strings.
This document discusses changes and new features in jQuery versions 1.9, 2.0, and the use of Modernizr for browser feature detection. jQuery 1.9 removed several deprecated functions and made other API changes for consistency. New features included CSS property batching and the .finish() method. jQuery 2.0 reduced file size further and dropped support for older browsers. Modernizr detects CSS and JavaScript features and adds results to the page for conditional styling.
Single page webapps & javascript-testingsmontanari
This document discusses testing single page web applications built with AngularJS. It covers using fixtures to stub HTTP responses during functional testing. Static fixtures can return pre-defined responses from files, while dynamic fixtures allow generating responses programmatically. The jasmine.test.SinonFakeServer wrapper facilitates advanced dynamic fixtures by intercepting AJAX requests and returning fake responses, simulating network delays. This allows testing the application without changing code to use stubbed responses during tests.
This document contains code for a C# class called "test" that defines properties and validation attributes for a web form model. It includes properties for email, name, date, and other fields, along with attributes for validation rules like required, data type, length, and regular expressions. It also contains JavaScript code to add client-side validation logic and datepicker functionality to the form fields.
The document provides an overview of how to write a simplified version of Redux from scratch to gain a deeper understanding of its core principles and functionality. It explains key Redux concepts like single state tree, immutable state updates via pure reducer functions, actions to describe state changes, and the store interface. The document then walks through implementing a basic Redux-like store with methods for getState(), dispatch(), and subscribe(). It also covers combining multiple reducers into a single root reducer and managing different state slices independently. Overall, the document aims to help learn Redux fundamentals in a hands-on way through recreating the basic functionality.
El documento explica cómo usar zc.buildout para configurar un entorno de desarrollo Plone de forma automatizada. Se crea un archivo buildout.cfg que define las partes para instalar Zope, crear una instancia y agregar Plone. Esto permite generar nuevos entornos de forma rápida y consistente en comparación con hacerlo manualmente.
New in Plone 3.3. What to expect from Plone 4Quintagroup
The document discusses new features and improvements in Plone 3.3 including improved linking, resource registration, navigation, internationalization, and locking. It then outlines plans for Plone 4 which include a redesigned page composition system using blocks, increased performance, use of Dexterity for content types instead of Archetypes, upgrading to Python 2.6 and WSGI, and simplifying the Plone core.
This document provides an introduction and overview of Struts, an MVC framework for Java web applications. It discusses Struts' main components and design patterns, including:
- Struts acts as an MVC framework, providing utilities for web app development using the MVC pattern.
- The framework has 3 main components - Controller, View, and Model.
- Struts uses the standard MVC design of separating data, presentation, and business logic into separate but interacting elements.
This document provides an introduction and overview of Ruby on Rails, including what it is, its key features and benefits, and how to get started building a basic web application with Rails. Some of the key points covered include Rails' emphasis on productivity through conventions over configuration, scaffolding, and its implementation of the MVC framework and full-stack capabilities. Examples are also given of generating a controller and view to output basic text and dynamic content.
PECL Picks - Extensions to make your life betterZendCon
This document provides information about various PHP extensions available through PECL (PHP Extension Community Library). It introduces the author and their background, describes what PECL is and provides a brief history. It then discusses the current status of PECL, future plans, and how individuals can get involved. Finally, it highlights and provides code examples for several popular and useful PECL extensions, including APC, Memcache, Imagick, HTTP, UploadProgress and others.
This document provides steps to add Informix support to an existing PHP development environment using a LAMP (Linux, Apache, MySQL, PHP) stack. It describes downloading and installing XAMPP to set up the LAMP components, then downloading and installing the Informix database engine and Informix Client Software Development Kit (CSDK). Key steps include extracting the downloaded Informix packages, modifying permissions on installation files, running installation programs, verifying the PHP and database installations are working properly, and preparing to connect PHP to Informix using the CSDK libraries.
My opening talk at the European Plone symposium in Sorrento, Italy, May 2009.
About the plans and development of the Plone CMS in the near future (2009-10).
Geir Bækholt
O documento descreve o que é show cooking, que é a arte de cozinhar ao vivo e de forma interativa para o público. Ele também fornece uma receita de patê de atum, listando seus principais ingredientes como atum, pimento, sal, pimenta, maionese caseira e ovos cozidos. A receita é baseada em pesquisas do Instituto Nacional de Saúde Doutor Ricardo Jorge e do Google.
Testing your javascript code with jasmineRubyc Slides
This document discusses using Jasmine to test JavaScript code. It describes Jasmine as a behavior driven development framework for JavaScript testing. It then provides instructions on installing Jasmine, creating spec files to contain test cases, and including source code files. The document uses an example of testing a master-slave checkbox relationship to demonstrate how to set up tests, DOM elements, and code the tests against the actual code implementation.
Jython: Python para la plataforma Java (EL2009)Leonardo Soto
This document discusses using Python on the Java platform. It begins by asking if a Java platform can exist without Java, and explores using Python, Ruby, Scala and Groovy instead. It then highlights features of Python like being dynamic, flexible and readable. Jython is introduced as a way to use Python on the Java platform. The document demonstrates using Swing GUIs from Jython and shows a Django web application example. It also discusses testing Python code including doctests and integration tests using HtmlUnit. Finally, it mentions some companies that use Jython and provides resources for learning more.
This document provides a quick reference to various VBScript elements including:
1. Sections for displaying output, handling errors, declaring variables, and connecting to WMI/LDAP.
2. Examples of common queries for processes, services, users, and OUs.
3. Covers conditional statements, loops, arrays, functions, and interacting with Office applications.
4. Shows how to execute scripts from the command line using cscript.exe or wscript.exe.
Jython: Python para la plataforma Java (JRSL 09)Leonardo Soto
This document discusses using Python on the Java platform with Jython. It begins with an introduction to Jython, noting that it allows Python code to run on the Java Virtual Machine while maintaining compatibility with CPython. The document then provides examples of using Swing GUI libraries from Python with Jython. It also demonstrates using Django to build a simple wiki application in Jython. Finally, it discusses doctests for testing Python code and mentions some organizations that use Jython, such as Lockheed Martin and EADS.
The document describes a .NET library management system created by Frank Rodenbaugh. It includes Windows and web-based applications that allow librarians to manage member accounts and book inventories. The system uses a 3-tier architecture with data access code calling stored procedures to interact with the SQL Server database. It provides validation, error handling and an intuitive user interface. Samples are shown of the Windows forms, ASP.NET web forms, ADO.NET code using parameters in stored procedures, and the code of a stored procedure to add a new book to the library.
This document provides an overview of DataMapper, an object-relational mapper (ORM) library for Ruby applications. It summarizes DataMapper's main features such as associations, migrations, database adapters, naming conventions, validations, custom types and stores. The document also provides examples of how to use DataMapper with different databases, import/export data, and validate models for specific contexts.
Unit Test Candidate Solutions discusses various techniques for unit testing including:
- Using mock environments to isolate tests and focus on single responsibilities
- Preparing test data, files, and mock objects to provide context for developers
- Verifying XML output using techniques like XPath, XMLUnit, and REXML
- Mocking domain logic using libraries like EasyMock, jMock, and Mockito
- Employing BDD specifications styles for more readable test code
In this talk, Adrian Kashivskyy, Netguru iOS Developer, digs into rarely discussed Swift features, such as literal convertibles, interpolation convertibles, pattern matching, reflection and advanced Objective-C bridging.
Scala is so flexible that it can be hard to know what it wants. Its syntax will give way and let you program in many different styles. The Scalactic library, on the other hand, quite opinionated about how you should program in Scala. It is guided by a specific philosophy. In this talk you'll find out what's in Scalactic, why it is there, and how you can take advantage of it in your projects.
Backbone.js: Run your Application Inside The BrowserHoward Lewis Ship
Backbone.js allows developers to structure JavaScript web applications as a set of models, views, and a router. Models contain application data, views are responsible for the UI, and the router handles application state and linking views to URLs. Collections are used to manage multiple models. Events are used to coordinate changes between the different components.
This document summarizes an upcoming talk about changes in Rails 3. It notes that Rails 3 release candidate 1 will soon be released, following beta 4. It warns that upgrading apps to Rails 3 may not be straightforward. The talk will cover unobtrusive JavaScript, ActiveModel which decouples models, ActiveRelation for database queries, and Bundler for managing gem dependencies.
This document discusses the different types of statements used in QuickTest Professional (QTP) test scripts, including declarations, comments, utility statements, object calls, flow control statements, function/action calls, checkpoints, output value statements, synchronization points, and VBScript statements. Declarations are used to define variables and constants. Comments explain parts of the test script. Utility statements launch applications and control program flow. Object calls interact with application objects. Flow control statements include if/else, select case, loops, and more. Functions and actions encapsulate reusable code. Checkpoints and output values verify test results. Synchronization waits ensure objects are ready. VBScript provides additional programming constructs.
Learning Java 4 – Swing, SQL, and Security APIcaswenson
This document provides an overview of Java concepts including SQL, security APIs, and Swing. It discusses how to connect to databases and execute queries using JDBC, implement cryptography using the security API, and build graphical user interfaces with Swing components like JFrames, JLabels, and JButtons. The document also provides code examples for working with databases, cryptography, and creating basic Swing interfaces.
Descriptive programming allows testers to directly enter object information into test scripts without using an object repository. There are two main types: static programming, where object information is directly provided in the script using properties and values, and dynamic programming, where description objects are created and used in the script. Descriptive programming is useful when objects are dynamic, the object repository is large, the application is not ready for recording, or modifications are needed but the repository is read-only. It offers benefits like faster execution, portability, easier maintenance, and the ability to start testing without the full application.
The document discusses using annotations in Java, providing examples of annotations for servlets, EJBs, web services, CDI, and using frameworks like JUnit, Spring, Javassist, and ASM. It presents code samples to define servlets, session beans, RESTful and SOAP web services, and component injection using annotations instead of XML configurations. The document also demonstrates how to programmatically read annotation values and metadata using reflection, Javassist, and ASM.
This document provides an overview of scripting with VBScript, including the anatomy of a VBScript, error handling, reading from and writing to files, reading command line results, querying WMI and Active Directory, and building GUIs with HTA. It discusses variables, constants, objects, functions, and subroutines as the main elements of a VBScript. It also provides examples of reading from and writing to files, executing commands and reading the output, and querying WMI classes. Finally, it mentions tools like Microsoft Scriptomatic and WMIGen that can help generate VBScript code.
Fabric.js is a JavaScript canvas library that simplifies canvas rendering and provides an interactive object model for canvas elements. It allows creating and manipulating canvas elements and objects in a more simplified way compared to using the native canvas API. The library provides features like animation, events, SVG parsing, text rendering, and supports multiple browsers. Future plans include reducing the library size, improving documentation, and adding touch support.
The document describes the Backbone.js framework and how it can be used to build single page applications. It explains the core components of Backbone - Models, Collections, Views and Routers. It provides examples of initializing a Backbone application, defining models and collections, creating views to render data, and setting up routes and navigation. It also covers events, templating, and best practices for structuring Backbone code into separate JavaScript files for models, collections, views etc.
Similar to Tom Lazar Using Zope3 Views And Viewlets For Plone 3.0 Product Development (20)
Sally Kleinfeldt - Plone Application Development PatternsVincenzo Barone
In 2004 The Nature Conservancy adopted Plone as the platform for ConserveOnline.org, a community site for sharing conservation information. Since then, we have gained experience implementing several successful Plone intranet applications, made plenty of mistakes, and learned how to - and how not to - approach new Plone projects. This talk will compare our experiences developing two very different intranet Plone applications that manage conservation information. The first application has a complex data model with a relational database backend and makes minimal use of Archetypes. Its requirements - including data model and user interface - were rigidly specified based on a spreadsheet tool. The second application is Archetypes-based and was developed using UML modeling and ArchGenXML. It has a simple data model, uses the ZODB for storage, and its requirements were more loosely specified. From the lessons we learned on these projects, we have developed a set of application pattern definitions to guide us when choosing technologies and estimating costs. We think these pattern definitions can help managers, integrators, and people new to Plone understand when to use Plone, when not to use Plone, and how to structure their interactions with clients to ensure a successful Plone project.
Where's the source, Luke? : How to find and debug the code behind PloneVincenzo Barone
Plone, being a python based CMS written as a project for the Zope application server, consist almost entirely of python modules and a number of configuration files. Python source code is loved by many in the community for its explicit readablity; however, for many experienced software developers, coming over to the Plone technology stack can be a haunting experience. It seems everything is hidden away as pickled object in the ZODB, and that layers of magic prevent one from understanding how it works and how to affect change. This presentation will explain to the novice: - how to track down the python source behind Plone - how to take advantage of rich open source tools like ctags and pdb - best practices for getting started with file system product development
ItalianSkin: an improvement in the accessibility of the Plone interface in or...Vincenzo Barone
The Italian government has made a law specifying the accessibility requirements (the most famous is the usage of the Strict XHTML) for public administration websites. To enable Plone front- and back-end to be compliant with these specifications the ItalianSkin project was initiated, but its development has gone beyond the simple implementation of the law and has continued with the objectives of making Plone wholly functional with screen readers for blind people and providing developers with automatic tools to improve the accessibility of their own sites. We would recommend this talk to anyone developing websites and in particular to those who are responsible for accessibility.
In this session I will describe possibilities for everybody to make Plone more known. This includes how to leverage the power of social media such as blogging, videoblogging and podcasting but also spreading the word about Plone by attending unconferences like Barcamps or being active in Second Life. This talk is targeted to everybody who want to make Plone more popular.
Lennart Regebro What Zope Did Wrong (And What To Do Instead)Vincenzo Barone
Zope did many things right originally by using Python and including batteries, but it had some downfalls like being unpythonic, having too many magical parts, and being too complicated. Zope 3 aimed to address these issues but ended up being too abstract and XML-based, slowing development. The document discusses ideas for improving on Zope by having a low entry threshold, being highly modular, and starting with finished applications that use Python and a component architecture.
Wichert Akkerman Plone Deployment Practices The Plone.Org SetupVincenzo Barone
The plone.org and plone.net websites are the first confrontation with Plone for most users. It is important that they perform well and are stable. With almost 4 million page views per day and thousands of LDAP users plone.org and plone.net are examples of a complex deployment setup requiring LDAP, caching and load balancing - all on a single machine. I will describe how the Plone websites are build and how those practices can be applied to other sites, making it possible to scale upwards to bigger sites or make smaller sites more efficient.
Philipp Von Weitershausen Untested Code Is Broken CodeVincenzo Barone
If you're one of those programmers who think that subtle bugs only happen to other people, or that only bad programmers need extensive testing, this talk is for you.
Any non-trivial piece of software should be accompanied by an appropriate suite of automated tests. Your Plone products are no exception. By understanding approaches to automated testing and following good working practices, you can improve the quality of your code, as well as your confidence in your own work.
In this talk, Philipp von Weitershausen and Martin Aspeli will take you through the theory and practice of unit testing, integration testing and functional testing. Through real-world examples, you will learn that testing is not only necessary: it can be fun too!
Duco Dokter - Plone for the enterprise market: technical musing on caching, C...Vincenzo Barone
This technical presentation will cover many aspects of what one might encounter when a plone site is to be deployed in a highly demanding environment. And for what it's worth, these are not only theoretical examples, but they have also been proven to work in real life. The following items will be presented: * High Availability architecture * Clustering with ZEO * Synchronizing Data.fs * Load Balancing * Sticky Sessions * Caching * Single Sign-On
The document discusses subtyping in Plone and presents an example of creating a new document subtype called "UltraDoc" using the p4a.subtyper package. The example shows how to define a marker interface, descriptor class, template, and ZCML configuration to integrate the new subtype into Plone so it appears as its own content type with a customized view. The presentation aims to demonstrate how subtyping can be used to provide different identities for content and transform content based on events.
Alec Mitchell Relationship Building Defining And Querying Complex Relatio...Vincenzo Barone
The current story for relating content in Plone, via Archetypes reference fields, is limited and known to have poor performance in some cases. This talk will focus on the integration of Zope 3 tools for handling relationships (intids, zc.relationship) in Zope 2 via plone.app.relations. In particular I will be comparing the merits of these tools against existing methods (Archetypes references, using a separate RDBMS for content relationships), discussing particular applications for which they may be useful, and some areas in which they fall short. The comparison to existing relationship modeling tools will cover performance, flexibility, and convenience. To illustrate the relative convenience, I will give a brief overview of the plone.app.relations API, from the lower level index and relationship container to the high level API for making queries and defining relationships. The discussion of applications will focus on a some real world uses. These include social networking, defining complex taxonomies, having content appear attached to multiple locations, and other things for which Plone typically would not be suitable (these tools are in use at http://www.thedailyreel.com). In particular, I'll discuss how the default relationship attributes and query methods from the API can be used to model each of these applications. Finally, I'll discuss the areas in which these tools may fall short in terms of performance and flexibility, and where an RDBMS or specialized catalog may be necessary.
The Wageindicator Foundation deploys Plone for it's world-wide portals on wage information. Moreover, Plone serves as an application platform for most of the web based tools used to create questionnaires, salarychecks and other interactive content. The Wageindicator Foundation was started in 2000 in the Netherlands, and is now the hub of an international collaboration between universities, research institutes, trade unions and commercial parties. The goal of the foundation is to share and compare wage information, and so to contribute to a transparent labor market. The ideological stance of the foundation means that Open Source and free software is preferred. The separate sites collect over 400.000 visitors per month, served by four clusters of two machines each, hosted in the USA, India and the Netherlands. Techniques involved are HA-Clustering, load-balancing, caching, remote distribution of new releases for software.
Xavier Heymans Plone Gov Plone In The Public Sector. Panel Presenting The...Vincenzo Barone
The PloneGov project regroups local and regional governments and SME from over 15 countries and 3 continents. The goals of this close collaboration is to develop in a cooperative manner, applications and websites suited for public organization for their own use as well as for their citizens’. To give an overview of PloneGov project and tools, we propose to make 6 presentations in 2x45 minutes: Xavier Heymans, will introduce the project, potential and strategy of development. Speakers will be experts from the public and private sector collaborating in PloneGov. They will represent the different national branches of PloneGov and will present their project and tools in use by local governments to parliaments.
Brent Lambert Plone In Education A Case Study Of The Use Of Plone And Educa...Vincenzo Barone
In recent years MIT has been releasing course materials online through their OpenCourseware project, making content available all around the world for free. Many people have benefited and continue to benefit today from having these materials available. Other universities are also now beginning to see the value of participating in similar movements, and are publishing OpenCourseware sites of their own. This movement is growing across the world including universities from several countries such as Japan, China, Spain, the Netherlands, Mexico, and the United States. Producing web sites with freely available educational content can be a complicated endeavor for many academic institutions. Work is currently being done to reduce the technological and economic barriers to participating in OpenCourseware. A project called eduCommons, which is built by the Center for Open Sustainable Learning (COSL) at Utah State University, is making it easier for institutions share their course materials. This session will detail the evolution of eduCommons, from its first release on Plone 1.5.2, to the most current version that has just been released on Plone 3. Even if you are not involved in OpenCourseware, but are contemplating making course materials or educational content available on the web, you will want to learn about our approach to writing reusable Plone based educational products, and learn about best practices of how to publish educational content from those who have been involved in the OpenCourseware movement.
The plone.org and plone.net websites are the first confrontation with Plone for most users. It is important that they perform well and are stable. With almost 4 million page views per day and thousands of LDAP users plone.org and plone.net are examples of a complex deployment setup requiring LDAP, caching and load balancing - all on a single machine. I will describe how the Plone websites are build and how those practices can be applied to other sites, making it possible to scale upwards to bigger sites or make smaller sites more efficient.
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...Vincenzo Barone
It is the last Plone age. The big and strong but lonely mammoth has led the way for eons. But now it is threatened by a pack of saber-tooth tigers who are quick, agile and work together. Can the friendly caveman save the mammoth and make piece with the sabers? Can Grok help making Zope and Plone more agile? Will Zope and the other web frameworks fall in love, and what do WSGI and Paste have to say about that? From the makers of "Zope on a Paste", coming this October, a comedy for the whole family (developers, integrators and newbiews). Rated PG-13.
Denis Mishunov Making Plone Theme 10 Most Wanted Tips Vincenzo Barone
It will be a chart of 10 small (some are not that small), but I hope useful tips for making new Plone theme. Among those might occur (the exact list might be slightly changed): 1. Center the logo 2. Makin rounded corners 3. Making dropdown shadows 4. *Under-water stones* of testing Plone theme. Places you might want to check before deployment and so on This session is supposed to cover the most wanted tips in Plone skinning process, based on questions on #plone, mailing lists and personal communications with people, making Plone themes. Target group for this session - Plone skinning beginners with basic knowledge of how Plone themes are produced and Plone skinning intermediaries. I hope this session will give people some cool ideas on how to improve their themes and work more productive in the future.
Kupu is the visual editor in Plone. This talk will cover how it came about, what it can do now, and what it might become. The talk will cover the new features in Kupu 1.4, and how to configure Kupu to get the best out of it. It will also look at some of the challenges that Kupu has to meet in the future.
KSS, the new Ajax framework for Plone 3 comes with great components by default. But what if you need to integrate it with legacy Javascript? Or maybe you want to integrate that nice library/widget you found on the web. During this talk I will show you where you can extend KSS and how to do it. You can watch me create both the server side and client side code needed to integrate an existing piece of Javascript. After this talk KSS should have no limits for you.
Jared Whitlock Open Source In The Enterprise Plone @ NovellVincenzo Barone
Novell has used various proprietary CMS solutions over time, including TeamSite and Vignette. None of these solutions met all of our needs, nor were they easy to modify. We began looking at different Open Source CMS options, and decided on Plone. This presentation will briefly discuss Novell's proprietary CMS history, why we chose Plone, what we are currently using and developing, and our plans for the future. It will also discuss our architecture for making Plone successful for enterprise websites.
Paul Everitt Community And Foundation Plones Past, Present, Future Vincenzo Barone
Plone is great software. But that golden egg comes from a golden goose -- the community. This talk gives some insight into how Plone came to be, then explains how Plone-the-software, Plone-the-community, and Plone-the-foundation are organized.
Recruiting in the Digital Age: A Social Media MasterclassLuanWise
In this masterclass, presented at the Global HR Summit on 5th June 2024, Luan Wise explored the essential features of social media platforms that support talent acquisition, including LinkedIn, Facebook, Instagram, X (formerly Twitter) and TikTok.
Building Your Employer Brand with Social MediaLuanWise
Presented at The Global HR Summit, 6th June 2024
In this keynote, Luan Wise will provide invaluable insights to elevate your employer brand on social media platforms including LinkedIn, Facebook, Instagram, X (formerly Twitter) and TikTok. You'll learn how compelling content can authentically showcase your company culture, values, and employee experiences to support your talent acquisition and retention objectives. Additionally, you'll understand the power of employee advocacy to amplify reach and engagement – helping to position your organization as an employer of choice in today's competitive talent landscape.
FIA officials brutally tortured innocent and snatched 200 Bitcoins of worth 4...jamalseoexpert1978
Farman Ayaz Khattak and Ehtesham Matloob are government officials in CTW Counter terrorism wing Islamabad, in Federal Investigation Agency FIA Headquarters. CTW and FIA kidnapped crypto currency owner from Islamabad and snatched 200 Bitcoins those worth of 4 billion rupees in Pakistan currency. There is not Cryptocurrency Regulations in Pakistan & CTW is official dacoit and stealing digital assets from the innocent crypto holders and making fake cases of terrorism to keep them silent.
Taurus Zodiac Sign: Unveiling the Traits, Dates, and Horoscope Insights of th...my Pandit
Dive into the steadfast world of the Taurus Zodiac Sign. Discover the grounded, stable, and logical nature of Taurus individuals, and explore their key personality traits, important dates, and horoscope insights. Learn how the determination and patience of the Taurus sign make them the rock-steady achievers and anchors of the zodiac.
SATTA MATKA SATTA FAST RESULT KALYAN TOP MATKA RESULT KALYAN SATTA MATKA FAST RESULT MILAN RATAN RAJDHANI MAIN BAZAR MATKA FAST TIPS RESULT MATKA CHART JODI CHART PANEL CHART FREE FIX GAME SATTAMATKA ! MATKA MOBI SATTA 143 spboss.in TOP NO1 RESULT FULL RATE MATKA ONLINE GAME PLAY BY APP SPBOSS
Best practices for project execution and deliveryCLIVE MINCHIN
A select set of project management best practices to keep your project on-track, on-cost and aligned to scope. Many firms have don't have the necessary skills, diligence, methods and oversight of their projects; this leads to slippage, higher costs and longer timeframes. Often firms have a history of projects that simply failed to move the needle. These best practices will help your firm avoid these pitfalls but they require fortitude to apply.
How to Implement a Real Estate CRM SoftwareSalesTown
To implement a CRM for real estate, set clear goals, choose a CRM with key real estate features, and customize it to your needs. Migrate your data, train your team, and use automation to save time. Monitor performance, ensure data security, and use the CRM to enhance marketing. Regularly check its effectiveness to improve your business.
Top mailing list providers in the USA.pptxJeremyPeirce1
Discover the top mailing list providers in the USA, offering targeted lists, segmentation, and analytics to optimize your marketing campaigns and drive engagement.
Zodiac Signs and Food Preferences_ What Your Sign Says About Your Tastemy Pandit
Know what your zodiac sign says about your taste in food! Explore how the 12 zodiac signs influence your culinary preferences with insights from MyPandit. Dive into astrology and flavors!
Unveiling the Dynamic Personalities, Key Dates, and Horoscope Insights: Gemin...my Pandit
Explore the fascinating world of the Gemini Zodiac Sign. Discover the unique personality traits, key dates, and horoscope insights of Gemini individuals. Learn how their sociable, communicative nature and boundless curiosity make them the dynamic explorers of the zodiac. Dive into the duality of the Gemini sign and understand their intellectual and adventurous spirit.
Navigating the world of forex trading can be challenging, especially for beginners. To help you make an informed decision, we have comprehensively compared the best forex brokers in India for 2024. This article, reviewed by Top Forex Brokers Review, will cover featured award winners, the best forex brokers, featured offers, the best copy trading platforms, the best forex brokers for beginners, the best MetaTrader brokers, and recently updated reviews. We will focus on FP Markets, Black Bull, EightCap, IC Markets, and Octa.
At Techbox Square, in Singapore, we're not just creative web designers and developers, we're the driving force behind your brand identity. Contact us today.
Part 2 Deep Dive: Navigating the 2024 Slowdownjeffkluth1
Introduction
The global retail industry has weathered numerous storms, with the financial crisis of 2008 serving as a poignant reminder of the sector's resilience and adaptability. However, as we navigate the complex landscape of 2024, retailers face a unique set of challenges that demand innovative strategies and a fundamental shift in mindset. This white paper contrasts the impact of the 2008 recession on the retail sector with the current headwinds retailers are grappling with, while offering a comprehensive roadmap for success in this new paradigm.
2. Who are you?
• Not a veteran Zope Developer
• A Plone integrator with Zope/Plone 2.x
experience (CMF based skins)
• Entirely new to Plone (Congratulations!)
• Sceptical and / or confused about this stuff
3. Who am I?
• Self-employed Developer, Sysad and
Consultant, based in Berlin, Germany
• Started working with Plone in 2003
• Contributor since April 2006 (Archipelago
Sprint, where development of 3.0 started)
• Started Plone 3.0 based product in March
2007, following trunk
4. History I
CMF skins
• A skin is a collection of templates and
ressources (CSS, JS, images, scripts, macros)
• CMF skins have ordered layers
• customization = copy to a higher layer
• Acquisition based lookup (“Which template
is producing this markup?!”)
5. History II
Macros
• re-use sub-page templates (navigation, etc.)
• Aquisition based lookup (“Which macro is
really being called?!”)
• Clumsy parameter handling
6. History III
Slots
• “Macros on steroids”
• i.e. add CSS links to header from body
template, advanced loops
• extremely powerful
• only one macro per slot, though
7. History III
Python scripts
• security limitations (can’t use
unrestrictedSearchResults, can’t
import all packages etc.)
• cumbersome to debug (enablesettrace)
• Clumsy parameter handling (pyflakes)
8. History III
Python scripts
• No subclassing (let alone interfaces)
• Acquisition based lookup (“Which script is
being called?!”)
• hard (impossible?) to test
9. History IV
The Good
• very straightforward: copy, edit, reload
• very flexible: easy to override defaults
• instant gratification (TTW support)
• large factor in Zope 2’s success
10. History V
The Bad
• “implicit magic”: WTF is going on here?!
• tendency to overload templates with
application logic (‘dummy’ calls, anyone?)
• “maze of python scripts”
• in summary: “messy”
11. History VI
The Ugly
“Acquisition is a
jealous mistress”
Martin Aspeli
‘Nuff said!
12. Enter Zope3
• Rewritten from the ground up
• “Component Architecture”: Interfaces,
Adapters... and Views
• pluggable via configuration a.k.a.“XML sit-
ups” (Grok is changing that, though)
• lots of other Goodies (buildout, eggs,
events)
13. Benefits of the CA
• makes it easy to write small, specific, easy
to understand code
• re-usability
• explicit (it never guesses! no magic!)
14. portalstatusmessages
Interface Adapter
from zope.interface import Interface, Attribute
from base64 import encodestring, decodestring
from pickle import dumps, loads
import sys
from zope.annotation.interfaces import IAnnotations
from zope.i18n import translate
from zope.interface import implements
class IMessage(Interface): from Products.statusmessages import STATUSMESSAGEKEY
from Products.statusmessages.message import Message
quot;quot;quot;A single status message.quot;quot;quot; from Products.statusmessages.interfaces import IStatusMessage
import logging
logger = logging.getLogger('statusmessages')
class StatusMessage(object):
message = Attribute('The text of this message.
quot;quot;quot;Adapter for the BrowserRequest to handle status messages.
Let's make sure that this implementation actually fulfills the
Usally a Message object.')
'IStatusMessage' API.
>>> from zope.interface.verify import verifyClass
>>> verifyClass(IStatusMessage, StatusMessage)
True
quot;quot;quot;
implements(IStatusMessage)
type = Attribute('The type of this message.') def __init__(self, context):
self.context = context # the context must be the request
def addStatusMessage(self, text, type=''):
quot;quot;quot;Add a status message.
quot;quot;quot;
text = translate(text, context=self.context)
annotations = IAnnotations(self.context)
class IStatusMessage(Interface): old = annotations.get(STATUSMESSAGEKEY, self.context.cookies.get(STATUSMESSAGEKEY))
value = _encodeCookieValue(text, type, old=old)
quot;quot;quot;An adapter for the BrowserRequest to handle
self.context.RESPONSE.setCookie(STATUSMESSAGEKEY, value, path='/')
annotations[STATUSMESSAGEKEY] = value
def showStatusMessages(self):
status messages.quot;quot;quot; quot;quot;quot;Removes all status messages and returns them for display.
quot;quot;quot;
annotations = IAnnotations(self.context)
value = annotations.get(STATUSMESSAGEKEY, self.context.cookies.get(STATUSMESSAGEKEY))
if value is None:
return []
def addStatusMessage(text, type=''): value = _decodeCookieValue(value)
# clear the existing cookie entries
self.context.cookies[STATUSMESSAGEKEY] = None
quot;quot;quot;Add a status message.quot;quot;quot; self.context.RESPONSE.expireCookie(STATUSMESSAGEKEY, path='/')
annotations[STATUSMESSAGEKEY] = None
return value
def _encodeCookieValue(text, type, old=None):
quot;quot;quot;Encodes text and type to a list of Messages. If there is already some old
def showStatusMessages():
existing list, add the new Message at the end but don't add duplicate
messages.
quot;quot;quot;
results = []
quot;quot;quot;Removes all status messages and returns message = Message(text, type=type)
if old is not None:
them for display. results = _decodeCookieValue(old)
if not message in results:
results.append(message)
quot;quot;quot; # we have to remove any newlines or the cookie value will be invalid
return encodestring(dumps(results)).replace('n','')
def _decodeCookieValue(string):
quot;quot;quot;Decode a cookie value to a list of Messages.
The value has to be a base64 encoded pickle of a list of Messages. If it
contains anything else, it will be ignored for security reasons.
quot;quot;quot;
results = []
# Return nothing if the cookie is marked as deleted
if string == 'deleted':
return results
# Try to decode the cookie value
try:
values = loads(decodestring(string))
except: # If there's anything unexpected in the string ignore it
logger.log(logging.ERROR, '%s n%s',
'Unexpected value in statusmessages cookie',
sys.exc_value
)
return []
if isinstance(values, list): # simple security check
for value in values:
if isinstance(value, Message): # and another simple check
results.append(value)
return results
17. Views + Templates
• Think “View = Dictionary”
• Views collect data from the application into
a dictionary
• Templates take the data from the dictionary
and insert it into the markup
18. Views + Templates
• Templates insert, replace and loop
(conditionally) – keep them ‘dumb’
• use methods (with @property, @memoize
at your discretion)
• use kw dictionary for simple attributes:
kw.update(‘foo’, bar)
19. Views + Templates
• Templates insert, replace and loop
(conditionally) – keep them ‘dumb’
• use methods (with @property, @memoize
at your discretion)
• use kw dictionary for simple attributes:
kw.update(‘foo’, bar)
21. Views + Templates
• avoid using self.foo for attributes (for
consistency’s sake)
• python expressions in templates are not
inherently evil! (only to abuse them is)
• python expressions are ca. 3x faster than
path expressions!
26. Context
from Acquisition import aq_inner
from Products.Five.browser import BrowserView
class MyView(BrowserView):
def some_view_function(self):
context = aq_inner(self.context)
“If you forget the aq_inner() it will probably still work 9 times out of 10,
but the 10th time you're screwed and wondering why you're getting insane
errors about user folders and attributes not being found.”
Martin Aspeli
27. View Interfaces
• a contract between developer and designer
from zope.interface import Interface
from zope.interface import implements
from Products.Five.browser import BrowserView
class ISummaryPage(Interface):
def summary():
pass
def body():
pass
class IntroPageView(BrowserView):
implements(ISummaryPage)
def summary(self):
return foo()
28. Dos and Don’ts
• don’t use __init__()
• use __call__()
• don’t use context/foo (expensive!)
• use kw + options/foo and/or Interfaces
29. Hack No. 1
View + skin template
For extra flexibility you can hook up a Five
view with a skin based template:
from Acquisition import aq_acquire
from Products.Five.browser import BrowserView
class IntroPageView(BrowserView):
def __call__(self, *args, **kw):
kw.update({'some_name' : nifty_method()})
return aq_acquire(self.context, 'intro-page')(**kw)
30. Skin switching
• Use a different skin depending on URL
• Useful for editing sites with heavily customized
public skin
• For example: use Plone’s default skin when
accessed via HTTPS
• Old method with External Method and ‘Set
Access Rule’ no longer works (plone.theme
marks request with default skin before rule is
processed)
• New method is actually easier and less code
31. Skin switching
The Code
def setskin(site, event):
if event.request.URL.startswith('https'):
site.changeSkin(“Plone Default”, event.request)
The Glue
<subscriber
for=quot;Products.CMFPlone.interfaces.IPloneSiteRoot
zope.app.publication.interfaces.IBeforeTraverseEventquot;
handler=quot;.skinswitcher.setskinquot; />
32. Caching
Two basic approaches:
• cache results of view methods: memoize
• cache entire view/viewlet: lovely.viewcache
33. Caching
from plone.memoize.instance import memoize
from Products.Five.browser import BrowserView
class MyView(BrowserView):
@memoize
def expensiveMethod(self):
return foo
35. lovely.viewcache
• Entire page usually not cacheable
• But caching viewlets is particularly useful
• By using views and viewlets you futureproof
your product for later scalability!
36. subclass BrowserView
• common methods for all your views
• group and share similar behaviour
• hierarchy easier to debug than Acquisition!
37. Hack No. 2: custom
viewlet per page
Usecase: custom logo viewlet for frontpage only.
Didn’t want to add extra logic to view class and
template just for that.
Solution: custom template for frontpage
<browser:viewlet
name=quot;plone.logoquot;
manager=quot;plone.app.layout.viewlets.interfaces.IPortalHeaderquot;
class=quot;.viewlets.LogoViewletquot;
permission=quot;zope2.Viewquot;
layer=quot;.interfaces.IMySkinSpecificquot;
/>
38. Hack No. 2: custom
viewlet per page
from Products.CMFPlone.interfaces import IPloneSiteRoot
from plone.app.layout.viewlets.common import LogoViewlet as
LogoViewletBase
class LogoViewlet(LogoViewletBase):
_template = ViewPageTemplateFile('logo.pt')
_frontpage_template = ViewPageTemplateFile('logo-frontpage.pt')
def render(self):
if IPloneSiteRoot.providedBy(self.context):
return self._frontpage_template()
else:
return self._template()
39. Hack No. 2: custom
viewlet per page
That’s stupid, don’t do that!
Viewlet accepts view attribute, problem solved!
<browser:viewlet
name=quot;plone.logoquot;
manager=quot;plone.app.layout.viewlets.interfaces.IPortalHeaderquot;
class=quot;.viewlets.FrontpageLogoViewletquot;
permission=quot;zope2.Viewquot;
layer=quot;.interfaces.IMySkinSpecificquot;
view=”IFrontpageView”
/>
40. Fun with Views
• Remember:Views are just multi-adapters
that return (in most cases) HTML
• ZPT is just a default behavior
• Let’s use... Genshi