Skip to content

/ Zope / gocept svn checkins / Archive / 2005 / 2005-01 / CVS: CMFLinkChecker/skins/linkchecker - portlet_links.pt:1.9

[ << ] [ >> ]

[ CVS: CMFLinkChecker - database.py:1.4 / Christian ... ] [ CVS: pymdb - mdbhelper.c:1.2 pymdb.py:1.2 ... ]

CVS: CMFLinkChecker/skins/linkchecker - portlet_links.pt:1.9
Christian Theune <ct(at)gocept.com>
2005-01-15 19:19:18 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv13736/skins/linkchecker

Modified Files:
	portlet_links.pt 
Log Message:
 - fixing webservice offline mode


=== CMFLinkChecker/skins/linkchecker/portlet_links.pt 1.8 => 1.9 ===
--- CMFLinkChecker/skins/linkchecker/portlet_links.pt:1.8	Mon Jul 26 15:03:22
2004
+++ CMFLinkChecker/skins/linkchecker/portlet_links.pt	Sat Jan 15 19:23:00 2005
(at)(at) -11,6 +11,10 (at)(at)
 
     <link rel="Stylesheet" href="lc_colors.css" type="text/css"/>
 
+    <script lang="JavaScript" tal:content="structure
here/lc_generateJScript">
+    </script>
+    
+
     <div class="portlet" id="portlet-linkchecker" tal:on-error="nothing"
          tal:define="links python:[ x for x in
here.portal_linkchecker.database.byObject(here) if x.state in ['red',
'orange']]"
          tal:condition="links">

CVS: CMFLinkChecker/skins/linkchecker - lc_generateJScript.py:1.1
Christian Theune <ct(at)gocept.com>
2005-01-15 20:44:50 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv26321/skins/linkchecker

Added Files:
	lc_generateJScript.py 
Log Message:
 - highlighting feature javascript


=== Added File CMFLinkChecker/skins/linkchecker/lc_generateJScript.py ===
jscript = """
    function highlightBroken() {
        content = getContentArea();
        links = content.getElementsByTagName("a");
        for (i=0;i<links.length;i++) {
            link = links[i];
            link.style.color = link_colors[link.getAttribute('href')];
        }
    }

    registerPloneFunction(highlightBroken);

    link_colors = new Array();
"""

for link in context.portal_linkchecker.database.byObject(context):
    jscript += "link_colors['%s'] = '%s';\n" % (link.url, link.state)

return jscript

CVS: CMFLinkChecker/skins/linkchecker - lc_report_template.pt:1.8
Christian Theune <ct(at)gocept.com>
2005-01-15 21:07:12 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv29870

Modified Files:
	lc_report_template.pt 
Log Message:
 - fixed typo


=== CMFLinkChecker/skins/linkchecker/lc_report_template.pt 1.7 => 1.8 ===
--- CMFLinkChecker/skins/linkchecker/lc_report_template.pt:1.7	Thu Jul 15
22:41:22 2004
+++ CMFLinkChecker/skins/linkchecker/lc_report_template.pt	Sat Jan 15 21:10:55
2005
(at)(at) -92,7 +92,7 (at)(at)
 
 <span i18n:translate="description_report_changes" 
        tal:condition="not:options/member/lc_notify_changes_only">and
contains
-all links in the shown states.</span>
+all links in the shown states.
 </span>
 
 <span i18n:translate="description_report_date">

CVS: CMFLinkChecker - retrievemanager.py:1.4
Christian Theune <ct(at)gocept.com>
2005-01-16 00:41:52 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv26476

Modified Files:
	retrievemanager.py 
Log Message:
  - printing status of site crawl on console


=== CMFLinkChecker/retrievemanager.py 1.3 => 1.4 ===
--- CMFLinkChecker/retrievemanager.py:1.3	Fri Sep 17 15:25:28 2004
+++ CMFLinkChecker/retrievemanager.py	Sun Jan 16 00:45:36 2005
(at)(at) -129,7 +129,11 (at)(at)
         # gather all objects that are of a type we can check for links
         for type in self.listSupportedTypes():
             objects = self.portal_catalog(portal_type=type)
+            os_ = len(objects)
+            i = 0
             for ob in objects:
+                i += 1
+                print i, os_, ob.getPath()
                 ob = ob.getObject()
                 if ob is None:  # Maybe the catalog isn't up to date
                     continue

CVS: CMFLinkChecker - retrievemanager.py:1.5
Christian Theune <ct(at)gocept.com>
2005-01-16 00:52:42 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv27857

Modified Files:
	retrievemanager.py 
Log Message:
 - logging instead of print


=== CMFLinkChecker/retrievemanager.py 1.4 => 1.5 ===
--- CMFLinkChecker/retrievemanager.py:1.4	Sun Jan 16 00:45:36 2005
+++ CMFLinkChecker/retrievemanager.py	Sun Jan 16 00:56:25 2005
(at)(at) -13,6 +13,7 (at)(at)
 from OFS.SimpleItem import SimpleItem
 from AccessControl import ClassSecurityInfo, getSecurityManager
 from Globals import InitializeClass, PersistentMapping
+import zLOG
 
 # CMF/Plone imports
 from Products.CMFCore.CMFCorePermissions import \
(at)(at) -125,7 +126,7 (at)(at)
         """Retrieves the links from all objects in the site."""
         database = self.getParentNode().database
         database.removeAllRegistrations()
-        
+        import pdb; pdb.set_trace() 
         # gather all objects that are of a type we can check for links
         for type in self.listSupportedTypes():
             objects = self.portal_catalog(portal_type=type)
(at)(at) -133,7 +134,8 (at)(at)
             i = 0
             for ob in objects:
                 i += 1
-                print i, os_, ob.getPath()
+                zLOG.LOG("CMFLinkChecker", zLOG.BLATHER, "Site Crawl Status",
+                        "%s of %s (%s)" % (i, os_, ob.getPath()))
                 ob = ob.getObject()
                 if ob is None:  # Maybe the catalog isn't up to date
                     continue

CVS: CMFLinkChecker - retrievemanager.py:1.6
Christian Theune <ct(at)gocept.com>
2005-01-16 00:55:23 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv28316

Modified Files:
	retrievemanager.py 
Log Message:
 - removed pdb :/


=== CMFLinkChecker/retrievemanager.py 1.5 => 1.6 ===
--- CMFLinkChecker/retrievemanager.py:1.5	Sun Jan 16 00:56:25 2005
+++ CMFLinkChecker/retrievemanager.py	Sun Jan 16 00:59:08 2005
(at)(at) -126,7 +126,6 (at)(at)
         """Retrieves the links from all objects in the site."""
         database = self.getParentNode().database
         database.removeAllRegistrations()
-        import pdb; pdb.set_trace() 
         # gather all objects that are of a type we can check for links
         for type in self.listSupportedTypes():
             objects = self.portal_catalog(portal_type=type)

CVS: CMFLinkChecker - retrievemanager.py:1.7
Christian Theune <ct(at)gocept.com>
2005-01-16 01:39:35 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv1602

Modified Files:
	retrievemanager.py 
Log Message:
 - no notifications during crawling


=== CMFLinkChecker/retrievemanager.py 1.6 => 1.7 ===
--- CMFLinkChecker/retrievemanager.py:1.6	Sun Jan 16 00:59:08 2005
+++ CMFLinkChecker/retrievemanager.py	Sun Jan 16 01:43:21 2005
(at)(at) -124,6 +124,8 (at)(at)
     security.declareProtected(ManagePortal, 'retrieveSite')
     def retrieveSite(self):
         """Retrieves the links from all objects in the site."""
+        server = self.getParentNode().database._getWebServiceConnection()
+        server.setClientNotifications(self.database.clientid, False)
         database = self.getParentNode().database
         database.removeAllRegistrations()
         # gather all objects that are of a type we can check for links
(at)(at) -139,8 +141,11 (at)(at)
                 if ob is None:  # Maybe the catalog isn't up to date
                     continue
                 self.retrieveObject(ob)
+            get_transaction().commit(1)
 
         database.cleanUp()
+        self.database.updateAllStatus()
+        server.setClientNotifications(self.database.clientid, True)
 
     def supportsRetrieving(self, object):
         """Tells if the object is supported for retrieving links."""

CVS: CMFLinkChecker - database.py:1.9
Christian Theune <ct(at)gocept.com>
2005-01-16 02:17:08 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv6280

Modified Files:
	database.py 
Log Message:
 - fixed wrong method name indexObject to index


=== CMFLinkChecker/database.py 1.8 => 1.9 ===
--- CMFLinkChecker/database.py:1.8	Sun Jan 16 00:43:29 2005
+++ CMFLinkChecker/database.py	Sun Jan 16 02:20:52 2005
(at)(at) -114,7 +114,6 (at)(at)
         """Registers a link with the webservice. May also register yet
non-registered other links."""
         unregistered = [ x.getObject() for x in self.query(registered=False) ]
 
-        webservice = True
         for link in unregistered:
             # Register with LMS
             try:
(at)(at) -123,7 +122,7 (at)(at)
                 link.registered = True
             except:
                 link.registered = False
-            link.indexObject()
+            link.index()
 
     security.declareProtected(permissions.USE_LINK_MANAGEMENT,
'unregisterLink')
     def unregisterLink(self, link, object):

