web2py Pluginsjust some cool examples |
|||||||||
| /plugins/default/locking [ login | register | lost password ] | |||||||||
Main Menu |
Attention: some of the plugins listed here are old (in particular jqgrid, comments, tagging, modal, dropdow, attachments, latex, flash video and deprecated). Newer versions have been incorporated into plugin_wiki. Here is a video about plugin_wiki. Make sure you watch it before you proceed. The OpenID, Facebook and RPX plugins are also obsolete since RPX, OpenID, Oauth 1.0 and 2.0 support is built into web2py. Check in the online manual.
web2py plugins are self contained pieces of an application that can be added to any existing application. They usually define components, i.e. objects that can be embedded in a page and talk to the server via ajax. Often they include corresponding jQuery plugins and the serverside funcitonality to make them work. Here you can find some examples. The web2py admin interface provides a web interface to upload and manage the plugins. The plugin themsselves are .w2p files (as for web2py apps). There are just tar gzipped files containing the source code. You do not need to unzip them. The admin interface will unzip them on upload in web2py. Once a plugin becomes part of your app, you can customize it without affecting other apps. Look and feel can be customized via CSS. About Plugin LockingThis plugin allows to lock a record so that two distinct users cannot access it at the same time. The record is kept locked by an ajax keepalize signal. Example Source code (user code)Here is an example of an action that locks a record (tablename, record_id) for one hour (3600 seconds) and renews the lock via ajax every 60 seconds. If the page that perform the ajax requests is closed, the lock is released in 60 seconds.Controller: default.py
plugin_locking returns None if it fails to acquire the lock View: default/index.html
The lock returned by the plugin_locking is a piece of javascript code that performs the ajax keepalive and it must be embedded in the page Required plugin (including plugin source code)You need this. Just upload it through the web2py plugin interface for your app. download |
||||||||
|
Copyright © 2009 - Powered by web2py |
|||||||||