[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser - FolderAdder.py:1.2 FolderContents.py:1.2 FolderLimitEdit.py:1.2 LoadedFolderContents.py:1.2 __init__.py:1.2 add.pt:1.2 add_confirmed.pt:1.2 browser.zcml:1.2 contents.pt:1.2 limit.pt:1.2 loaded_folder_contents.pt:1.2 remove_confirmed.pt:1.2
Jim Fulton
jim@zope.com
Mon, 10 Jun 2002 19:28:31 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv17445/lib/python/Zope/App/OFS/Content/Folder/Views/Browser
Added Files:
FolderAdder.py FolderContents.py FolderLimitEdit.py
LoadedFolderContents.py __init__.py add.pt add_confirmed.pt
browser.zcml contents.pt limit.pt loaded_folder_contents.pt
remove_confirmed.pt
Log Message:
Merged Zope-3x-branch into newly forked Zope3 CVS Tree.
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/FolderAdder.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+ Define adder component for folders.
+
+$Id$
+"""
+
+from Zope.App.OFS.Container.Views.Browser.Adder import ContainerAdder
+
+class FolderAdder(ContainerAdder):
+ """No apparent need for this class ;-)
+ """
+
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/FolderContents.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+ Define view component for folder contents.
+
+$Id$
+"""
+
+import os
+
+from Zope.App.PageTemplate import ViewPageTemplateFile
+from Zope.App.OFS.Services.ServiceManager.ServiceManager import ServiceManager
+from Zope.App.OFS.Container.Views.Browser.Contents import Contents
+
+class FolderContents(Contents):
+
+ def addServiceManager(self, REQUEST=None):
+ """Create a service manager then add it to the folder."""
+
+ sm = ServiceManager()
+ if self.context.hasServiceManager():
+ raise 'HasServiceManager', (
+ 'This folder already contains a service manager')
+ self.context.setServiceManager(sm)
+ if REQUEST is not None:
+ return self.index(REQUEST)
+
+ index = ViewPageTemplateFile('contents.pt')
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/FolderLimitEdit.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+
+from Zope.App.Formulator.Form import Form
+from Zope.App.PageTemplate import ViewPageTemplateFile
+
+
+class FolderLimitEdit(Form):
+
+ __implements__ = (Form.__implements__,)
+
+ name = 'limitForm'
+ title = 'Folder Item Limit Form'
+ description = ('This edit form allows you to ...')
+
+ _fieldViewNames = ['LimitFieldView']
+
+ template = ViewPageTemplateFile('limit.pt')
+
+
+class FolderLimitXULEdit(Form):
+
+ __implements__ = (Form.__implements__,)
+
+ name = 'limitForm'
+ title = 'Folder Item Limit Form'
+ description = ('This edit form allows you to ...')
+
+ _fieldViewNames = ['XULLimitFieldView']
+
+ template = ViewPageTemplateFile('limit_xul.pt')
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/LoadedFolderContents.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+ Define view component for loaded folder contents.
+
+$Id$
+"""
+
+from Zope.App.PageTemplate import ViewPageTemplateFile
+from FolderContents import FolderContents
+
+
+class LoadedFolderContents( FolderContents ):
+
+ index = ViewPageTemplateFile( 'loaded_folder_contents.pt' )
+
+
+ # OrderedFolder functionality
+
+ def moveObjectsUp(self, ids, REQUEST = None):
+ '''See interface IOrderedContainer'''
+ self.context.moveObjectsUp(ids)
+
+ if REQUEST is not None:
+ # for unit tests
+ REQUEST.getResponse().redirect(REQUEST.getURL(1))
+
+
+ def moveObjectsDown(self, ids, REQUEST = None):
+ '''See interface IOrderedContainer'''
+ self.context.moveObjectsDown(ids)
+
+ if REQUEST is not None:
+ # for unit tests
+ REQUEST.getResponse().redirect(REQUEST.getURL(1))
+
+
+ def moveObjectsToTop(self, ids, REQUEST = None):
+ '''See interface IOrderedContainer'''
+ self.context.moveObjectsToTop(ids)
+
+ if REQUEST is not None:
+ # for unit tests
+ REQUEST.getResponse().redirect(REQUEST.getURL(1))
+
+
+ def moveObjectsToBottom(self, ids, REQUEST = None):
+ '''See interface IOrderedContainer'''
+ self.context.moveObjectsToBottom(ids)
+
+ if REQUEST is not None:
+ # for unit tests
+ REQUEST.getResponse().redirect(REQUEST.getURL(1))
+
+
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/__init__.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/add.pt 1.1 => 1.2 ===
+<head>
+<style metal:fill-slot="headers" type="text/css">
+.TypeListing {
+ width: 100%;
+}
+
+.Selector {
+ width: 10px;
+}
+
+.TypeIcon {
+ width: 20px;
+}
+
+.TypeName {
+ text-align: left;
+}
+
+.TypeDescription {
+ text-align: left;
+ font-style: italic;
+}
+</style>
+</head>
+<body>
+
+<div metal:fill-slot="body">
+
+<form action="add.html" method="POST">
+<table class="TypeListing">
+
+ <caption>Add Content To Folder</caption>
+
+ <tr>
+ <td class="Selector"><br /></td>
+ <th class="TypeName">Title</th>
+ </tr>
+
+ <!--
+ ** listAddableInfo returns a sequence of mappings, containing:
+ ** 'id' : the ID of the addable type
+ ** 'title' : the title of the addable type
+ ** 'desc' : the description of the addable type
+ ** 'icon' : the absolute URL of the icon, for the addable type
+ (may be None)
+ -->
+ <tbody tal:repeat="info view/listAddableInfo">
+
+ <tr>
+
+ <td class="Selector">
+ <input type="radio" name="type_name"
+ tal:attributes="value info/id; id info/id" />
+ </td>
+
+ <td class="TypeName">
+ <label tal:attributes="for info/id">
+ <img alt="Folder" src="../../ZMI/www/folder_icon.gif"
+ tal:condition="info/icon"
+ tal:attributes="src info/icon" />
+ <span tal:replace="info/title">Folder</span>
+ </label>
+ </td>
+
+ </tr>
+
+ <tr>
+ <td class="Selector"><br /></td>
+ <td class="TypeDescription" tal:content="info/description">
+ Folders are generic containers for content, including other
+ folders.
+ </td>
+ </tr>
+
+ </tbody>
+
+ <tbody tal:condition="nothing">
+
+ <tr>
+
+ <td class="Selector">
+ <input type="radio" name="type_name" value="" />
+
+ </td>
+
+ <td class="TypeName">
+ <img alt="Folder" src="../../ZMI/www/document_icon.gif" />
+ Document
+ </td>
+
+ </tr>
+
+ <tr>
+ <td class="Selector"><br /></td>
+ <td class="TypeDescription">
+ Documents are simple textual content.
+ </td>
+ </tr>
+
+ </tbody>
+
+ <tr>
+ <td><br/></td>
+ <td><input type="text" name="id" />
+ <input type="submit" value=" Add " />
+ </td>
+ </tr>
+
+</table>
+</form>
+</div>
+</body>
+</html>
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/add_confirmed.pt 1.1 => 1.2 ===
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<!--
+ metal:use-macro="presentation/standard_macros/html">
+ -->
+<body>
+
+<p> Object added successfully. </p>
+
+</body>
+</html>
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/browser.zcml 1.1 => 1.2 ===
+ xmlns='http://namespaces.zope.org/zope'
+ xmlns:security='http://namespaces.zope.org/security'
+ xmlns:browser='http://namespaces.zope.org/browser'
+>
+
+ <!-- Folder View Directives -->
+
+ <browser:defaultView
+ for="Zope.App.OFS.Content.Folder.Folder.IFolder."
+ name="index.html" />
+
+ <browser:view
+ for="Zope.App.OFS.Content.Folder.Folder.IFolder."
+ permission="Zope.ManageContent"
+ factory=".FolderContents.">
+
+ <browser:page name="index.html"
+ attribute="index"
+ />
+ <browser:page name="addServiceManager.html"
+ attribute="addServiceManager"
+ />
+ </browser:view>
+
+ <browser:view
+ for="Zope.App.OFS.Content.Folder.Folder.IFolder."
+ permission="Zope.ManageContent"
+ factory=".FolderAdder." >
+
+ <browser:page name="addForm.html"
+ attribute="index"
+ />
+ <browser:page name="add.html"
+ attribute="action"
+ />
+ </browser:view>
+
+
+ <!-- Loaded Folder View Directives -->
+
+ <browser:defaultView
+ for="Zope.App.OFS.Content.Folder.LoadedFolder.ILoadedFolder."
+ name="index.html" />
+
+ <browser:view
+ for="Zope.App.OFS.Content.Folder.LoadedFolder.ILoadedFolder."
+ permission="Zope.View"
+ factory=".LoadedFolderContents.">
+
+ <browser:page name="index.html"
+ attribute="index"
+ />
+ </browser:view>
+
+ <browser:view
+ for="Zope.App.OFS.Container.IContainerLimit."
+ permission="Zope.ManageContent"
+ factory=".FolderLimitEdit.">
+
+ <browser:page name="FolderLimitEditForm.html"
+ attribute="index"
+ />
+ <browser:page name="SetFolderLimit.html"
+ attribute="action"
+ />
+ </browser:view>
+
+ <browser:view name="LimitFieldView"
+ for="Zope.App.OFS.Container.IContainerLimit."
+ factory="Zope.App.OFS.Content.Folder.LoadedFolderFields.LimitField.
+ Zope.App.Formulator.Widgets.Browser.TextWidget." />
+
+</zopeConfigure>
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/contents.pt 1.1 => 1.2 ===
+<head>
+<style metal:fill-slot="headers" type="text/css">
+<!--
+.ContentListing {
+ width: 100%;
+}
+
+.ContentIcon {
+ width: 20px;
+}
+
+.ContentTitle {
+ text-align: left;
+}
+-->
+</style>
+</head>
+<body>
+<div metal:fill-slot="body">
+
+<form action="@@index.html" method="get">
+ <table class="ContentListing">
+
+ <caption>Folder Contents
+ <a href="@@addForm.html"> Add... </a> </caption>
+
+ <tbody>
+
+ <tr>
+ <td class="ContentIcon"><br /> </td>
+ <th class="ContentTitle">Title</th>
+ </tr>
+
+ <!--
+ ** listContentInfo returns a sequence of mappings, containing:
+ ** 'id' : the ID of the contained within the container
+ ** 'url' : the absolute URL of the contained object
+ ** 'title' : the title of the contained object
+ ** 'icon' : the absolute URL of the icon, for the contained object
+ (may be None)
+ -->
+ <tr tal:repeat="info view/listContentInfo">
+
+ <td class="ContentSelect">
+ <input type="checkbox" name="ids:list" value="id"
+ tal:attributes="value info/id" />
+ </td>
+
+ <td class="ContentIcon">
+ <img alt="Folder" src="../../ZMI/www/folder_icon.gif"
+ tal:condition="info/icon"
+ tal:attributes="src info/icon" />
+ </td>
+
+ <td class="ContentTitle">
+ <a href="subfolder_id"
+ tal:attributes="href string:${info/url}"
+ tal:content="info/title"
+ >Folder Title or ID here</a>
+ </td>
+
+ </tr>
+
+ <tr tal:condition="nothing">
+
+ <td class="ContentIcon">
+ <img alt="Document" src="../../ZMI/www/document_icon.gif" />
+ </td>
+
+ <td class="ContentTitle">
+ <a href="document_id">Document Title or ID here</a>
+ </td>
+
+ </tr>
+ </tbody>
+
+ </table>
+ <br />
+
+ <input type="submit" name="removeObjects:method" value="Delete"
+ i18n:attributes="value string:menu_delete_button">
+</form>
+
+<p><a href="./++etc++Services/"
+ tal:condition="context/hasServiceManager">Services</a>
+<a href="@@addServiceManager.html"
+ tal:condition="not: context/hasServiceManager">Allow Services</a>
+</p>
+</div>
+</body>
+</html>
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/limit.pt 1.1 => 1.2 ===
+ <head>
+ <style metal:fill-slot="headers" type="text/css">
+ <!--
+ .ContentIcon {
+ width: 20px;
+ }
+
+ .ContentTitle {
+ text-align: left;
+ }
+ -->
+ </style>
+ </head>
+
+ <body>
+ <div metal:fill-slot="body">
+
+
+ <p tal:content="context/msg"
+ tal:condition="python: hasattr(context, 'msg')">
+ Message will go here.
+ </p>
+
+ <p tal:content="view/description">
+ Description of the Form.
+ </p>
+
+
+ <div tal:condition="python: options.has_key('errors') and options['errors']">
+ Errors:
+ <div tal:repeat="error options/errors | nothing"
+ tal:content="error">Foo </div>
+ </div>
+
+ <form action="SetFolderLimit.html" method="post">
+
+ <table class="EditTable">
+ <tbody>
+
+ <tr tal:repeat="fieldView python:view.getFieldViews(request)">
+ <th class="EditAttributeName"
+ tal:content="python: fieldView.context.getValue('title')">Title</th>
+ <td class="EditAttributeValue"
+ tal:content="structure fieldView/render"><input />
+ </td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <input type="submit" name="edit" value="Save Changes">
+
+ </form>
+
+ </div>
+ </body>
+</html>
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/loaded_folder_contents.pt 1.1 => 1.2 ===
+<head>
+<style metal:fill-slot="headers" type="text/css">
+<!--
+.ContentListing {
+ width: 100%;
+}
+
+.ContentIcon {
+ width: 20px;
+}
+
+.ContentTitle {
+ text-align: left;
+}
+-->
+</style>
+</head>
+<body>
+<div metal:fill-slot="body">
+
+<form action="@@index.html" method="post">
+ <table class="ContentListing">
+
+ <caption>Folder Contents
+ <a href="@@addForm.html"> Add... </a> </caption>
+
+ <tbody>
+
+ <tr>
+ <td class="ContentIcon"><br /> </td>
+ <th class="ContentTitle">Title</th>
+ <th class="ContentTitle">Order</th>
+ </tr>
+
+ <!--
+ ** listContentInfo returns a sequence of mappings, containing:
+ ** 'id' : the ID of the contained within the container
+ ** 'url' : the absolute URL of the contained object
+ ** 'title' : the title of the contained object
+ ** 'icon' : the absolute URL of the icon, for the contained object
+ (may be None)
+ -->
+ <tr tal:repeat="info view/listContentInfo">
+
+ <td class="ContentSelect">
+ <input type="checkbox" name="ids:list" value="id"
+ tal:attributes="value info/id" />
+ </td>
+
+ <td class="ContentIcon">
+ <img alt="Folder" src="../../ZMI/www/folder_icon.gif"
+ tal:condition="info/url"
+ tal:attributes="src info/url" />
+ </td>
+
+ <td class="ContentTitle">
+ <a href="subfolder_id"
+ tal:attributes="href string:../${info/url}"
+ tal:content="info/title"
+ >Folder Title or ID here</a>
+ </td>
+ <td>
+ <a href="" tal:attributes="href string:moveObjectsUp?ids=${info/id}">
+ up</a> |
+ <a href="" tal:attributes="href string:moveObjectsDown?ids=${info/id}">
+ down</a> |
+ <a href="" tal:attributes="href string:moveObjectsToTop?ids=${info/id}">
+ top</a> |
+ <a href="" tal:attributes="href string:moveObjectsToBottom?ids=${info/id}">
+ bottom</a> |
+ </td>
+ </tr>
+
+ <tr tal:condition="nothing">
+
+ <td class="ContentIcon">
+ <img alt="Document" src="../../ZMI/www/document_icon.gif" />
+ </td>
+
+ <td class="ContentTitle">
+ <a href="document_id">Document Title or ID here</a>
+ </td>
+ </tr>
+ </tbody>
+
+ </table>
+ <br />
+
+ <input type="submit" name="removeObjects:method" value="Delete"
+ i18n:attributes="value string:menu_delete_button">
+ <input type="submit" name="moveObjectsUp:method" value="Move Up" />
+ <input type="submit" name="moveObjectsDown:method" value="Move Down" />
+ <input type="submit" name="moveObjectsToTop:method" value="Move To Top" />
+ <input type="submit" name="moveObjectsToBottom:method" value="Move To Bottom" />
+</form>
+
+</div>
+</body>
+</html>
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/remove_confirmed.pt 1.1 => 1.2 ===
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<!--
+ metal:use-macro="presentation/standard_macros/html">
+ -->
+<body>
+
+<p> Object(s) removed successfully. </p>
+
+</body>
+</html>