CVS: CMFLinkChecker/skins/linkchecker - lc_configlet.pt:1.13 lc_configlet_set.py:1.5
Michael Howitz <mh(at)gocept.com>
2005-01-19 10:55:40 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv14414/skins/linkchecker

Modified Files:
	lc_configlet.pt lc_configlet_set.py 
Log Message:
configuration of port and database

=== CMFLinkChecker/skins/linkchecker/lc_configlet.pt 1.12 => 1.13 ===
--- CMFLinkChecker/skins/linkchecker/lc_configlet.pt:1.12	Sat Jan 15 13:32:18
2005
+++ CMFLinkChecker/skins/linkchecker/lc_configlet.pt	Wed Jan 19 10:52:18 2005
(at)(at) -69,10 +69,26 (at)(at)
             <legend i18n:translate="label_web_service_details">Link
Monitor Server</legend>
 
             <div class="field">
-                <label>Client-Id</label>
+                <label>Link Monitor Server Address</label>
 
                 <div class="formHelp" id="web_service_address_help"
                      i18n:translate="description_pref_web_service_address">
+                Enter the address of your link monitor server.
+                </div>
+
+                <input name="webservice"
+                    type="text"
+                    size="30"
+                    tabindex=""
+                    tal:attributes="value lc/database/webservice;
+                                    tabindex tabindex/next;" />
+            </div>
+
+            <div class="field">
+                <label>Client-Id</label>
+
+                <div class="formHelp" id="web_service_clientid_help"
+                    
i18n:translate="description_pref_web_service_clientid">
                 Enter the client id for this Plone instance.
                 </div>
 
(at)(at) -83,6 +99,7 (at)(at)
                     tal:attributes="value lc/database/clientid;
                                     tabindex tabindex/next;" />
             </div>
+
 
             <div class="formControls">
                 <input class="context"


=== CMFLinkChecker/skins/linkchecker/lc_configlet_set.py 1.4 => 1.5 ===
--- CMFLinkChecker/skins/linkchecker/lc_configlet_set.py:1.4	Sat Jan 15
13:32:18 2005
+++ CMFLinkChecker/skins/linkchecker/lc_configlet_set.py	Wed Jan 19 10:52:18
2005
(at)(at) -4,11 +4,12 (at)(at)
 ##bind namespace=
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=defaultURLPrefix, clientid
-##title=set mailhost prefs
+##parameters=defaultURLPrefix, clientid, webservice
+##title=
 ##
 

context.portal_linkchecker.database.configure(defaultURLPrefix=defaultURLPrefix,
-        clientid=clientid)
+                                              clientid=clientid,
+                                              webservice=webservice)
 

context.REQUEST.RESPONSE.redirect('lc_configlet?portal_status_message=Changes+saved.')

CVS: CMFLinkChecker/Extensions - Install.py:1.6
Christian Zagrodnick <cz(at)gocept.com>
2005-01-19 18:25:39 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/Extensions
In directory amy:/tmp/cvs-serv27661/Extensions

Modified Files:
	Install.py 
Log Message:
- does not break when a LinkInfo object exists but the link is not
  known by the server

- broken links portlet looks much nicer nor

- added some bi-directional behaviour: portlet which shows what documents
  are linking to a content object



=== CMFLinkChecker/Extensions/Install.py 1.5 => 1.6 ===
--- CMFLinkChecker/Extensions/Install.py:1.5	Tue Sep 21 15:20:10 2004
+++ CMFLinkChecker/Extensions/Install.py	Wed Jan 19 18:23:10 2005
(at)(at) -40,8 +40,10 (at)(at)
     # XXX add metadata for portal_linkchecker_uid as well
 
     print >> out, "Adding portlet ..."
-    self.left_slots = list(self.left_slots) + \
-        ['here/portlet_links/macros/portlet',]
+    self.left_slots = list(self.left_slots) + [
+        'here/portlet_links/macros/portlet',
+        'here/portlet_linksToMe/macros/portlet',
+    ]
 
     print >> out, "Adding configlets ..."
     # Register configlet

CVS: CMFLinkChecker/skins/linkchecker - portlet_links.pt:1.12
Christian Zagrodnick <cz(at)gocept.com>
2005-01-20 13:42:51 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv32715/skins/linkchecker

Modified Files:
	portlet_links.pt 
Log Message:
fixed translation catalog

added some translations


=== CMFLinkChecker/skins/linkchecker/portlet_links.pt 1.11 => 1.12 ===
--- CMFLinkChecker/skins/linkchecker/portlet_links.pt:1.11	Thu Jan 20 12:58:06
2005
+++ CMFLinkChecker/skins/linkchecker/portlet_links.pt	Thu Jan 20 13:47:08 2005
(at)(at) -1,6 +1,6 (at)(at)
 <html xmlns:tal="http://xml.zope.org/namespaces/tal"
       xmlns:metal="http://xml.zope.org/namespaces/metal"
-      i18n:domain="plone">
+      i18n:domain="linkchecker">
 
 <body>
 
(at)(at) -44,14 +44,21 (at)(at)
 
           <div class="portletContent">
             <ul>
-              <li>
-                <span class="red">Red</span> links are not
available and are unlikely to be available
-                again without your intervention.
+              <li> 
+                <span class="red"
i18n:translate="explain_red_word1">Red</span>
+                <span i18n:translate="explain_red_sentence">
+                  links are not available and are unlikely to be available
+                  again without your intervention.
+                </span>
               </li>
               <li>
-                <span class="orange">Orange</span> link are
temporarily not available and may be available 
-                at a later time without your intervention.
+                <span class="orange"
i18n:translate="explain_orange_word1">Orange</span>
+                <span i18n:translate="explain_orange_sentence">
+                  links are temporarily not available but may be available 
+                  at a later time without your intervention.
+                </span>
               </li>
+             </ul>
           </div>
         </div>
     </div>

CVS: CMFLinkChecker - LinkCheckerTool.py:1.47
Michael Howitz <mh(at)gocept.com>
2005-01-20 16:01:04 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv28141

Modified Files:
	LinkCheckerTool.py 
Log Message:
document action for linksToMe

=== CMFLinkChecker/LinkCheckerTool.py 1.46 => 1.47 ===
--- CMFLinkChecker/LinkCheckerTool.py:1.46	Thu Jan 20 12:58:06 2005
+++ CMFLinkChecker/LinkCheckerTool.py	Thu Jan 20 16:05:18 2005
(at)(at) -62,8 +62,16 (at)(at)
                                  category='portal_tabs',
                                  permissions=('Manage portal',),
                                  visible=1,
-                                
action=Expression(text='string:${portal_url}/lc_balanced_score_card'))]
-
+                                
action=Expression(text='string:${portal_url}/lc_balanced_score_card')),
+                ActionInformation(id='linkchecker_linksToMe',
+                                  title='Document is referenced',
+                                  category='folder_contents',
+                                 
permissions=(permissions.USE_LINK_MANAGEMENT, ),
+                                  visible=1,
+                                  condition='python: object.lc_linksToMe()',
+                                  action=Expression(text='')),
+                ]
+                
     #
     # ZMI methods
     #

CVS: CMFLinkChecker - LinkCheckerTool.py:1.48
Michael Howitz <mh(at)gocept.com>
2005-01-20 16:22:31 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv32054

Modified Files:
	LinkCheckerTool.py 
Log Message:
[Document is referenced] is now not more a link

=== CMFLinkChecker/LinkCheckerTool.py 1.47 => 1.48 ===
--- CMFLinkChecker/LinkCheckerTool.py:1.47	Thu Jan 20 16:05:18 2005
+++ CMFLinkChecker/LinkCheckerTool.py	Thu Jan 20 16:26:48 2005
(at)(at) -69,7 +69,7 (at)(at)
                                  
permissions=(permissions.USE_LINK_MANAGEMENT, ),
                                   visible=1,
                                   condition='python: object.lc_linksToMe()',
-                                  action=Expression(text='')),
+                                  action=Expression(text='python:None')),
                 ]
                 
     #

CVS: CMFLinkChecker/skins/linkchecker - portlet_linksToMe.pt:1.3
Christian Zagrodnick <cz(at)gocept.com>
2005-01-21 17:41:48 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv31464/skins/linkchecker

Modified Files:
	portlet_linksToMe.pt 
Log Message:
german translation


=== CMFLinkChecker/skins/linkchecker/portlet_linksToMe.pt 1.2 => 1.3 ===
--- CMFLinkChecker/skins/linkchecker/portlet_linksToMe.pt:1.2	Thu Jan 20
12:58:06 2005
+++ CMFLinkChecker/skins/linkchecker/portlet_linksToMe.pt	Fri Jan 21 17:46:09
2005
(at)(at) -1,6 +1,6 (at)(at)
 <html xmlns:tal="http://xml.zope.org/namespaces/tal"
       xmlns:metal="http://xml.zope.org/namespaces/metal"
-      i18n:domain="plone">
+      i18n:domain="linkchecker">
 
 <body>

CVS: CMFLinkChecker/i18n - linkchecker-de.po:1.12
Christian Zagrodnick <cz(at)gocept.com>
2005-01-21 17:42:19 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/i18n
In directory amy:/tmp/cvs-serv31464/i18n

Modified Files:
	linkchecker-de.po 
Log Message:
german translation


