{ "info": { "author": "Shane Hathaway", "author_email": "shane@hathawaymix.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Plone", "Framework :: Zope2", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Programming Language :: Python", "Topic :: Software Development" ], "description": "Contents\n========\n\n- `Introduction`_\n- `How to use CompositePage`_\n- `How to write a template`_\n- `How it works`_\n- `Adapting CompositePage to other applications`_\n\n\n\nIntroduction\n============\n\nCompositePage is a way to assemble web pages from page fragments.\nThrough the use of Zope page templates, browser-based drag and drop, and\ncustom context menus, CompositePage makes it easy to visually combine\npage fragments into complete pages.\n\nCompositePage supercedes the PageDesign product and makes use of\nPDLib, a Javascript library. CompositePage is designed for browsers\nthat support the DOM (Document Object Model) and CSS (Cascading Style\nSheets) level 2: Firefox, Internet Explorer 5+, Opera, Konqueror, etc.\n\n\n\nHow to use CompositePage\n========================\n\nFollow these steps:\n\n- Install the CompositePage product in Zope by unpacking the archive\n into your Products directory. I've tested only with a current Zope\n checkout, which is something like Zope 2.7.\n\n- Create a Composite Tool instance in a central location, possibly the\n root folder.\n\n- Create a Composite object. On the creation form, there is a\n checkbox for creating a sample template. Leave the checkbox checked.\n\n- Visit the Composite object and select the \"Design\" tab. You should\n see a three-column layout with blue dotted lines in the places where\n you are allowed to insert content.\n\n- Click just beneath one of the blue lines. A context menu will pop\n up. Select \"Add...\".\n\n- You will be directed to a slot (a folderish object.) In slots, you\n can add composite elements. Add a composite element that points to a\n script.\n\n- Find the composite created earlier and select the \"Design\" tab\n again. Your new object should now show up in the slot.\n\n- Move the object to a different slot using drag and drop. When the\n mouse cursor is hovering over a permitted target (the blue dotted\n lines are targets), the target will be highlighted. Let go and watch\n your object appear in the new place.\n\n- Right-click over your object and select \"Delete\" from the context\n menu.\n\n\nHow to write a template\n=======================\n\nTemplates can be any Zope object, but ZPTs (Zope Page Templates) are\nthe most common. A template designed for use with composites uses the\n'slots' attribute of the composite. The 'slots' attribute is a\nmapping-like object.\n\nHere is a simple composite-aware page template::\n\n \n \n \n \n
\n This will be replaced with one element from one slot.\n
\n \n \n\nThe expression 'here/slots/center/single' gets the 'slots' attribute\nof the composite, finds a slot named 'center', and calls the single()\nmethod of the slot, returning a string containing an HTML structure.\n\nThe only place you have to name a slot is in the template. If the\ntemplate refers to a slot that does not yet exist, the composite will\ncreate and return an empty slot. If you place something in that slot\nusing the drag and drop interface, the composite will transparently\nadd a new slot to the 'filled_slots' folder. Note that Zope prevents\nyou from storing slots with names that start with an underscore or\nthat clash existing folder attributes.\n\nTemplates use either the single() or the multiple() method of a slot.\nsingle() returns a string, while multiple() returns a list of strings.\nUse single() when you expect the slot to never contain more than one\nelement. Use multiple() to allow more than one element. In either\ncase, don't forget to use the ZPT 'structure' keyword, since the\nreturned strings contain HTML that should not be escaped.\n\n``slot`` expressions\n--------------------\n\nYou can also use the special ``slot`` expression type to define\nslots in a template::\n\n \n \n \n \n
\n This will be replaced with elements in the center slot.\n
\n \n \n\nThis syntax allows the template author to define slot titles\nin addition to slot names. The template author could write::\n\n
\n\nThe slot title will be shown to page designers.\n\n\nHow it works\n============\n\nRendering\n---------\n\nWhen you render (view) a composite, it calls its template. When the\ntemplate refers to a slot, the composite looks for the named slot in\nthe filled_slots folder. If it finds the slot, it returns it; if it\ndoesn't find it, the composite creates a temporary empty slot. Then\nthe template calls either the single() or multiple() method and the\nslot renders and returns its contents.\n\n\nRendering in edit mode\n----------------------\n\nWhen requested, the composite calls upon a \"UI\" object to render its\ntemplate and slots with edit mode turned on. In edit mode, slots add\n'class', 'source_path', 'target_path', and 'target_index' attributes\nto HTML tags to mark movable objects and available drop targets.\nSlots add HTML markup for drop targets automatically. When rendering\nusing the single() method, slots provide a drop target only if the\nslot is empty. When rendering using the multiple() method, slots\ninsert drop targets between the elements and to the beginning and end\nof the slot.\n\nThe UI object can use various mechanisms to make the page editable.\nMost UI objects use regular expressions to find the 'head' and 'body'\ntags. Then the UI object inserts scripts, styles, and HTML elements.\nThe result of the transformation is sent back to the browser.\n\n\nDrag and drop\n-------------\n\nAt the bottom of a page rendered in edit mode is a call to the\npd_setupPage() Javascript function. pd_setupPage() searches all of\nthe elements on the page, looking for elements with particular 'class'\nattributes. When it finds a 'slot_element', a handler adds event\nlisteners to that element that react when the user presses the mouse\nbutton in that element. When pd_setupPage() finds a 'slot_target',\nanother handler adds event listeners that react when the user drags\ninto that element.\n\nIf the user releases the mouse while dragging into a target, the\nJavascript code puts the appropriate source paths, target paths, and\ntarget indexes into a hidden form and submits that form to the\ncomposite tool in Zope. The composite tool moves the elements then\nredirects the browser to the original page. The browser loads the\npage in edit mode again and the moved element gets rendered in its new\nspot.\n\n\nContext menus\n-------------\n\nLike drag and drop, context menus depend on pd_setupPage(). When\npd_setupPage() finds a 'slot_element', a handler adds a context menu\nlistener to that element. The context menu listener, when activated,\npositions and displays an otherwise invisible HTML element that looks\njust like a context menu. Once displayed, the user is expected to\neither select an item from the context menu or click outside the\ncontext menu to make it disappear. A similar process exists for\n'slot_target' elements, but a different invisible HTML element is\nused.\n\nJust before popping up a context menu, its contents are filtered using\nJavascript expressions. Some actions are valid only when the user has\nselected at least one item, and other actions are valid only when\nexactly one item item is selected. Filter expressions provide a way\nto express these constraints.\n\n\n\nAdapting CompositePage to other applications\n============================================\n\nCompositePage provides a default user interface that integrates with\nthe Zope management interface, but mechanisms are provided for\nintegrating with any user interface. Look at design.py, the 'common'\nsubdirectory, and the 'zmi' subdirectory for guidance. Simple\ncustomizations probably do not require more code than the ZMI UI.\n\n------------------------------------------------------------\n\n1.1 (2011-07-07)\n----------------\n\n- Plone4 compatibility cleanups:\n\n - Fixed remaining deprecation warnings under Zope 2.12+.\n\n - Import normalization.\n\n - Unit test normalization.\n\n - Header normalization.\n\n\n1.0 (2011-04-30)\n----------------\n\n- Fixed test failures caused by 7 years of changes to Zope and Python.\n This mostly involved simple modernization:\n\n - Use zope.interface, zope.tales, and zope.pagetemplate rather than\n their predecessors.\n\n - Use absolute imports.\n\n - Use Unicode where possible.\n\n- Let's stop swallowing errors that occur when rendering the template\n to get the list of slots. Error messages are friendlier than silent\n breakage.\n\n- Slots now show the add element interface only at the top and bottom\n of the slot, not between elements. (Hmm, should this be configurable?)\n\n\n0.2 (2004-06-16)\n----------------\n\n- Changed the UI to use images for elements and targets.\n\n- Added inline views. You can now select templates to render objects.\n\n- Context menus now have headers.\n\n- The clipboard now works.\n\n- You can now define slots in a template using \"slot:\" expressions.\n This should make it easier to write templates.\n\n- The composite tool now checks copy/paste permissions before making\n any changes.\n\n- Slots now have a __str__ method, making it easy to render them\n directly.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/Products.CompositePage", "keywords": "web application server zope zope2 cmf plone", "license": "ZPL 2.1 (http://www.zope.org/Resources/License/ZPL-2.1)", "maintainer": null, "maintainer_email": null, "name": "Products.CompositePage", "package_url": "https://pypi.org/project/Products.CompositePage/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Products.CompositePage/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/Products.CompositePage" }, "release_url": "https://pypi.org/project/Products.CompositePage/1.1/", "requires_dist": null, "requires_python": null, "summary": "CompositePage product", "version": "1.1" }, "last_serial": 785003, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "847211466bc297b9c2f7c7b79b5144bc", "sha256": "f0857a9cd77748e8e96d1f2acbc9790098709ba3718ba7d24ace0a2ad73b92cf" }, "downloads": -1, "filename": "Products.CompositePage-1.0.tar.gz", "has_sig": false, "md5_digest": "847211466bc297b9c2f7c7b79b5144bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44840, "upload_time": "2011-05-01T05:56:49", "url": "https://files.pythonhosted.org/packages/46/56/69d4d3e792523631665e92b8657011a923f55704534fb89c456e4447df1a/Products.CompositePage-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "94c96633eaa729f9c204bc30cd48d516", "sha256": "b6251c422200b6e74161bb6f7f26f46f9561a0ada73e65f09fccffd837434d7e" }, "downloads": -1, "filename": "Products.CompositePage-1.1.tar.gz", "has_sig": false, "md5_digest": "94c96633eaa729f9c204bc30cd48d516", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46052, "upload_time": "2011-07-07T18:21:34", "url": "https://files.pythonhosted.org/packages/0b/ea/2ebad7687cb7744a1e9f2c449856d574a54fcbf2f9f0297753ee3ff922fa/Products.CompositePage-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "94c96633eaa729f9c204bc30cd48d516", "sha256": "b6251c422200b6e74161bb6f7f26f46f9561a0ada73e65f09fccffd837434d7e" }, "downloads": -1, "filename": "Products.CompositePage-1.1.tar.gz", "has_sig": false, "md5_digest": "94c96633eaa729f9c204bc30cd48d516", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46052, "upload_time": "2011-07-07T18:21:34", "url": "https://files.pythonhosted.org/packages/0b/ea/2ebad7687cb7744a1e9f2c449856d574a54fcbf2f9f0297753ee3ff922fa/Products.CompositePage-1.1.tar.gz" } ] }