[Zope3-checkins] SVN: ldapauth/trunk/browser/ Rename principal source views and templates in browser package to source.*

Roger Ineichen roger at projekt01.ch
Wed Jul 21 17:25:32 EDT 2004


Log message for revision 26661:
  Rename principal source views and templates in browser package to source.*


Changed:
  D   ldapauth/trunk/browser/principals.pt
  D   ldapauth/trunk/browser/principals.py
  A   ldapauth/trunk/browser/source.pt
  A   ldapauth/trunk/browser/source.py
  U   ldapauth/trunk/browser/source.zcml


-=-
Deleted: ldapauth/trunk/browser/principals.pt
===================================================================
--- ldapauth/trunk/browser/principals.pt	2004-07-21 21:18:39 UTC (rev 26660)
+++ ldapauth/trunk/browser/principals.pt	2004-07-21 21:25:32 UTC (rev 26661)
@@ -1,39 +0,0 @@
-<html metal:use-macro="views/standard_macros/view">
-<body>
-<div metal:fill-slot="body">
-  <div metal:define-macro="contents">
-    <table id="sortable" class="listing" summary="Principal listing"
-           i18n:attributes="summary">
-      <thead>
-        <tr>
-          <th><span i18n:translate="">Login Attribute: </span>
-						(<span tal:content="view/getLoginAttribute" tal:omit-tag="">cn</span>=*)</th>
-          <th i18n:translate="">Title</th>
-          <th i18n:translate="">Description</th>
-        </tr>
-      </thead>
-      <tbody>
-        <tr tal:repeat="info python:view.getUserInfos()" >
-          <td>
-					  <span tal:content="python:info['login']">login</span>
-          </td>
-          <td>
-					  <span tal:content="python:info['title']">title</span>
-          </td>
-          <td>
-					  <span tal:content="python:info['description']">description</span>
-          </td>
-        </tr>
-      </tbody>
-    </table>
-  </div>
-  <!-- show the error message -->
-  <div class="page_error"
-       tal:condition="view/error"
-       tal:content="view/error"
-       i18n:translate="">
-    Error message
-  </div>
-</div>
-</body>
-</html>

Deleted: ldapauth/trunk/browser/principals.py
===================================================================
--- ldapauth/trunk/browser/principals.py	2004-07-21 21:18:39 UTC (rev 26660)
+++ ldapauth/trunk/browser/principals.py	2004-07-21 21:25:32 UTC (rev 26661)
@@ -1,66 +0,0 @@
-##############################################################################
-#
-# 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.1 (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.
-#
-##############################################################################
-"""View Class for the Container's Contents view.
-
-$Id: contents.py 25177 2004-06-02 13:17:31Z jim $
-"""
-
-from zope.exceptions import NotFoundError
-from zope.security.proxy import trustedRemoveSecurityProxy
-
-from zope.app import zapi
-from zope.app.size.interfaces import ISized
-from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-from zope.app.publisher.browser import BrowserView
-from zope.app.i18n import ZopeMessageIDFactory as _
-
-from ldapauth.interfaces import ILDAPBasedPrincipalSource
-
-
-class Principals(BrowserView):
-
-    __used_for__ = ILDAPBasedPrincipalSource
-
-    error = ""
-
-    def getUserInfos(self):
-        context = self.context
-        request = self.request
-        infoList = []
-        try:
-            principals = self.context.getPrincipals(name='')
-        except :
-            principals = []
-            self.error = _("Error, No LDAP server or connection found")
-        
-        for principal in principals:
-            info = trustedRemoveSecurityProxy(principal)
-            entry = {}
-            entry['login'] = info.getLogin()
-            entry['title'] = info.title
-            entry['description'] = info.description
-            infoList.append(entry)
-        
-        return infoList
-
-
-    def getLoginAttribute(self):
-        context = self.context
-        try:
-            return context.login_attribute
-        except:
-            return "Lookup Error"
-
-
-    principals = ViewPageTemplateFile('principals.pt')

Copied: ldapauth/trunk/browser/source.pt (from rev 26660, ldapauth/trunk/browser/principals.pt)

Copied: ldapauth/trunk/browser/source.py (from rev 26660, ldapauth/trunk/browser/principals.py)
===================================================================
--- ldapauth/trunk/browser/principals.py	2004-07-21 21:18:39 UTC (rev 26660)
+++ ldapauth/trunk/browser/source.py	2004-07-21 21:25:32 UTC (rev 26661)
@@ -0,0 +1,66 @@
+##############################################################################
+#
+# 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.1 (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.
+#
+##############################################################################
+"""View Class for the Container's Contents view.
+
+$Id: contents.py 25177 2004-06-02 13:17:31Z jim $
+"""
+
+from zope.exceptions import NotFoundError
+from zope.security.proxy import trustedRemoveSecurityProxy
+
+from zope.app import zapi
+from zope.app.size.interfaces import ISized
+from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
+from zope.app.publisher.browser import BrowserView
+from zope.app.i18n import ZopeMessageIDFactory as _
+
+from ldapauth.interfaces import ILDAPBasedPrincipalSource
+
+
+class PrincipalSource(BrowserView):
+
+    __used_for__ = ILDAPBasedPrincipalSource
+
+    error = ""
+
+    def getUserInfos(self):
+        context = self.context
+        request = self.request
+        infoList = []
+        try:
+            principals = self.context.getPrincipals(name='')
+        except :
+            principals = []
+            self.error = _("Error, No LDAP server or connection found")
+        
+        for principal in principals:
+            info = trustedRemoveSecurityProxy(principal)
+            entry = {}
+            entry['login'] = info.getLogin()
+            entry['title'] = info.title
+            entry['description'] = info.description
+            infoList.append(entry)
+        
+        return infoList
+
+
+    def getLoginAttribute(self):
+        context = self.context
+        try:
+            return context.login_attribute
+        except:
+            return "Lookup Error"
+
+
+    contents = ViewPageTemplateFile('source.pt')

Modified: ldapauth/trunk/browser/source.zcml
===================================================================
--- ldapauth/trunk/browser/source.zcml	2004-07-21 21:18:39 UTC (rev 26660)
+++ ldapauth/trunk/browser/source.zcml	2004-07-21 21:25:32 UTC (rev 26661)
@@ -19,9 +19,9 @@
          instead of the inherited Contents view from the ocntainer. -->
     <page
         for="ldapauth.interfaces.ILDAPBasedPrincipalSource"
-        name="principals.html"
-        attribute="principals"
-        class=".principals.Principals"
+        name="contents.html"
+        attribute="contents"
+        class=".source.PrincipalSource"
         menu="zmi_views" title="Contents"
         permission="zope.ManageContent"/>
 



More information about the Zope3-Checkins mailing list