=== CMFLinkChecker/i18n/linkchecker-de.po 1.11 => 1.12 ===
--- CMFLinkChecker/i18n/linkchecker-de.po:1.11	Thu Jan 20 13:47:08 2005
+++ CMFLinkChecker/i18n/linkchecker-de.po	Fri Jan 21 17:46:09 2005
(at)(at) -587,4 +587,6 (at)(at)
 msgid "explain_orange_sentence"
 msgstr "Links sind vorrübergehend nicht zu erreichen sie können jedoch ohne
Ihr Zutun später wieder erreichbar sein."
 
+msgid "label_linksToMe"
+msgstr "Referenziert von"

CVS: CMFLinkChecker/Extensions - Install.py:1.7
Christian Zagrodnick <cz(at)gocept.com>
2005-01-24 08:38:15 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/Extensions
In directory amy:/tmp/cvs-serv3329/Extensions

Modified Files:
	Install.py 
Log Message:
clean ups

installing action icon


=== CMFLinkChecker/Extensions/Install.py 1.6 => 1.7 ===
--- CMFLinkChecker/Extensions/Install.py:1.6	Wed Jan 19 18:23:10 2005
+++ CMFLinkChecker/Extensions/Install.py	Mon Jan 24 08:42:55 2005
(at)(at) -1,12 +1,6 (at)(at)
-##############################################################################
-#
-# Copyright (c) 2003 gocept gmbh & co. kg. All rights reserved.
-#
+# Copyright (c) 2003-2005 gocept gmbh & co. kg
 # See also LICENSE.txt
-#
-##############################################################################
-"""CMF link checker tool
-$Id$"""
+# $Id$
 
 from Products.CMFLinkChecker.LinkCheckerTool import LinkCheckerTool
 from Products.CMFCore.utils import getToolByName
(at)(at) -18,6 +12,19 (at)(at)
 
 from Products.CMFFormController.globalVars import ANY_BUTTON, ANY_CONTEXT
 
+
+def installActionIcon(self, icon_tuple):
+    ai = getToolByName(self, 'portal_actionicons')
+    cat = icon_tuple[0]
+    act_id = icon_tuple[1]
+    try:
+        ai.removeActionIcon(cat, act_id)
+    except KeyError:
+        # icon is not registered, ignore
+        pass
+    ai.addActionIcon(*icon_tuple)
+
+
 def install(self):
     out=StringIO()
 
(at)(at) -32,13 +39,14 (at)(at)
         add_provider=1, REQUEST=None)
 
     print >> out, "Adding portal tool ..."
-    self.manage_addProduct['CMFLinkChecker'].manage_addTool(
-        type='CMF Linkchecker Tool')
+    if 'portal_linkchecker' not in self.objectIds():
+        self.manage_addProduct['CMFLinkChecker'].manage_addTool(
+                                                type='CMF Linkchecker Tool')
 
     print >> out, "Adding catalog index ..."
     self.portal_catalog.addIndex("portal_linkchecker_uid", "FieldIndex")
