[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser - ServiceAdding.py:1.1 add.pt:1.1 configure.zcml:1.5

Gary Poster garyposter@earthlink.net
Sat, 22 Jun 2002 13:16:14 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv1899/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser

Modified Files:
	configure.zcml 
Added Files:
	ServiceAdding.py add.pt 
Log Message:
Small changes.

Mucking about with the new creation system, in preparation of deleting the old Addable class, registry, service, et al.  ServiceManager now uses new creation system.  Disabled Container adder in favor of Folder adder (see Container/Views/Browser/configure.zcml for short discussion).

There are a number of issues, from small to large (in my book) that are still to be worked out with the new creation system.  I'm not addressing them, just cleaning up.

Hooked the deletion button in the root folder back up via some zcml (adding a browser page for the deletion ability, which may or may not be kosher).

fixed one zcml zmi_menu error; saw others.


=== Added File Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/ServiceAdding.py ===
##############################################################################
#
# Copyright (c) 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: ServiceAdding.py,v 1.1 2002/06/22 17:16:13 poster Exp $
"""

from Zope.App.OFS.Container.Views.Browser.Adding import Adding
from Zope.App.OFS.Services.ServiceManager.IServiceAdding import IServiceAdding

class ServiceAdding(Adding):
    
    __implements__ = IServiceAdding

=== Added File Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/add.pt ===
<html metal:use-macro="views/standard_macros/page">
<head>
<style metal:fill-slot="headers" type="text/css">

.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="action.html" method="POST">
<table class="TypeListing">

  <caption>Add Content</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
      **   'description'  : the description of the addable type
      -->
    <tbody tal:repeat="info view/addingInfo">

    <tr>

      <td class="Selector">
        <input type="radio" name="type_name"
               tal:attributes="value info/action; id info/action" />
      </td>

      <td class="TypeName">
        <label tal:attributes="for info/action">
          <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/Services/ServiceManager/Views/Browser/configure.zcml 1.4 => 1.5 ===
   </browser:view> 
 
-  <browser:view 
-     permission="Zope.ManageServices" 
-     for="Zope.App.OFS.Services.ServiceManager.IServiceManager."
-     factory=".Adder.">
-
-    <browser:page name="addForm.html"
-                  attribute="index"
-                  />
-    <browser:page name="add.html"
-                  attribute="action"
-                  />
-
-  </browser:view> 
+   <browser:view
+       permission="Zope.ManageServices" 
+       for="Zope.App.OFS.Services.ServiceManager.IServiceManager."
+       name="create"  
+       factory=".ServiceAdding."
+       >
+       <browser:page name="index.html"
+       template="add.pt" />
+       <browser:page name="action.html" attribute="action" />
+   </browser:view>
   
   <browser:view 
      permission="Zope.ManageServices"