[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - configure.zcml:1.57.2.1 field.py:1.10.2.1 add_module.pt:NONE edit_module.pt:NONE module.py:NONE

Jim Fulton jim@zope.com
Mon, 30 Jun 2003 07:16:19 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/services
In directory cvs.zope.org:/tmp/cvs-serv6099/src/zope/app/browser/services

Modified Files:
      Tag: fdrake-local-modules-branch
	configure.zcml field.py 
Removed Files:
      Tag: fdrake-local-modules-branch
	add_module.pt edit_module.pt module.py 
Log Message:
Checkpointing to branch. Will make detailed comments in merge.


=== Zope3/src/zope/app/browser/services/configure.zcml 1.57 => 1.57.2.1 ===
--- Zope3/src/zope/app/browser/services/configure.zcml:1.57	Thu Jun 26 10:51:03 2003
+++ Zope3/src/zope/app/browser/services/configure.zcml	Mon Jun 30 07:15:48 2003
@@ -363,32 +363,7 @@
       permission="zope.ManageServices"
       />
 
-<!-- Persistent Modules -->
-
-  <page 
-      name="edit.html" 
-      for="zodb.code.interfaces.IPersistentModuleManager"
-      menu="zmi_views" title="Edit"
-      class="zope.app.browser.services.module.EditModule"
-      template="edit_module.pt" 
-      permission="zope.ManageServices"
-      />
-
-  <view for="zope.app.interfaces.container.IAdding"
-        name="Module"
-        class="zope.app.browser.services.module.AddModule"
-        permission="zope.ManageServices"
-        >
-      <page name="index.html" template="add_module.pt" />
-      <page name="action.html" attribute="action" />
-  </view>
-
-  <menuItem 
-      menu="add_component" 
-      for="zope.app.interfaces.container.IAdding"
-      action="Module"  
-      title="Module" 
-      />
+<!-- Persistent Modules --> <include package="./module" />
 
 <!-- PageFolder -->
 


=== Zope3/src/zope/app/browser/services/field.py 1.10 => 1.10.2.1 ===
--- Zope3/src/zope/app/browser/services/field.py:1.10	Wed Jun 25 17:18:53 2003
+++ Zope3/src/zope/app/browser/services/field.py	Mon Jun 30 07:15:48 2003
@@ -55,154 +55,6 @@
         url += "/@@SelectedManagementView.html"
         return '<a href="%s">%s</a>' % (url, path)
 
-class ComponentLocationWidget(Widget, BrowserView):
-
-    implements(IBrowserWidget)
-
-    # Names used:
-    #
-    #  name.p  the value of the path
-    #  name.d  the value of the dotted module name
-
-    def haveData(self):
-        # do I have name.p xor name.m ?
-        form = self.request.form
-
-        has_p = self.name+'.p' in form
-        has_d = self.name+'.d' in form
-
-        return bool((has_p or has_d) and not (has_p and has_d))
-
-    def getData(self, optional=0):
-        field = self.context
-        form = self.request.form
-        name_p = self.name+'.p'
-        name_d = self.name+'.d'
-
-        path = form.get(self.name+'.p', '').strip()
-        dottedname = form.get(self.name+'.d', '').strip()
-
-        if path and not path.startswith('/'):
-            raise WidgetInputError(
-                self.context.__name__, self.title,
-                'The component path must start with a "/"')
-
-        if dottedname and '/' in dottedname:
-            raise WidgetInputError(
-                self.context.__name__, self.title,
-                'A dotted module name cannot contain a "/"')
-
-        if path and dottedname:
-            location = ''
-        else:
-            location = path or dottedname
-
-        if not location:
-            if path and dottedname:
-                raise WidgetInputError(
-                        self.context.__name__, self.title,
-                        'Either give a module or select a component')
-            # No user input
-            if field.required and not optional:
-                raise MissingInputError(field.__name__, field.title,
-                                        'the field is required')
-            return field.default
-
-        location = unicode(location)
-
-        if not optional:
-            try:
-                field.validate(location)
-            except ValidationError, v:
-                raise WidgetInputError(self.context.__name__,
-                                       self.title, str(v))
-        return location
-
-    def __call__(self):
-        'See IBrowserWidget'
-        field = self.context
-        form = self.request.form
-        name = self.name
-
-        if self._data is None:  # no data has been set with Widget.setData(),
-                                # so use the data in the form
-
-            path = form.get(name+'.p', '').strip()
-            dottedname = form.get(name+'.d', '').strip()
-
-            if path or dottedname:
-                location = path or dottedname
-                # XXX is validation here really needed?
-                #field.validate(location)
-            else:  # otherwise, use the default
-                location = field.default or ''
-                if location.startswith('/'):
-                    path = location
-                    dottedname = ''
-                else:
-                    dottedname = location
-                    path = ''
-        else:
-            # data has been set with Widget.setData()
-            location = self._data
-            if location.startswith('/'):
-                path = location
-                dottedname = ''
-            else:
-                dottedname = location
-                path = ''
-
-        selectmarkup = renderPathSelect(field.context, field.type,
-                                        name+'.p', path)
-        inputmarkup = '<input type="text" name="%s.d" value="%s">' % (
-                      name, dottedname)
-        HTML = 'path: %s<br />dotted name: %s' % (selectmarkup, inputmarkup)
-        return HTML
-
-    def hidden(self):
-        'See IBrowserWidget'
-        if self._data is None:
-            data = self.getData(1)
-        else:
-            data = self._data
-
-        if not data:
-            return ''
-
-        if data.startswith('/'):
-            name = self.name+'.p'
-        else:
-            name = self.name+'.d'
-
-        return '<input type="hidden" name="%s" value=%s />' % (
-               name, quoteattr(data))
-
-    def label(self):
-        return '<label for="%s">%s</label>' % (self.name, self.title)
-
-    def row(self):
-        return '<div class="label">%s</div><div class="field">%s</div>"' % (
-                self.label(), self())
-
-    # --- deprecated methods of IBrowserWidget
-
-    def renderHidden(self, value):
-        'See IBrowserWidget'
-        raise NotImplementedError
-
-    def render(self, value):
-        'See IBrowserWidget'
-        raise NotImplementedError
-
-class ComponentLocationDisplayWidget(ComponentLocationWidget):
-    def __call__(self):
-        if self._data is None:
-            data = self.getData(1)
-        else:
-            data = self._data
-        # location = data
-        return data
-
 def renderPathSelect(context, type, name, selected, empty_message=''):
     service_manager = getServiceManager(context)
     info = service_manager.queryComponent(type)

=== Removed File Zope3/src/zope/app/browser/services/add_module.pt ===

=== Removed File Zope3/src/zope/app/browser/services/edit_module.pt ===

=== Removed File Zope3/src/zope/app/browser/services/module.py ===