-    # XXX add metadata for portal_linkchecker_uid as well
-
+    self.portal_catalog.reindexIndex('portal_linkchecker_uid', self.REQUEST)
+    
     print >> out, "Adding portlet ..."
     self.left_slots = list(self.left_slots) + [
         'here/portlet_links/macros/portlet',
(at)(at) -126,6 +134,13 (at)(at)
     pfc.addFormAction('newsitem_edit', 'success', ANY_CONTEXT, ANY_BUTTON, 
                         "traverse_to", "string:document_updatelinks")
 
+
+
+    print >>out, 'Installin action icon'
+    installActionIcon(self, ('plone', 'linkchecker_linksToMe',
+                             'linkchecker.png', 'referenced'))
+
+
     print >> out, 'Successfully installed CMFLinkChecker'
 
     return out.getvalue()
(at)(at) -158,15 +173,6 (at)(at)
     self._delProperty('lc_status')
     self._delProperty('lc_frequency')
 
-    print >>out, "Cleaning skins ..."
-    skins = self.portal_skins.getSkinSelections()
-    for skin in skins:
-        path = self.portal_skins.getSkinPath(skin)
-        path = map(string.strip, path.split(','))
-        path = [ x for x in path if x != 'linkchecker']
-        path = ','.join(path)
-        self.portal_skins.addSkinSelection(skin, path)
-
     print >>out, "Removing form_controller registrations ..."
     # Argh. The API is incomplete / awkward.
     
(at)(at) -182,6 +188,5 (at)(at)
     delete = self.portal_form_controller.actions.delete
     for key in keys:
         delete(key)
-
 
     return out.getvalue()

CVS: CMFLinkChecker/skins/linkchecker - lc_linksToMe.py:1.2
Christian Zagrodnick <cz(at)gocept.com>
2005-01-24 08:39:00 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv3584/skins/linkchecker

Modified Files:
	lc_linksToMe.py 
Log Message:
do not fail if use does not have enough permissions


=== CMFLinkChecker/skins/linkchecker/lc_linksToMe.py 1.1 => 1.2 ===
--- CMFLinkChecker/skins/linkchecker/lc_linksToMe.py:1.1	Wed Jan 19 18:23:10
2005
+++ CMFLinkChecker/skins/linkchecker/lc_linksToMe.py	Mon Jan 24 08:43:44 2005
(at)(at) -2,13 +2,24 (at)(at)
 
 lc = getToolByName(context, 'portal_linkchecker')
 
+if not lc.isUserAllowed():
+    return []
+
 url = lc.resolveRelativeLink(context.getId(), context)
 brains = lc.database.query(url=url)
 
-objects = []
+object_uids = []
 for b in brains:
-    objects.extend(b.objects)
+    object_uids.extend(b.objects)
 
-objects = [ lc.getObjectForUID(uid) for uid in objects ]
+objects = []
+for uid in object_uids:
+    try:
+        obj = lc.getObjectForUID(uid)
+    except KeyError:
+        # not registered
+        pass
+    else:
+        objects.append(obj)
 
 return objects

CVS: CMFLinkChecker - retrievemanager.py:1.9
Christian Zagrodnick <cz(at)gocept.com>
2005-01-24 08:39:34 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv3715

Modified Files:
	retrievemanager.py 
Log Message:
do not fail if no retriever is registered for a portal_type


=== CMFLinkChecker/retrievemanager.py 1.8 => 1.9 ===
--- CMFLinkChecker/retrievemanager.py:1.8	Wed Jan 19 13:42:39 2005
+++ CMFLinkChecker/retrievemanager.py	Mon Jan 24 08:44:17 2005
(at)(at) -162,10 +162,12 (at)(at)
 
     def _getRetrieverForObject(self, object):
         type = object.portal_type
-        if not self._retrievers.has_key:
-            return
-
-        return GlobalRegistry.getByName(self._retrievers[type])
+        retriever_name = self._retrievers.get(type)
+        if retriever_name is None:
+            retriever = None
+        else:
+            retriever = GlobalRegistry.getByName(retriever_name)
+        return retriever 
 
 InitializeClass(RetrieveManager)

CVS: CMFLinkChecker/i18n - plone-de.po:1.5
Christian Zagrodnick <cz(at)gocept.com>
2005-01-24 08:45:47 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/i18n
In directory amy:/tmp/cvs-serv3456/i18n

Modified Files:
	plone-de.po 
Log Message:
translations


=== CMFLinkChecker/i18n/plone-de.po 1.4 => 1.5 ===
--- CMFLinkChecker/i18n/plone-de.po:1.4	Thu Jan 20 13:47:08 2005
+++ CMFLinkChecker/i18n/plone-de.po	Mon Jan 24 08:43:08 2005
(at)(at) -27,3 +27,6 (at)(at)
 
 msgid "lc_object_status"
 msgstr "Links"
+
+msgid "Object is being referenced"
+msgstr "Objekt wird referenziert"

CVS: CMFLinkChecker/Extensions - Install.py:1.8
Christian Zagrodnick <cz(at)gocept.com>
2005-01-26 10:58:36 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/Extensions
In directory amy:/tmp/cvs-serv2056/Extensions

Modified Files:
	Install.py 
Log Message:
my links works again




=== CMFLinkChecker/Extensions/Install.py 1.7 => 1.8 ===
--- CMFLinkChecker/Extensions/Install.py:1.7	Mon Jan 24 08:42:55 2005
+++ CMFLinkChecker/Extensions/Install.py	Wed Jan 26 11:03:36 2005
(at)(at) -45,6 +45,7 (at)(at)
 
     print >> out, "Adding catalog index ..."
     self.portal_catalog.addIndex("portal_linkchecker_uid", "FieldIndex")
+    self.portal_catalog.addColumn("portal_linkchecker_uid")
     self.portal_catalog.reindexIndex('portal_linkchecker_uid', self.REQUEST)
     
     print >> out, "Adding portlet ..."

CVS: CMFLinkChecker/i18n - linkchecker-de.po:1.13
Christian Zagrodnick <cz(at)gocept.com>
2005-01-27 08:31:23 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/i18n
In directory amy:/tmp/cvs-serv7495/i18n

Modified Files:
	linkchecker-de.po 
Log Message:
translations


=== CMFLinkChecker/i18n/linkchecker-de.po 1.12 => 1.13 ===
--- CMFLinkChecker/i18n/linkchecker-de.po:1.12	Fri Jan 21 17:46:09 2005
+++ CMFLinkChecker/i18n/linkchecker-de.po	Thu Jan 27 08:36:30 2005
(at)(at) -590,3 +590,6 (at)(at)
 msgid "label_linksToMe"
 msgstr "Referenziert von"
 
+msgid "Object is being referenced"
+msgstr "Objekt wird referenziert"
+

CVS: CMFLinkChecker - utils.py:1.6
Christian Zagrodnick <cz(at)gocept.com>
2005-01-27 08:40:27 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv8761

Modified Files:
	utils.py 
Log Message:
stripping '..' in paths

made tests working again (wehe, they all pass)


=== CMFLinkChecker/utils.py 1.5 => 1.6 ===
--- CMFLinkChecker/utils.py:1.5	Wed Jan 19 13:42:39 2005
+++ CMFLinkChecker/utils.py	Thu Jan 27 08:45:35 2005
(at)(at) -13,7 +13,7 (at)(at)
 from Products.CMFCore.utils import getToolByName
 
 # Python imports
-from urlparse import urlparse
+from urlparse import urlparse, urlunparse
 from sgmllib import SGMLParseError
 import formatter
 
(at)(at) -39,24 +39,61 (at)(at)
     if url_['scheme'] in ['mailto',]:
         return url
 
-    new_url = ""
     lc = getToolByName(context, "portal_linkchecker")
-    if url_['scheme']:           # Ok, this is a complete URL
+    prefix = lc.database.defaultURLPrefix or context.REQUEST.BASE0
+    prefix_dict = url2dict(prefix)
+        
+    new_url = ""
+    
+    if url_['scheme']:
+        # Url has a protocol specified, i.e. http://
         new_url = url
-    elif url_['netloc']:         # Hmm. There is a host. Let's use http.
+    elif url_['netloc']:
+        # There is no protocol but a host, i.e. "gocept.com/index.html"
+        # We just assume http in this case
         new_url = "http://" + url
-    elif url_['path'].startswith('/'):  # Ok, that's hard. It's an absolute 
-                                      # path, let's use the default prefix 
-                                      # with scheme and netlocation
-                                      # Otherwise the REQUEST information is
fine.
-        y = url2dict(lc.database.defaultURLPrefix)
-        new_url = ((y['scheme']+"://" + y["netloc"]) or context.REQUEST.BASE0)
+ url
-    else:                            # Ok, this path is relative, we just
append either
-                                     # the defaultURLPrefix or the
REQUEST.BASE0 + the
-                                     # current location. ".." are not
resolved.
-        new_url = (lc.database.defaultURLPrefix or context.REQUEST.BASE0) + \
-                  "/".join(context.getPhysicalPath()[:-1]) + "/" + url
+    elif url_['path'].startswith('/'):
+        # The only thing we have is an absolute path. We prepend the Protocol
+        # and host from the configured prefix (or use request if nothing has
+        # been specified)
+        new_url = '%s://%s%s' % (prefix_dict['scheme'],
+                                 prefix_dict['netloc'],
+                                 url)
+    else:
+        # This path seems to be relative. 
+        context_path = '/'.join(context.getPhysicalPath()[:-1])
+        new_url = '%s%s/%s' % (prefix, context_path, url)
+
+    new_url = stripRelativeFromUrl(new_url)
     return new_url
+
+
+def stripRelativeFromUrl(url):
+    # noop so far
+    url_split = list(urlparse(url))
+    
+    path = url_split[2]
+    path = path.split('/')
+    path.reverse()
+    
+    result_path = []
+    skip = 0
+    
+    for element in path:
+        if element == '..':
+            skip += 1
+            continue
+        if skip > 0:
+            skip -= 1
+            continue
+        result_path.append(element)
+    
+    result_path.reverse()
+    path = '/'.join(result_path)
+    url_split[2] = path
+    url = urlunparse(url_split)
+    return url
+
 
 def retrieveSTX(text):
     """Retrieve links from STX data."""

CVS: CMFLinkChecker/Extensions - Install.py:1.9
Christian Zagrodnick <cz(at)gocept.com>
2005-01-27 09:58:57 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/Extensions
In directory amy:/tmp/cvs-serv24545/Extensions

Modified Files:
	Install.py 
Log Message:
removing metadata in uninstall


=== CMFLinkChecker/Extensions/Install.py 1.8 => 1.9 ===
--- CMFLinkChecker/Extensions/Install.py:1.8	Wed Jan 26 11:03:36 2005
+++ CMFLinkChecker/Extensions/Install.py	Thu Jan 27 10:04:05 2005
(at)(at) -157,6 +157,7 (at)(at)
     print >>out, "Removing index ..."
     portal_cat = getToolByName(self, 'portal_catalog')
     portal_cat.delIndex('portal_linkchecker_uid')
+    portal_cat.delColumn('portal_linkchecker_uid')
 
     print >>out, "Removing action provider registration ..."
     portal_actions = getToolByName(self, 'portal_actions')

CVS: CMFLinkChecker/skins/linkchecker - lc_my_dead_links.pt:1.10
Christian Zagrodnick <cz(at)gocept.com>
2005-01-27 10:13:16 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv27384/skins/linkchecker

Modified Files:
	lc_my_dead_links.pt 
Log Message:
major speedup in "my links"

also better display



=== CMFLinkChecker/skins/linkchecker/lc_my_dead_links.pt 1.9 => 1.10 ===
--- CMFLinkChecker/skins/linkchecker/lc_my_dead_links.pt:1.9	Sat Jan 22
15:03:41 2005
+++ CMFLinkChecker/skins/linkchecker/lc_my_dead_links.pt	Thu Jan 27 10:18:14
2005
(at)(at) -18,11 +18,15 (at)(at)
    <h1 i18n:translate="header_broken_links">My broken links</h1>
 
    <p i18n:translate="description_link_overview">
-   Overview of all your broken links and image references.
+    Overview of all your broken links and image references.
    </p>
 
 <tal:block repeat="state python:['red', 'orange', 'grey']">
-<h2 tal:attributes="class state" i18n:translate=""
tal:content="state">red</h2>
+  <h2 tal:attributes="class state" 
+      tal:content="state"
+      i18n:translate="">
+    red
+  </h2>
 
    <table class="listing"
           style="width:90%"
(at)(at) -30,27 +34,50 (at)(at)
           i18n:attributes="summary">
     <thead>
         <tr>
-            <th>&nbsp;<span tal:omit-tag=""
-           
i18n:translate="link_header_link">Link</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
-           
i18n:translate="link_header_reason">Description</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
-            i18n:translate="link_header_update">Last
update</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
i18n:translate="link_header_documents">Documents</span>&nbsp;</th>
+          <th>
+            <span
i18n:translate="link_header_link">Link</span><br />
+            <span
i18n:translate="link_header_description">Description</span>
+          </th>
+          <th i18n:translate="link_header_documents">
+            Documents
+          </th>
         </tr>
     </thead>
 
     <tal:block tal:repeat="link python:links[state]">
         <tr tal:attributes="class python:test(repeat['link'].odd(), 'odd',
'even')">
-            <td style="vertical-align:top;"><a
tal:content="python:here.portal_linkchecker.shortURL(link.url)"
tal:attributes="title link/url;href link/url">http://www.google.de</a></td>
-            <td style="vertical-align:top;" tal:content="link/reason"
i18n:translate="">Unknown</td>
-            <td style="vertical-align:top;"
tal:content="python:here.toPortalTime(link.lastcheck,
long_format=1)">Unknown</td>
-            <td tal:define="docs python:link.getObject().getObjects()">
-                <tal:block repeat="doc docs">
-                   <a tal:attributes="href doc/absolute_url;title
doc/Description" tal:content="doc/Title">asdf</a>
-                   <br/>
-                </tal:block>
-            </td>
+          <td style="vertical-align: top; overflow: hidden;">
+            <p>
+            <a  
+              tal:content="python:here.portal_linkchecker.shortURL(link.url)"
+              tal:attributes="title link/url;
+                              href link/url">
+                              http://www.google.de
+                            
+                            </a>
+                            <br />
+                            
+              <tal:block 
+            tal:content="link/reason" 
+            i18n:translate="">
+            Unknown
+          </tal:block>
+        </p>
+          </td>
+        
+          <td tal:define="doc_uids link/objects;
+                          docs
python:here.portal_catalog(portal_linkchecker_uid=doc_uids)">
+            <tal:block repeat="doc docs">
+              <a class="navItem navLevel1"
+                tal:attributes="href doc/getURL;
+                                title doc/Description" >
+              <img class="navIcon" height="16" widht="16"
+                tal:attributes="src string:$portal_url/${doc/getIcon};
+                                title doc/portal_type;" />
+                 <span class="navItemText"
tal:content="doc/Title">asdf</span>
+              </a>
+            </tal:block>
+          </td>
         </tr>
       </tal:block>

CVS: CMFLinkChecker - reports.py:1.6
Christian Zagrodnick <cz(at)gocept.com>
2005-01-27 14:51:54 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv31713

Modified Files:
	reports.py 
Log Message:
made overviews working

major performance increases


=== CMFLinkChecker/reports.py 1.5 => 1.6 ===
--- CMFLinkChecker/reports.py:1.5	Wed Jan 26 11:03:36 2005
+++ CMFLinkChecker/reports.py	Thu Jan 27 13:32:05 2005
(at)(at) -101,7 +101,7 (at)(at)
 
             mMsg = "To: %s\n" % email
             mMsg = mMsg + "From: %s <%s>\n" % (self.email_from_name,
self.email_from_address) # Portal configuration
-            mMsg = mMsg + "Mime-Version: 1.0\n"
+            mMsg = mMsg + "Mime-Version: 1.0\n"7
             mMsg = mMsg + "Content-Type: text/html; charset=%s\n\n" %
