Personal tools
Skip to content. | Skip to navigation
Terraform digitalocean provider
Zope External Editor ==================== The Zope External Editor is a new way to integrate Zope more seamlessly with client-side tools. It has the following features: - Edit objects locally, directly from the ZMI. - Works with any graphical editor application that can open a file from the command line, including: emacs, gvim, xemacs, nedit, gimp, etc. - Automatically saves changes back to Zope without ending the editing session. - Associate any client-side editor application with any Zope object by meta-type or content-type. Both text and binary object content can be edited. - Locks objects while they are being edited. Automatically unlocks them when the editing session ends. - Can add file extensions automatically to improve syntax highlighting or file type detection. - Works with basic auth, cookie auth and Zope versions. Credentials are automatically passed down to the helper application. No need to reauthenticate. - https support (Openssl required) Using It -------- Use of the application is about as easy as using the ZMI once your browser is configured (see the installation instructions). To edit an object externally, just click on the pencil icon next to the object in the ZMI. The object will be downloaded and opened using the editor application you have chosen (you will be prompted the first time to choose an editor). You edit the object just like any other file. When you save the changes in your editor, they are automatically uploaded back to Zope in the background. While the object is open in your editor, it is locked in Zope to prevent concurrent editing. When you end your editing session (ie you close your editor) the object is unlocked. How it Works ------------ Ok, so this all sounds a bit too good to be true, no? So how the heck does it work anyway? First I'll give you a block diagram:: +------------+ +------------+ +---------+ +------+ | Editor App | <-- | Helper App | <-- | Browser | <-/ /- | Zope | +------------+ +------------+ +---------+ +------+ ^ ^ ^ ^ \ / \ / v v -----------------------/ /---- ------- / Local \ \ File / ------- Now the key to getting this to work is solving the problem that the editor cannot know about Zope, and must only deal with local files. Also, there is no standard way to communication with editors, so the only communication channel can be the local file which contains the object's content or code. It is trivial to get the browser to fire up your editor when you download a particular type of data with your browser. But that does you little good, since the browser no longer involves itself once the data is downloaded. It just creates a temp file and fires off the registered application, passing it the file path. Once the editor is running, it is only aware of the local file, and has no concept of where it originated from. To solve this problem, I have developed a helper application whose job is essentially two-fold: - Determine the correct editor to launch for a given Zope object - Get the data back into Zope when the changes are saved So, let's take a step by step look at how it works: 1. You click on the external editor link (the pencil icon) in the Zope management interface. 2. The product code on the server creates a response that encapsulates the necessary meta-data (URL, meta-type, content-type, cookies, etc) and the content of the Zope object, which can be text or binary data. The response has the contrived content-type "application/x-zope-edit". 3. The browser receives the request, and finds our helper application registered for "application/x-zope-edit". It saves the response data locally to disk and spawns the helper app to process it. 4. The helper app, reads its config file and the response data file. The meta-data from the file is parsed and the content is copied to a new temporary file. The appropriate editor program is determined based on the data file and the configuration. 5. The editor is launched as a sub-process of the helper app, passing it the file containing the content data. 6. If so configured, the helper app sends a WebDAV lock request back to Zope to lock the object. 7. Every so often (if so configured), the helper app stats the content file to see if it has been changed. If so, it sends an HTTP PUT request back to Zope containing the new data. 8. When the editor is closed, the content file is checked one more time and uploaded if it has changed. Then a WebDAV unlock request is sent to Zope. 9. The helper application exits. Configuration ------------- The helper application supports several configuration options, each of which can be triggered in any combination of object meta-type, content-type or domain. This allows you to create appropriate behavior for different types of Zope objects and content or even different servers. The configuration file is stored in the file "~/.zope-external-edit" (Unix) or "~\ZopeEdit.ini" (Windows). If no configuration file is found when the helper application starts, a default config file is created in your home directory. The configuration file follows the standard Python ConfigParser format, which is pretty much like the old .ini file format from windows. The file consists of sections and options in the following format:: [section 1] option1 = value option2 = value [section 2] ... Options ------- The available options for all sections of the config file are: editor -- Command line or plugin name used to invoke the editor application. On Windows, if no editor setting is found for an object you edit, the helper app will search the file type registry for an appropriate editor based on the content-type or file extension of the object (which can be specified using the extension option below). By default, the file path of the local file being edited is appended to this command line. To insert the file path in the middle of your command, use "$1" for Unix and "%1" for Windows respectively. save_interval -- (float) The interval in seconds that the helper application checks the edited file for changes. use_locks -- (1 or 0) Whether to use WebDAV locking. The user editing must have the proper WebDAV related permissions for this to work. always_borrow_locks -- (1 or 0) When use_locks is enabled this features suppresses warnings when trying to edit an object you have already locked. When enabled, external editor will always "borrow" the existing lock token instead of doing the locking itself. This is useful when using CMFStaging for instance. If omitted, this option defaults to 0. cleanup_files -- (1 or 0) Whether to delete the temp files created. WARNING the temp file coming from the browser contains authentication information and therefore setting this to 0 is a security risk, especially on shared machines. If set to 1, that file is deleted at the earliest opportunity, before the editor is even spawned. Set to 0 for debugging only. extension -- (text) The file extension to add to the content file. Allows better handling of images and can improve syntax highlighting. temp_dir -- (path) Path to store local copies of object data being edited. Defaults to operating system temp directory. *Note: this setting has no apparent effect on Windows* 8^( long_file_name -- (1 or 0) Whether to include the whole path to the object including the hostname in the file name (the default) or just the id of the object being edited. Turn this option off for shorter file names in your editors, and for editors that don't like long names. file_name_separator -- (string) Character or characters used to separate path elements in long files names used by external editor. Defaults to a comma (,). This must be a legal character for use in file names on your platorm (i.e., don't use a path separator character!). This option is ignored if 'long_file_name' is set to 0. Sections -------- The sections of the configuration file specify the types of objects and content that the options beneath them apply to. There is only one mandatory section '[general]', which should define all of the above options that do not have a default value. If no other section defines an option for a given object, the general settings are used. Additional sections can apply to a particular domain, content-type or meta-type. Since objects can have all these properties, the options are applied in this order of precedence. - [content-type:text/html] -- Options by whole content-type come first. - [content-type:text/*] -- Options by major content-type come second. - [meta-type:File] -- Options by Zope meta-type are third. - [domain:www.mydomain.com] -- Options by domain follow. Several sections can be added for each domain level if desired. - [general] -- General options are last. This scheme allows you to specify an extension by content-type, the editor by meta-type, the locking settings by domain and the remaining options under general for a given object. Editor Plugins -------------- For tighter client-side integration, external editor has a plugin system that allows it to interact directly with supported applications. On Windows this generally means using COM to invoke the application, open the content file and wait for the user to save and close the file. Because each application has different remote scripting capabilities and APIs, editor specific plugins must be written tailored to each supported application and platform. This system allows external editor to efficiently connect to running applications without relaunching them and therefore fully support MDI environments. The following applications currently have plugin support:: Application Platform Plugin Module Name(s) =================================================== HomeSite Windows homesite5, homesite Dreamweaver Windows dreamweaver Photoshop Windows photoshp, photoshop MS Word Windows winword, word MS Excel Windows excel MS Powerpoint Windows powerpnt, powerpoint External editor will attempt to load a plugin for any application before using the general editor control method. It does this by matching the name of the application executable file (sans extension) in the editor command line with the available plugins. Because plugins do not require the path of the editor application to work, you can simply specify the plugin module name for your editor in the configuration file if desired. For example, to specify Photoshop for all image files, use add the following section to your config file (ZopeEdit.ini on Windows):: [content-type:image/*] editor=photoshop This is only a shortcut and specifying the full application path will still use the plugin where possible. Plugin Notes ------------ Photoshop -- Photoshop's COM API is quite limited, and external editor cannot detect that you have closed a file until you exit the entire application (it can still detect saves). Therefore you may want to turn off DAV locking (use_locks=0) or borrow locks (always_borrow_locks=1) when using it. Dreamweaver -- External editor cannot detect when you have finished editing a single file. Objects edited with Dreamweaver will remain locked on the server until you exit the application. As with Photoshop above, you may want to turn off locking for Dreamweaver. If your favorite editor needs a plugin because the general support is not good enough, please let me know. Keep in mind that I must be able to run a copy of the application in order to develop a plugin for it. So, unless the application is free, or a full demo is available for download I won't be able to help much. Plugins are not difficult to write, and I encourage you to write one for your favorite editor, start by reading one of the existing ones. I am happy to include third-party plugins with the distribution. Permissions ----------- External editing is governed by the permission "Use external editor". Users with this permission can launch external editor from editable objects. In order to save changes, users will need additional permissions appropriate for the objects they are editing. If users wish to use the built-in locking support, they must have the "WebDAV access", "WebDAV Lock items" and "WebDAV Unlock items" permissions for the objects they are editing. If these permissions are not set in Zope, then the helper application will receive unauthorized errors from Zope which it will present to the user. Integrating with External Editor -------------------------------- The external editor product in zope installs a globally available object that can format objects accessible through FTP/DAV for use by the helper application. You can take advantage of this functionality easily in your own content management applications. Say you have an FTP editable object, "document", in a Zope folder named "my_stuff". The URL to view the object would be:: http://zopeserver/my_stuff/document The URL to kick off the external editor on this document would be:: http://zopeserver/my_stuff/externalEdit_/document Now, this may look a bit odd to you if you are used to tacking views on to the end of the URL. Because externalEdit_ is required to work on Python Scripts and Page Templates, which swallow the remaining path segments on the URL following themselves, you must put the call to externalEdit_ *directly before* the object to be edited. You could do this in ZPT using some TAL in a Page Template like:: <a href='edit' attributes='href string:${here/aq_parent/absolute_url}/externalEdit_/${here/getId}'> Edit Locally </a> As an alternative, you can also pass the path the object you want to edit directly to the `externalEdit_` object when you call its index_html method. It can be called either directly by URL or from a python script. externalEdit_ will return the proper response data for the object to edit. Here are some examples:: http://zopeserver/externalEdit_?path=/my_stuff/document return context.externalEdit_.index_html( context.REQUEST, context.RESPONSE, path='/my_stuff/document') When integrating External Editor with a CMS that already uses DAV locks, it will, by default allow users to borrow locks made on the server after displaying a confirmation dialog box. Although you can make this automatic by specifying 'always_borrow_locks = 1' in the External Editor config file, it may be desireable to make this the default behavior when using that server. To facilitate this, you can specify that locks should be automatically borrowed in the URL (New in 0.7):: http://zopeserver/my_stuff/externalEdit_/document?borrow_lock=1 External Editor also defines a global method that you can call to insert pencil icon links for appropriate objects. The method automatically checks if the object supports external editing and whether the user has the "Use external editor" permission for that object. If both are true, it returns the HTML code to insert the external editor icon link. Otherwise it returns an empty string. The method is 'externalEditLink_(object)'. The object argument is the object to create the link for if appropriate. Here is some example page template code that inserts links to objects in the current folder and the external editor icon where appropriate:: <div tal:repeat="object here/objectValues"> <a href="#" tal:attributes="href object/absolute_url" tal:content="object/title_or_id">Object Title</a> <span tal:replace="structure python:here.externalEditLink_(object)" /> </div> Conclusion ---------- I hope you enjoy using this software. If you have any comments, suggestions or would like to report a bug, send an email to the author:
Kupu is a cross-browser WYWSIWYG editor. It allows the comfortable editing of the body of an HTML document. It's client-side (browser) requirements are one of: - Mozilla 1.3.1 or higher - Internet Explorer 5.5 or higher - Netscape Navigator 7.1 or higher - Opera 9 or higher Server-side there are hardly any requirements, except for some way of processing data (CGI or something more fancy like PHP, ASP or Python scripts in Zope). Kupu is particularly suited for content migration as well as editing. Content copied from an existing web page is pasted with all formatting intact. This includes structure such as headings and lists, plus links, image references, text styling, and other aspects. Copying text from a word processor with an HTML clipboard - such as MS Word - works exactly the same. Kupu will clean up the content before it is sent to the server, and can send data to the server asynchronously using PUT (which allows the data to be saved without reloading the page) as well as in a form. Kupu can be customized on many different levels, allowing a lot of changes from CSS, but also providing a JavaScript extension API.
Dump buildout picked versions.
plone.app.content contains various views for Plone, such as folder_contents, as well as general content infrastructure, such as base classes and name choosers.
This package provides various control panels for Plone and some infrastrucuture to make it as easy as possible to create those with the help of zope.formlib. The general approach taken is to re-use as much of formlib as possible. This lead to the decision to use formlib's EditForm's functionality, as these provide the most automation found in formlib today. As a result of this decision we needed to take a slightly unconventional approach as EditForm's only work on one single context, as they are targeted at editing content objects, which usually are available as one context only. Control panels on the other side most commonly present settings from various sources and group these in a user-friendly way. In order to still be able to use EditForm's we introduce one abstract adapter as a middleware layer per control panel, that is used as the one context formlib's EditForm's need but internally pulls in the various settings from all the possible sources and pushes them back to the right places again. Following this approach a control panel consists of at least three classes: - An interface that describes the settings to be available in the control panel with the help of zope.schema. This gives us automatic type checking and some other basic validation of the settings. It also lets us specify vocabularies to be used for Choice-type properties. - An adapter implementing the above interface, exposing all the different settings as properties. As we don't want to have those control panels available all over the place, we restrict them to adapt the 'IPloneSiteRoot' only. Sometimes we use the 'SchemaAdapterBase' class from CMFDefault.formlib and the property wrapper 'ProxyFieldProperty' to automatically convert the values found in our site to the types expected by formlib and vica versa. For example we often need to store tuples while formlib expects sets, store encoded strings in site encoding rather than unicode or use Zope2's DateTime class instead of Python's datetime package. - And finally the form itself. We can use the common base class 'ControlPanelForm' to provide us with a consistent look and feel for all control panels. This is accomplished by using the 'control-panel.pt' template. For most cases this should be the only template that needs to be written. The 'ControlPanelForm' also provides us with two common actions and as a side effect overrides the 'handle_edit_action' in a Zope2-compatible way, where the default implementation needs the current locale to be present as part of the REQUEST, which is not the case in a Zope2 environment so far. The form is also the place to specify custom widgets for some properties. There are some custom widgets available in the widgets.py module in this package. While the above-mentioned works pretty well for simple cases it is not yet clear if it will work for complex control panels in the same way. Especially forms that use a multitude of actions (for example user/group management) or consist of more than one 'tab' (for example kupu but also smart folder settings) are not easily implemented so far. Hopefully we will be able to provide common helper classes and templates for those complex cases as well, though.
Plone.app.event is the calendaring framework for Plone. It provides Dexterity behaviors and an Archetypes type, Timezone support, RFC5545 icalendar export, Recurrence support, event views and a lot more. For a Dexterity event type using plone.app.event, use plone.app.contenttypes 1.1 or newer.
Plone Mosaic is a new layout solution for Plone. It’s built for Plone 5, but should also work on Plone 4.3 with plone.app.widgets. Read this introduction and the package documentation for more details how to use this package. Concepts Mosaic, Blocks and Tiles provide a simple, yet powerful way to manage the pages on your Plone website. At their core, they rely on semantic HTML and resources with valid, publishable URLs. Mosaic Editor editor is a visual editor for pages rendered using Blocks. It relies on a grid system to place tiles onto a page in an intuitive, WYSIWYG, drag-and-drop manner. Using Mosaic Editor, it is easy to compose pages with complex, balanced and visually appealing layouts. - custom layout behavior for Dexterity content types Currently, the Mosaic Editor is activated, when any content with Custom layout view active is being edited. (Custom layout is available for any content with Layout support behavior enabled.) Blocks is a rendering algorithm based on HTML markup conventions. A page managed by Mosaic Editor is stored as a simple HTML document representing the actual content of that page as a standalone, publishable resource devoid of any site layout content (e.g. global navigation elements). This is referred to as content layout. Tiles represent the dynamic portions of a page. At its most basic level, a tile is simply an HTML document with a publishable URL. In practice, tiles are usually implemented as browser views deriving from the Tile base class and registered with the <plone:tile /> ZCML directive. This allows tiles to have some basic metadata and automatically generated edit forms for any configurable aspects , which Deco will expose to users. See plone.tiles for examples. When work with tiles in Mosaic Editor, there are three types of tiles: Text tiles Static HTML markup (WYSIWYG-edited text) placed into the content or site layout. Strictly speaking, text tiles are not tiles in that they do not involve any tile fetching or merging - instead they are stored as part of the page or site layout. To the user, however, a text tile can be moved around and managed like any other. Field tiles Render the value of a metadata field such as the title or description. The values of field tiles may be edited in-place in the page, but the value is stored in the underlying field and can be indexed in the catalog, used for navigation and so on. In practice, a field tile is an instance of the special tile plone.app.standardtiles.fields with the field name passed as a parameter. App tiles Any other type of dynamic tile. Examples may include a folder listing, a media player, a poll or pretty much anything else you can think of.
plone.app.portlets provides a Plone-specific user interface for plone.portlets, as well as a standard set of portlets that ship with Plone.
This package contains standard tiles to be used with Plone Mosaic (or as such with Plone Blocks composition).