self.portal_properties.site_properties.default_charset
             mMsg = mMsg + mailbody
             mSubj = "Link report for %s o'clock" % hour
(at)(at) -110,6 +110,8 (at)(at)
 
         return "Sent Mails: %s" % mail_count
 
+
+    security.declatePublic('GroupedLinksForAuthenticatedMember')
     def GroupedLinksForAuthenticatedMember(self):
         """Returns a list of links aggregated by state for the current user.
         
(at)(at) -132,66 +134,60 (at)(at)
                         
         return groups
 
-    security.declareProtected(CMFCorePermissions.ManagePortal,
"DocumentsInState")
+    security.declareProtected(CMFCorePermissions.ManagePortal,
+                              'DocumentsInState')
     def DocumentsInState(self, state):
-        """Returns a list of all objects that contain links in the given
state."""
-        database = self.getParentNode().database
-        links = database.query(state=[state,])
-        links = [ x.getObject() for x in links ]
-        links_ = []
+        """Returns a list of all objects that contain links in state
+        """
+        lc = self.getLinkManager()
         documents = {}
-        for link in links:
-            for doc in link.getObjects():
-                key = doc.getPhysicalPath()
-                if not documents.has_key(key):
-                    # Add a new entry for this document
-                    new = documents[key] = {}
-                    new["document"] = doc
-                    new["total"] = len(database.byObject(doc))
-                    new["instate"] = 0
-                    owner = doc.owner_info()["id"]
-                    member = getToolByName(self,
'portal_membership').getMemberById(owner)
-                    if member is None:
-                        new["owner_mail"] = ""
-                        new["owner"] = owner
-                    else:
-                        new["owner_mail"] = member.getProperty("email")
-                        new["owner"] = member.getProperty("fullname", owner)
-                    item = new
+        
+        def _total_links(doc):
+            uid = lc.getUIDForBrain(doc)
+            links = lc.database.query(objects=[uid])
+            return len(links)
+            
+        for link, doc, member in self._document_iterator(state):
+            key = doc.getURL()
+            item = documents.get(key)
+            if item is None:
+                item = documents[key] = {}
+                item['document'] = doc
+                item['total'] = _total_links(doc)
+                item['instate'] = 0
+                if member is None:
+                    item["owner_mail"] = ""
+                    item["owner"] = doc.Creator
                 else:
-                    # Get the old entry
-                    item = documents[key]
+                    item["owner_mail"] = member.getProperty("email")
+                    item["owner"] = member.getProperty("fullname",
doc.Creator)
+
+            item["instate"] += 1
 
-                item["instate"] += 1
         return documents.values()
 
     security.declareProtected(CMFCorePermissions.ManagePortal, "LinksInState")
     def LinksInState(self, state):
         """Returns a list of links in the given state."""
-        database = self.getParentNode().database
 
-        links = database.query(state=[state,])
-        links = [ x.getObject() for x in links ]
-        links_ = []
-        for link in links:
-            for doc in link.getObjects():
-                item = {}
-                item["url"] = link.url
-                item["reason"] = link.reason
-                item["lastcheck"] = link.lastcheck
-                item["document"] = doc
-                owner = doc.owner_info()["id"]
-                member = getToolByName(self,
"portal_membership").getMemberById(owner)
-                if member is None:
-                    item["owner_mail"] = ""
-                    item["owner"] = owner
-                else:
-                    item["owner_mail"] = member.getProperty("email")
-                    item["owner"] = member.getProperty("fullname", owner)
-                links_.append(item)
-        return links_
+        for link, doc, member in self._document_iterator(state):
+            item = {}
+            item["url"] = link.url
+            item["reason"] = link.reason
+            item["lastcheck"] = link.lastcheck
+            item["document"] = doc
+           
+            if member is None:
+                item["owner_mail"] = ""
+                item["owner"] = doc.Creator
+            else:
+                item["owner_mail"] = member.getProperty("email")
+                item["owner"] = member.getProperty("fullname", doc.Creator)
+                
+            yield item
 
-    security.declareProtected(CMFCorePermissions.ManagePortal,
"ManagementOverview")
+    security.declareProtected(CMFCorePermissions.ManagePortal,
+                              'ManagementOverview')
     def ManagementOverview(self):
         """Returns a comprehensive management overview over the complete
site."""
         database = self.getParentNode().database
(at)(at) -258,4 +254,32 (at)(at)
 
         return status
 
+    
+    
+    def _document_iterator(self, state):
+
+        member_cache = {}
+        
+        lc = self.getLinkManager()
+        catalog = getToolByName(self, 'portal_catalog')
+        pms = getToolByName(self, 'portal_membership')
+
+        _marker = object()
+
+        links = lc.database.query(state=[state])
+        result = []
+        for link in links:
+            doc_uids = link.objects
+            if not doc_uids:
+                continue
+            docs = catalog(portal_linkchecker_uid=doc_uids)
+            for doc in docs:
+                creator = doc.Creator
+                member = member_cache.get(creator, _marker)
+                if member is _marker:
+                    member = pms.getMemberById(creator)
+                    member_cache[creator] = member
+                yield link, doc, member
+            
+    
 InitializeClass(BaseReports)

CVS: CMFLinkChecker/skins/linkchecker - lc_all_documents_by_status.pt:1.8 lc_all_links_by_status.pt:1.8
Christian Zagrodnick <cz(at)gocept.com>
2005-01-27 15:06:27 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv31713/skins/linkchecker

Modified Files:
	lc_all_documents_by_status.pt lc_all_links_by_status.pt 
Log Message:
made overviews working

major performance increases


=== CMFLinkChecker/skins/linkchecker/lc_all_documents_by_status.pt 1.7 =>
1.8 ===
--- CMFLinkChecker/skins/linkchecker/lc_all_documents_by_status.pt:1.7	Mon Jul
26 15:03:22 2004
+++ CMFLinkChecker/skins/linkchecker/lc_all_documents_by_status.pt	Thu Jan 27
13:32:05 2005
(at)(at) -13,38 +13,73 (at)(at)
 
    <link rel="Stylesheet" href="lc_colors.css" type="text/css"/>
 
-   <h1 i18n:translate="header_all_documents_in_status">All documents in
state <span i18n:name="state" i18n:translate=""
tal:content="request/link_state"/></h1>
+   <h1 i18n:translate="header_all_documents_in_status">
+     All documents in state
+     <span i18n:name="state" i18n:translate="" 
+       tal:content="request/link_state">
+       red
+     </span>
+   </h1>
 
        <a tal:attributes="href
string:${here/portal_url}/lc_balanced_score_card"
i18n:translate="label_up_to_scorecard" class="link-parent">Up to balanced
score card</a>
 
-   <table class="listing"
+  <table class="listing"
           id="sortable"
           tal:attributes="id string:sortable"
           summary="Link listing"
           i18n:attributes="summary">
     <thead>
         <tr>
-            <th>&nbsp;<span tal:omit-tag=""
-           
i18n:translate="link_header_document">Document</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
-            i18n:translate="link_header_total_links">Number of total
links</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
-            i18n:translate="link_header_links">Number of links in this
state</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
-           
i18n:translate="link_header_owner">Owner</span>&nbsp;</th>
+          <th i18n:translate="link_header_document">
+            Document
+          </th>
+          <th class="red"
+            i18n:translate=""
+              tal:attributes="class request/link_state"
+              tal:content="request/link_state">
+          </th>
+          <th i18n:translate="">
+            total
+          </th>
+          <th i18n:translate="link_header_owner">
+            Owner
+          </th>
         </tr>
     </thead>
 
-    <tal:block repeat="doc
python:here.portal_linkchecker.reports.DocumentsInState(state=request.link_state)">
-        <tr>
-            <td><a tal:content="doc/document/Title"
tal:attributes="href doc/document/absolute_url;title
doc/document/Description">http://www.google.de</a></td>
-            <td tal:content="doc/total">Unknown</td>
-            <td tal:content="doc/instate">Unknown</td>
-            <td><a tal:attributes="href
string:mailto:${doc/owner_mail}"
tal:content="doc/owner">asdf</a></td>
-        </tr>
-    </tal:block>
+    <tr tal:repeat="doc
python:here.portal_linkchecker.reports.DocumentsInState(state=request.link_state)">
+      <td>
+          <a class="navItem navLevel1"
+            tal:attributes="
+              href doc/document/getURL;
+              title doc/document/Description" >
+          <img class="navIcon" height="16" widht="16"
+            tal:attributes="
+              src string:$portal_url/${doc/document/getIcon};
+              title doc/document/portal_type;" />
+            <span class="navItemText" tal:content="doc/document/Title">
+              asdf
+            </span>
+          </a>
+          
+          <td style="text-align: right"
+            tal:content="doc/instate">
+            8
+          </td>
+          <td style="text-align: right"
+            tal:content="doc/total">
+            20
+          </td>
+          <td>
+            <a 
+              tal:attributes="href string:mailto:${doc/owner_mail}"
+              tal:content="doc/owner">
+              asdf
+            </a>
+          </td>
+    </tr>
  
-    </table>
+  </table>
 
 </metal:block>
 </html>


=== CMFLinkChecker/skins/linkchecker/lc_all_links_by_status.pt 1.7 => 1.8
===
--- CMFLinkChecker/skins/linkchecker/lc_all_links_by_status.pt:1.7	Sat Jan 22
15:03:41 2005
+++ CMFLinkChecker/skins/linkchecker/lc_all_links_by_status.pt	Thu Jan 27
13:32:05 2005
(at)(at) -21,24 +21,57 (at)(at)
           i18n:attributes="summary">
     <thead>
         <tr>
-            <th>&nbsp;<span tal:omit-tag=""
-           
i18n:translate="link_header_link">Link</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
-           
i18n:translate="link_header_reason">Description</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
-            i18n:translate="link_header_update">Last
update</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
i18n:translate="link_header_document">Document</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
i18n:translate="link_header_owner">Owner</span>&nbsp;</th>
+          <th>
+            <span
i18n:translate="link_header_link">Link</span><br />
+            <span
i18n:translate="link_header_description">Description</span>
+          </th>
+          <th i18n:translate="link_header_document">
+            Document
+          </th>
+          <th i18n:translate="link_header_owner">
+            Owner
+          </th>
         </tr>
     </thead>
 
-    <tal:block repeat="link
python:here.portal_linkchecker.reports.LinksInState(state=request.link_state)">
+    <tal:block 
+      repeat="link
python:here.portal_linkchecker.reports.LinksInState(state=request.link_state)">
         <tr>
-            <td><a tal:attributes="title link/url;href
link/url"><span
tal:replace="here.portal_linkchecker.shortURL(link['url'])"/></a></td>
-            <td tal:content="link/reason"
i18n:translate="">Unknown</td>
-            <td tal:content="python:here.toPortalTime(link['lastcheck'],
long_format=1)">Unknown</td>
-            <td><a tal:attributes="href
link/document/absolute_url;title link/document/Description"
tal:content="string:${link/document/Title}"/></td>
-            <td><a tal:attributes="href
string:mailto:${link/owner_mail}"
tal:content="link/owner">asdf</a></td>
+          <td>
+            <p>
+            <a tal:attributes="title link/url;
+                               href link/url"
+              
tal:content="python:here.portal_linkchecker.shortURL(link['url'])">
+                http://...                      
+            </a>
+            <br />
+            <tal:block 
+              tal:content="link/reason" 
+              i18n:translate="">
+              Unknown
+            </tal:block>
+          </td>
+          
+          <td>
+              <a class="navItem navLevel1"
+                tal:attributes="
+                  href link/document/getURL;
+                  title link/document/Description" >
+              <img class="navIcon" height="16" widht="16"
+                tal:attributes="
+                  src string:$portal_url/${link/document/getIcon};
+                  title link/document/portal_type;" />
+                <span class="navItemText"
tal:content="link/document/Title">
+                  asdf
+                </span>
+              </a>
+          </td>
+          <td>
+            <a tal:attributes="href string:mailto:${link/owner_mail}"
+              tal:content="link/owner">
+              asdf
+            </a>
+          </td>
         </tr>
     </tal:block>

CVS: CMFLinkChecker/skins/linkchecker - lc_balanced_score_card.pt:1.6
Christian Zagrodnick <cz(at)gocept.com>
2005-01-27 16:02:37 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv30231/skins/linkchecker

Modified Files:
	lc_balanced_score_card.pt 
Log Message:
cleanups in management report generation


=== CMFLinkChecker/skins/linkchecker/lc_balanced_score_card.pt 1.5 => 1.6
===
--- CMFLinkChecker/skins/linkchecker/lc_balanced_score_card.pt:1.5	Mon Jul 26
15:03:22 2004
+++ CMFLinkChecker/skins/linkchecker/lc_balanced_score_card.pt	Thu Jan 27
16:07:45 2005
(at)(at) -12,105 +12,120 (at)(at)
     i18n:domain="linkchecker"
     tal:define="status here/portal_linkchecker/reports/ManagementOverview">
 
-<style>
-.red {
-    color:red;
-    }
-.orange {
-    color:orange;
-    }
-.green{
-    color:green;
-    }
-.grey{
-    color:grey;
-    }
-</style>
-
-   <h1 i18n:translate="heading_balanced_score_card">Link management
overview</h1>
+  <style>
+  .red {
+      color:red;
+      }
+  .orange {
+      color:orange;
+      }
+  .green{
+      color:green;
+      }
+  .grey{
+      color:grey;
+      }
+  </style>
+
+  <h1 i18n:translate="heading_balanced_score_card">
+    Link management overview
+  </h1>
 
    <p i18n:translate="description_balanced_score_card">
-   This is the balanced score card for the links on your site. It gives you
strategic information
-   about the links on your site.
+     This is the balanced score card for the links on your site. It gives you 
+     strategic information about the links on your site.
    </p>
 
    <h2 i18n:translate="label_total_links">Total links</h2>
-        <div class="field">
-            <strong i18n:translate="label_total">Total:</strong>
<span tal:replace="status/total"/> <br/>
-            <strong
i18n:translate="label_distinct">Distinct:</strong> <span
tal:replace="status/total_distinct"/>
-        </div>
+    <div class="field">
+      <strong i18n:translate="label_total">Total:</strong>
+      <span tal:replace="status/totalLinks"/> <br/>
+      <strong i18n:translate="label_distinct">Distinct:</strong>
+      <span tal:replace="status/totalDistinctLinks"/>
+    </div>
         
    <h2 i18n:translate="label_total_documents">Total documents</h2>
-        <div class="field">
-            <strong i18n:translate="label_total">Total:</strong>
<span tal:replace="status/total_documents"/> <br/>
-        </div>
+   <div class="field">
+     <strong i18n:translate="label_total">Total:</strong>
+     <span tal:replace="status/totalDocuments"/> <br/>
+   </div>
 
     <h2 i18n:translate="label_documents_links">Documents per
link</h2>
-        <div class="field">
-            <strong i18n:translate="label_min">Minimum:</strong>
<span tal:replace="status/documents_per_link_min"/> <br/>
-            <strong i18n:translate="label_max">Maximum:</strong>
<span tal:replace="status/documents_per_link_max"/> <br/>
-            <strong i18n:translate="label_avg">Average:</strong>
<span tal:replace="status/documents_per_link_avg"/>
-        </div>
+    <div class="field">
+      <strong i18n:translate="label_min">Minimum:</strong>
+      <span tal:replace="status/documentsPerLinkMin"/> <br/>
+      <strong i18n:translate="label_max">Maximum:</strong> 
+      <span tal:replace="status/documentsPerLinkMax"/> <br/>
+      <strong i18n:translate="label_avg">Average:</strong>
+      <span tal:replace="status/documentsPerLinkAvg"/>
+    </div>
 
     <h2 i18n:translate="label_links_documents">Links per
document</h2>
-        <div class="field">
-            <strong i18n:translate="label_min">Minimum:</strong>
<span tal:replace="status/links_per_document_min"/> <br/>
-            <strong i18n:translate="label_max">Maximum:</strong>
<span tal:replace="status/links_per_document_max"/> <br/>
-            <strong i18n:translate="label_avg">Average:</strong>
<span tal:replace="status/links_per_document_avg"/>
-        </div>
+    
+    <div class="field">
+      <strong i18n:translate="label_min">Minimum:</strong> 
+      <span tal:replace="status/linksPerDocumentMin"/> <br/>
+      <strong i18n:translate="label_max">Maximum:</strong> 
+      <span tal:replace="status/linksPerDocumentMax"/> <br/>
+      <strong i18n:translate="label_avg">Average:</strong>
+      <span tal:replace="status/linksPerDocumentAvg"/>
+     </div>
 
+     
     <h2 i18n:translate="label_links_in_state">Links in the state
...</h2>
-        <div class="field">
-            <a class="red" tal:omit-tag="not:status/total_red_links"
tal:attributes="href
string:${here/portal_url}/lc_all_links_by_status?link_state=red"><strong
i18n:translate="red">Red:</strong> <span
tal:replace="status/total_red_links"/>
-                                            (<span
tal:replace="status/relative_red_links"/>%) <img
tal:condition="status/total_red_links" tal:attributes="src
here/linkTransparent.gif/absolute_url"/></a><br/>
-            <a class="orange" tal:omit-tag="not:status/total_orange_links"
tal:attributes="href
string:${here/portal_url}/lc_all_links_by_status?link_state=orange"><strong
i18n:translate="orange">Orange:</strong> <span
tal:replace="status/total_orange_links"/>
-                                        (<span
tal:replace="status/relative_orange_links"/>%) <img
tal:condition="status/total_orange_links" tal:attributes="src
here/linkOpaque.gif/absolute_url"/></a> <br/>
-        <a class="green" tal:omit-tag="not:status/total_green_links"
tal:attributes="href
string:${here/portal_url}/lc_all_links_by_status?link_state=green"><strong
i18n:translate="green">Green:</strong> <span
tal:replace="status/total_green_links"/>
-                                            (<span
tal:replace="status/relative_green_links"/>%) <img
tal:condition="status/total_green_links" tal:attributes="src
here/linkOpaque.gif/absolute_url"/></a><br/>
-            <a class="grey"  tal:omit-tag="not:status/total_grey_links"
tal:attributes="href
string:${here/portal_url}/lc_all_links_by_status?link_state=grey"><strong
i18n:translate="grey">Grey:</strong> <span
tal:replace="status/total_grey_links"/> 
-                                            (<span
tal:replace="status/relative_grey_links"/>%) <img
tal:condition="status/total_grey_links" tal:attributes="src
here/linkOpaque.gif/absolute_url"/></a>
-        </div>
-
-    <h2 i18n:translate="label_documents_in_state">Documents containing
links in the state ...</h2>
-        <div class="field">
+    
+    <div class="field">
+      <tal:block repeat="state_tuple status/states">
+        <tal:block define="
+          state python:state_tuple[0];
+          state_name python:state_tuple[1]">
             <a class="red" 
-               tal:omit-tag="not:status/total_red_documents" 
-               tal:attributes="href
string:${here/portal_url}/lc_all_documents_by_status?link_state=red">
-               <strong i18n:translate="red">Red</strong>:
-               <span tal:replace="status/total_red_documents"/>
-              (<span tal:replace="status/relative_red_documents"/>%)
-              <img tal:condition="status/total_red_documents" 
-                   tal:attributes="src
here/linkOpaque.gif/absolute_url"/></a><br/>
-
-            <a  class="orange" 
-                tal:omit-tag="not:status/total_orange_documents" 
-                tal:attributes="href
string:${here/portal_url}/lc_all_documents_by_status?link_state=orange">
-                <strong i18n:translate="orange">Orange</strong>:
-                <span tal:replace="status/total_orange_documents"/>
-                (<span
tal:replace="status/relative_orange_documents"/>%)
-              <img tal:condition="status/total_orange_documents" 
-                   tal:attributes="src
here/linkOpaque.gif/absolute_url"/></a><br/>
-
-            <a  class="green" 
-                tal:omit-tag="not:status/total_green_documents" 
-                tal:attributes="href
string:${here/portal_url}/lc_all_documents_by_status?link_state=green">
-                <strong i18n:translate="green">Green</strong>:
-                <span tal:replace="status/total_green_documents"/>
-                (<span tal:replace="status/relative_green_documents"/>%)
-              <img tal:condition="status/total_green_documents" 
-                   tal:attributes="src
here/linkOpaque.gif/absolute_url"/></a><br/>
-
-            <a  class="grey"    
-                tal:omit-tag="not:status/total_grey_documents" 
-                tal:attributes="href
string:${here/portal_url}/lc_all_documents_by_status?link_state=grey">
-                <strong i18n:translate="grey">Grey</strong>:
-                <span tal:replace="status/total_grey_documents"/>
-                (<span tal:replace="status/relative_grey_documents"/>%)
-              <img tal:condition="status/total_grey_documents" 
-                   tal:attributes="src
here/linkOpaque.gif/absolute_url"/></a><br/>
-        </div>
-
-
+              tal:omit-tag="not: python:status.links[state]"
+              tal:attributes="
+                class state;
+                href
string:${here/portal_url}/lc_all_links_by_status?link_state=red">
+              <strong i18n:translate=""
+                tal:content="state_name">
+                Red:
+              </strong>
+              <span tal:replace="python:status.links[state]"/>
+              (<span tal:replace="python: '%2.2f' %
status.linksPct[state]"/>%) 
+              <img tal:condition="python:status.links[state]"
+                tal:attributes="src
string:$portal_url/linkTransparent.gif"/>
+            </a><br/>
+
+        </tal:block>
+      </tal:block>
+
+    </div>
+
+
+    <h2 i18n:translate="label_documents_in_state">
+      Documents containing links in the state ...
+    </h2>
+    <div class="field">
+      <tal:block repeat="state_tuple status/states">
+        <tal:block define="
+          state python:state_tuple[0];
+          state_name python:state_tuple[1]">
+            <a class="red" 
+              tal:omit-tag="not:python:status.documents[state]" 
+              tal:attributes="
+                class state;
+                href
string:${here/portal_url}/lc_all_documents_by_status?link_state=red">
+                <strong i18n:translate=""
+                  tal:content="state_name">
+                  Red
+                </strong>:
+                <span tal:replace="python:status.documents[state]"/>
+                (<span tal:replace="python: '%2.2f' %
status.documentsPct[state]"/>%)
+                <img tal:condition="python:status.documents[state]" 
+                  tal:attributes="src string:$portal_url/linkOpaque.gif"/>
+              </a><br/>
+        </tal:block>
+      </tal:block>
+      
+    </div>
 </metal:block>
 </html>

CVS: CMFLinkChecker/skins/linkchecker - lc_object_status.pt:1.9
Christian Zagrodnick <cz(at)gocept.com>
2005-01-28 11:32:54 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv10853/skins/linkchecker

Modified Files:
	lc_object_status.pt 
Log Message:
changed object links overview to look more like the other overviews


=== CMFLinkChecker/skins/linkchecker/lc_object_status.pt 1.8 => 1.9 ===
--- CMFLinkChecker/skins/linkchecker/lc_object_status.pt:1.8	Sat Jan 22
15:03:41 2005
+++ CMFLinkChecker/skins/linkchecker/lc_object_status.pt	Fri Jan 28 11:38:05
2005
(at)(at) -36,25 +36,38 (at)(at)
           i18n:attributes="summary">
     <thead>
         <tr>
-            <th>&nbsp;<span tal:omit-tag=""
-           
i18n:translate="link_header_link">Link</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
-           
i18n:translate="link_header_state">State</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
-           
i18n:translate="link_header_reason">Description</span>&nbsp;</th>
-            <th>&nbsp;<span tal:omit-tag=""
-            i18n:translate="link_header_update">Last
update</span>&nbsp;</th>
+          <th>
+            <span
i18n:translate="link_header_link">Link</span><br />
+            <span
i18n:translate="link_header_description">Description</span>
+          </th> 
+          <th i18n:translate="link_header_state">
+            State
+          </th>
         </tr>
     </thead>
 
     <tbody>
         <tal:block repeat="link links">
-        <tr tal:attributes="class python:test(repeat['link'].odd(), 'odd',
'even')">
-
-            <td><a tal:attributes="class link/state;title
link/url;href link/url"
tal:content="python:here.portal_linkchecker.shortURL(link.url)">http://www.google.de</a></td>
-            <td tal:content="link/state"
i18n:translate="">Unknown</td>
-            <td tal:content="link/reason"
i18n:translate="">Unknown</td>
-            <td tal:content="python:here.toPortalTime(link.lastcheck,
long_format=1)">Unknown</td>
+          <tr tal:attributes="class python:test(repeat['link'].odd(),
'odd', 'even')">
+          <td>
+            <p>
+            <a tal:attributes="title link/url;
+                               href link/url"
+              
tal:content="python:here.portal_linkchecker.shortURL(link.url)">
+                http://...                      
+            </a>
+            <br />
+            <tal:block
+              tal:content="link/reason" 
+              i18n:translate="">
+              Unknown
+            </tal:block>
+          </td>
+          <td
+            tal:attributes="class link/state"
+            tal:content="link/state" i18n:translate="">
+            Unknown
+          </td>
         </tr>
         </tal:block>
     </tbody>

CVS: CMFLinkChecker - reports.py:1.8
Christian Zagrodnick <cz(at)gocept.com>
2005-01-31 14:04:02 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv3515

Modified Files:
	reports.py 
Log Message:
mail notifications work again


=== CMFLinkChecker/reports.py 1.7 => 1.8 ===
--- CMFLinkChecker/reports.py:1.7	Thu Jan 27 16:07:44 2005
+++ CMFLinkChecker/reports.py	Mon Jan 31 14:09:06 2005
(at)(at) -31,78 +31,54 (at)(at)
     security = ClassSecurityInfo()
 
     def MailNotifications(self):
-        """Runs the mail notification."""
-        # setup hour detection
-        hour = str(int(time.strftime("%H")))    # remove trailing 0 from the
hour
-        # get mailhost
-        try:
-            mailhost = self.MailHost
-        except AttributeError:
-            zLOG.LOG("CMFLinkChecker", zLOG.ERROR, "Mail notification", 
-                     "\tCan't run notification: No Mailhost object
reachable.")
-            return
+        """Runs the mail notification.
+        """
+        import pdb; pdb.set_trace() 
+        hour = str(int(time.strftime("%H")))  # remove trailing 0 from the
hour
+        mailhost = getToolByName(self, 'MailHost')
+        pms = getToolByName(self, "portal_membership")
+        lc = self.getLinkManager()
+        props = getToolByName(self, 'portal_properties')
+        default_charset = props.site_properties.default_charset
+        email_from_name = self.email_from_name
+        email_from_address = self.email_from_address
 
-        database = self.getParentNode().database
 
         # Count the mails for admin notification
         mail_count = 0
-        for member in getToolByName(self, "portal_membership").listMembers():
-            # Check if the user can get a report at all:
-            email = member.getProperty('email', '')
-            if not email:
-                continue
 
-            if not member.getProperty('lc_notify_details', []):
+        members = pms.listMembers()
+        for member in members:
+            # Check if the user can receive reports at all and if he wants a 
+            # report *now*
+            email = member.getProperty('email', None)
+            if email is None:
                 continue
-
-            # Is this the right hour to send a report?
             frequency = member.getProperty('lc_notify_frequency', [])
-            if not hour in frequency:
+            if hour not in frequency:
                 continue
 
-            report = {}
-            seenlist = []
-
-            for level in member.getProperty('lc_notify_details'):
-                report[level] = []
-
-            changes_only = member.getProperty('lc_notify_changes_only', 0)
-            last_report = member.getProperty('lc_notify_last_notification',
DateTime())
-
-            # First gather all links
-            for document in getToolByName(self,
"portal_catalog")(Creator=member.getId()):
-                links = database.byObject(document.getObject())
-                for link in links:
-                    id = link.getId()
-                    if id in seenlist:
-                        continue
-                    seenlist.append(id)
-
-                    # If we are only showing changes, go ahead.
-                    if changes_only:
-                        if link.lastupdate < last_report:
-                            continue
-
-                    if link.state in report.keys():
-                        report[link.state].append(link)
-
-                    if changes_only and link.laststatus in report.keys():
-                        report[link.laststatus].append(link)
-
+            report = self.getGroupedLinksFor(member.getId())
+            self._filter_report(member, report)
+   
             # Now get the template and create the html for the output
-            template = getToolByName(self,
"portal_url").getPortalObject().lc_report_template
+            template = self.lc_report_template
 
-            keys = report.keys()
-            states = [ x for x in ['red', 'orange', 'grey', 'green'] if x in
keys]
-            del keys
+            # sorting
+            states = [ x for x in ['red', 'orange', 'grey', 'green']
+                         if x in report ]
             
-            mailbody = template(states=states, report=report, member=member,
hour=hour)
-            member.setMemberProperties({'lc_notify_last_notification':
DateTime()})
+            mailbody = template(states=states, report=report, member=member,
+                                hour=hour)
+            member.setMemberProperties(
+                                {'lc_notify_last_notification': DateTime()})
 
             mMsg = "To: %s\n" % email
-            mMsg = mMsg + "From: %s <%s>\n" % (self.email_from_name,
self.email_from_address) # Portal configuration
+            mMsg = mMsg + "From: %s <%s>\n" % (email_from_name,
+                                               email_from_address)
             mMsg = mMsg + "Mime-Version: 1.0\n"
-            mMsg = mMsg + "Content-Type: text/html; charset=%s\n\n" %
self.portal_properties.site_properties.default_charset
+            mMsg = mMsg + "Content-Type: text/html; charset=%s\n\n" % (
+                                                            default_charset, )
             mMsg = mMsg + mailbody
             mSubj = "Link report for %s o'clock" % hour
             mailhost.send(mMsg, subject=mSubj, encode='base64')
(at)(at) -110,6 +86,27 (at)(at)
 
         return "Sent Mails: %s" % mail_count
 
+    def _filter_report(self, member, report):
+        report_states = member.getProperty('lc_notify_details')
+        for state in report:
+            if state not in report_states:
+                del report[state]
+        
+        changes_only = member.getProperty('lc_notify_changes_only', False)
+        last_report = member.getProperty('lc_notify_last_notification',
+                                         DateTime())
+        for state, links in report.items():
+            links_iterate = links[:]
+            for id, link in enumerate(links_iterate):
+                if changes_only and link.lastupdate < last_report:
+                    # remove already reported links (did not change)
+                    del links[id]
+                    continue
+                if changes_only and link.laststatus in report:
+                    # add some extra information
+                    report[link.laststatus].append(link)
+
+
 
     security.declarePublic('GroupedLinksForAuthenticatedMember')
     def GroupedLinksForAuthenticatedMember(self):
(at)(at) -117,13 +114,19 (at)(at)
         
            The list only features catalog brains from the database.
         """
-        user = getSecurityManager().getUser()
+        user = getSecurityManager().getUser().getId()
+        return self.getGroupedLinksFor(user)
+    
+    security.declareProtected(CMFCorePermissions.ManagePortal,
+                              'getGroupedLinksFor')
+    def getGroupedLinksFor(self, user_id):
+
         catalog = getToolByName(self, 'portal_catalog')
         lc = self.getLinkManager()
         types = lc.retrieving.listSupportedTypes()
 
         # Find all objects this user is responsible for
-        docs = catalog(Creator=user.getId(), portal_type=types)
+        docs = catalog(Creator=user_id, portal_type=types)
         uids = [ lc.getUIDForBrain(x) for x in docs ]
         uids = [ uid for uid in uids if uid is not None]
         links = lc.database.query(objects=uids)
(at)(at) -134,6 +137,8 (at)(at)
                         
         return groups
 
+        
+    
     security.declareProtected(CMFCorePermissions.ManagePortal,
                               'DocumentsInState')
     def DocumentsInState(self, state):

CVS: CMFLinkChecker - reports.py:1.9
Christian Zagrodnick <cz(at)gocept.com>
2005-01-31 14:10:47 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv4505

Modified Files:
	reports.py 
Log Message:
float calculations

removed pdb


=== CMFLinkChecker/reports.py 1.8 => 1.9 ===
--- CMFLinkChecker/reports.py:1.8	Mon Jan 31 14:09:06 2005
+++ CMFLinkChecker/reports.py	Mon Jan 31 14:16:19 2005
(at)(at) -33,7 +33,6 (at)(at)
     def MailNotifications(self):
         """Runs the mail notification.
         """
-        import pdb; pdb.set_trace() 
         hour = str(int(time.strftime("%H")))  # remove trailing 0 from the
hour
         mailhost = getToolByName(self, 'MailHost')
         pms = getToolByName(self, "portal_membership")
(at)(at) -273,7 +272,7 (at)(at)
 
         self.documentsPerLinkMin = min(link_document_count)
         self.documentsPerLinkMax = max(link_document_count)
-        self.documentsPerLinkAvg = self.totalLinks / self.totalDocuments
+        self.documentsPerLinkAvg = float(self.totalLinks) /
self.totalDocuments
       
 
         link_document_map_list = link_document_map.values()
(at)(at) -282,7 +281,7 (at)(at)
 
         self.linksPerDocumentMin = min(link_document_map_list)
         self.linksPerDocumentMax = max(link_document_map_list)
-        self.linksPerDocumentAvg = self.totalDocuments / self.totalLinks
+        self.linksPerDocumentAvg = float(self.totalDocuments) /
self.totalLinks
         
         self.links = link_state_map
         self.linksPct = {}

CVS: CMFLinkChecker/skins/linkchecker - lc_balanced_score_card.pt:1.7
Christian Zagrodnick <cz(at)gocept.com>
2005-01-31 14:23:59 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker/skins/linkchecker
In directory amy:/tmp/cvs-serv6199/skins/linkchecker

Modified Files:
	lc_balanced_score_card.pt 
Log Message:
fixed linksperdoc and docperlinks calculations (+rounding)


=== CMFLinkChecker/skins/linkchecker/lc_balanced_score_card.pt 1.6 => 1.7
===
--- CMFLinkChecker/skins/linkchecker/lc_balanced_score_card.pt:1.6	Thu Jan 27
16:07:45 2005
+++ CMFLinkChecker/skins/linkchecker/lc_balanced_score_card.pt	Mon Jan 31
14:29:37 2005
(at)(at) -57,7 +57,7 (at)(at)
       <strong i18n:translate="label_max">Maximum:</strong> 
       <span tal:replace="status/documentsPerLinkMax"/> <br/>
       <strong i18n:translate="label_avg">Average:</strong>
-      <span tal:replace="status/documentsPerLinkAvg"/>
+      <span tal:replace="python: '%2.2f' % status.documentsPerLinkAvg"/>
     </div>
 
     <h2 i18n:translate="label_links_documents">Links per
document</h2>
(at)(at) -68,7 +68,7 (at)(at)
       <strong i18n:translate="label_max">Maximum:</strong> 
       <span tal:replace="status/linksPerDocumentMax"/> <br/>
       <strong i18n:translate="label_avg">Average:</strong>
-      <span tal:replace="status/linksPerDocumentAvg"/>
+      <span tal:replace="python: '%2.2f' % status.linksPerDocumentAvg"/>
      </div>

CVS: CMFLinkChecker - reports.py:1.10
Christian Zagrodnick <cz(at)gocept.com>
2005-01-31 14:27:11 [ FULL ]
Update of /cvs/gocept/CMFLinkChecker
In directory amy:/tmp/cvs-serv6199

Modified Files:
	reports.py 
Log Message:
fixed linksperdoc and docperlinks calculations (+rounding)


=== CMFLinkChecker/reports.py 1.9 => 1.10 ===
--- CMFLinkChecker/reports.py:1.9	Mon Jan 31 14:16:19 2005
+++ CMFLinkChecker/reports.py	Mon Jan 31 14:29:37 2005
(at)(at) -272,7 +272,7 (at)(at)
 
         self.documentsPerLinkMin = min(link_document_count)
         self.documentsPerLinkMax = max(link_document_count)
-        self.documentsPerLinkAvg = float(self.totalLinks) /
self.totalDocuments
+        self.documentsPerLinkAvg = float(self.totalDocuments) /
self.totalLinks
       
 
         link_document_map_list = link_document_map.values()
(at)(at) -281,7 +281,7 (at)(at)
 
         self.linksPerDocumentMin = min(link_document_map_list)
         self.linksPerDocumentMax = max(link_document_map_list)
-        self.linksPerDocumentAvg = float(self.totalDocuments) /
self.totalLinks
+        self.linksPerDocumentAvg = float(self.totalLinks) /
self.totalDocuments
         
         self.links = link_state_map
         self.linksPct = {}

MailBoxer