RE: [Zope-dev] Management Interface in ZODB

2001-07-13 Thread Adrian Hungate

You might want to look at my PatchKit product that may provide the vehicle
you need for your patch. It provides an override for the management style
sheet (Among other unrelated patches).

Adrian...

-Original Message-
From: Tim R Ansell [mailto:[EMAIL PROTECTED]]
Sent: Monday, 09 July 2001 15:03
To: [EMAIL PROTECTED]
Subject: [Zope-dev] Management Interface in ZODB


I have a couple of small patches here that allow you to override the
manage options (i.e. manage_tabs, manage_page_header,
manage_page_footer) in the ZODB. This simple patch seems a nice way to
provide this option without breaking compatibility with the current
system. It patches the App/Management.py and OFS/Application.py file.

This also causes risk of locking yourself out of management, there are 2
ways around this problem; First is to ftp/webDAV in and delete the
offending file.
I've also added a SUPPRESS_CUST_MANAGE option, (for example
abc/SUPPRESS_CUST_MANAGE/manage_main) when this is in the path it will
stop use the core zope management interface instead of the custom ones.
The problem with this is that i get a Override instance at 8189638
instead of the DTML code that should be in place of the object. As well
this option IS NOT thread safe. I'm looking for a better solution but i
can't think of one?

What do people think of this patch? Is there a better way to do this? Is
it possible to get a patch similar to this integrated into the Zope core
because it's an extremely useful.

Hope to hear from you soon

Mithro

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Fwd: Re: [Zope-dev] Management Interface in ZODB]

2001-07-11 Thread Tim R Ansell



 Original Message 
Subject: Re: [Zope-dev] Management Interface in ZODB
Date: Tue, 10 Jul 2001 22:29:46 +0930
From: Tim R Ansell [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Andreas Jung [EMAIL PROTECTED]
References: [EMAIL PROTECTED]
036d01c10889$be6cd5f0$9865fea9@SUXLAP [EMAIL PROTECTED]
06b001c10934$ac429a80$9865fea9@SUXLAP

As soon as i submitted to the collector i figured out the
SUPPRESS_CUST_MANAGE bug and found a new quirk. The new quirk seems
to be that the manage_options get inherited downwards as well (in a
kinda additive way). I'm yet to figure this one out as i did little to
change the manage_tabs stuff...

Anyway it would be nice if i could get some comments etc. about the
patch, do people think this is the right way to go? etc.?

Mithro


Andreas Jung wrote:
 
 I just saw your submission to the collector. Do you need
 any further assistance ?
 
 Andreas
 - Original Message -
 From: Tim R Ansell [EMAIL PROTECTED]
 To: Andreas Jung [EMAIL PROTECTED]
 Sent: Dienstag, 10. Juli 2001 05:03
 Subject: Re: [Zope-dev] Management Interface in ZODB
 
  Andreas Jung wrote:
  
   From: Tim R Ansell [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Montag, 9. Juli 2001 09:03
   Subject: [Zope-dev] Management Interface in ZODB
  
   
What do people think of this patch? Is there a better way to do this?
 Is
it possible to get a patch similar to this integrated into the Zope
 core
because it's an extremely useful.
  
   If you like to provide patches to the Zope core please use the collector
   to submit the patches.
  
 
  Is there some HowTo for using the collector, a search on the website
  doesn't seem to return much useful information.
 
   Andreas
  
   P.S. Please don't post larger patches to the mailing list. Instead
   put the patches on your member page on www.zope.org and write a small
   announcement with the URL of the patches.
 
 
  BTW is there anywhere you can download single zope files? Like a CVSWeb
  etc?
 
  Mithro
 

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Management Interface in ZODB IT WORKS! Feed back NEEDED!

2001-07-11 Thread Tim R Ansell


Okay everything works as it should now

This patch allows you to store the Zope management interfaces inside the
ZODB. It does this by making the manage stuff inheritable and giving the
defaults to the root of the folder (This means that the management can't
be changed for the root folder - which in my opinion is a good thing.)

To override the manage_page_header, all you need to do is create a DTML
Method (other method types should work as well but haven't been tested)
with the id manage_page_header. This will replace manage_page_header for
ALL object below the folder the method was created in. 

This means that you can lock your self out of the management screens
(say by putting !-- in the manage_page_header). To get around this you
can use the special SUPPRESS_CUST_MANAGE object. This object must be
inserted AFTER the object that has the offending manage stuff but before
the actual manage. For example;

 /Folder_with_cust_manage/SUPPRESS_CUST_MANAGE/manage_main
and
 /Folder_with_cust_manage/SUPPRESS_CUST_MANAGE/Normal_Folder/manage_main
and
 /Folder_with_cust_manage/Normal_Folder/SUPPRESS_CUST_MANAGE/manage_main

would work but

 /Folder_with_cust_manage/manage_main/SUPPRESS_CUST_MANAGE
or
 /SUPPRESS_CUST_MANAGE/Folder_with_cust_manage/manage_main
or 
 /Folder_with_cust_manage/Normal_Folder/manage_main/SUPPRESS_CUST_MANAGE

wouldn't.

I've tested this patch and are yet to find any problems with it.

This in theory should allow template folders to apply templates to any
object below themselves (through the normal standard_html_header/footer)
and to the object's management screens (through the
manage_page_header/footer). Without modification of any of the zope
source. 

It allows  you to quickly provide a different look for the management
screens on a per site bases (when you are virtual hosting). This could
be invaluable if some company wants to BADGE the management screens of
their zope site.

NOTE: This patch doesn't currently let you override 'manage'

Would it be possible for somebody to review this patch for me and tell
me if there are any inherent problems with the way i have done this?

This is an actual patch and is relatively small so i've attached it to
the bottom of this email, hope this is okay

Mithro

PS: I can't seem to update the collector Item with this new patch?

Tim R Ansell wrote:
snip

diff -w -b -B -c -r -d --exclude=Products --exclude=sedscript --exclude=var 
--exclude=pcgi --exclude=*.c --exclude=*.pyc --exclude=*.zexp --exclude=*.xml 
--exclude=*.so --exclude=Extensions --exclude=Zope.cgi --exclude=core --exclude=fcgi 
--exclude=*.bak --exclude=#*# --exclude=Makefile* --exclude=z2.py --exclude=*~ 
--exclude=start --exclude=stop --exclude=Setup --exclude=*.old 
./download/Zope-2.3.2-src/lib/python/App/Management.py 
./zope/lib/python/App/Management.py
*** ./download/Zope-2.3.2-src/lib/python/App/Management.py  Wed Jan 17 09:26:53 
2001
--- ./zope/lib/python/App/Management.py Wed Jul 11 21:47:07 2001
***
*** 94,107 
  from Globals import DTMLFile, HTMLFile
  from string import split, join, find
  from AccessControl import getSecurityManager
  
  class Tabs(ExtensionClass.Base):
  Mix-in provides management folder tab support.
  
- manage_tabs__roles__=('Anonymous',)
- manage_tabs=DTMLFile('dtml/manage_tabs', globals())
- 
- 
  manage_options  =()
  
  filtered_manage_options__roles__=None
--- 94,104 
  from Globals import DTMLFile, HTMLFile
  from string import split, join, find
  from AccessControl import getSecurityManager
+ import Acquisition
  
  class Tabs(ExtensionClass.Base):
  Mix-in provides management folder tab support.
  
  manage_options  =()
  
  filtered_manage_options__roles__=None
***
*** 135,141 
  
  return result
  
- 
  manage_workspace__roles__=('Anonymous',)
  def manage_workspace(self, REQUEST):
  Dispatch to first interface in manage_options
--- 132,137 
***
*** 193,202 
  out.append(last)
  return join(out, '/')
  
! Globals.default__class_init__(Tabs)
! 
  
  class Navigation(ExtensionClass.Base):
  Basic navigation UI support
  
  __ac_permissions__=(
--- 189,203 
  out.append(last)
  return join(out, '/')
  
! class RealTabs(ExtensionClass.Base):
! manage_options = ()
! manage_tabs__roles__=('Anonymous',)
! manage_tabs=HTMLFile('dtml/manage_tabs', globals())
  
  class Navigation(ExtensionClass.Base):
+ manage = DTMLFile('dtml/manage', globals())
+ 
+ class RealNavigation(Navigation, ExtensionClass.Base):
  Basic navigation UI support
  
  __ac_permissions__=(
***
*** 207,218 
)),
  )
  
! manage=DTMLFile('dtml/manage', globals())
! manage_menu   =DTMLFile('dtml/menu', globals())
  
! manage_top_frame  =DTMLFile('dtml/manage_top_frame', globals())
! 

[Zope-dev] Management Interface in ZODB

2001-07-09 Thread Tim R Ansell

I have a couple of small patches here that allow you to override the
manage options (i.e. manage_tabs, manage_page_header,
manage_page_footer) in the ZODB. This simple patch seems a nice way to
provide this option without breaking compatibility with the current
system. It patches the App/Management.py and OFS/Application.py file.

This also causes risk of locking yourself out of management, there are 2
ways around this problem; First is to ftp/webDAV in and delete the
offending file.
I've also added a SUPPRESS_CUST_MANAGE option, (for example
abc/SUPPRESS_CUST_MANAGE/manage_main) when this is in the path it will
stop use the core zope management interface instead of the custom ones.
The problem with this is that i get a Override instance at 8189638
instead of the DTML code that should be in place of the object. As well
this option IS NOT thread safe. I'm looking for a better solution but i
can't think of one?

What do people think of this patch? Is there a better way to do this? Is
it possible to get a patch similar to this integrated into the Zope core
because it's an extremely useful.

Hope to hear from you soon

Mithro

##
# 
# Zope Public License (ZPL) Version 1.0
# -
# 
# Copyright (c) Digital Creations.  All rights reserved.
# 
# This license has been certified as Open Source(tm).
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions in source code must retain the above copyright
#notice, this list of conditions, and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
#notice, this list of conditions, and the following disclaimer in
#the documentation and/or other materials provided with the
#distribution.
# 
# 3. Digital Creations requests that attribution be given to Zope
#in any manner possible. Zope includes a Powered by Zope
#button that is installed by default. While it is not a license
#violation to remove this button, it is requested that the
#attribution remain. A significant investment has been put
#into Zope, and this effort will continue if the Zope community
#continues to grow. This is one way to assure that growth.
# 
# 4. All advertising materials and documentation mentioning
#features derived from or use of this software must display
#the following acknowledgement:
# 
#  This product includes software developed by Digital Creations
#  for use in the Z Object Publishing Environment
#  (http://www.zope.org/).
# 
#In the event that the product being advertised includes an
#intact Zope distribution (with copyright and license included)
#then this clause is waived.
# 
# 5. Names associated with Zope or Digital Creations must not be used to
#endorse or promote products derived from this software without
#prior written permission from Digital Creations.
# 
# 6. Modified redistributions of any form whatsoever must retain
#the following acknowledgment:
# 
#  This product includes software developed by Digital Creations
#  for use in the Z Object Publishing Environment
#  (http://www.zope.org/).
# 
#Intact (re-)distributions of any official Zope release do not
#require an external acknowledgement.
# 
# 7. Modifications are encouraged but must be packaged separately as
#patches to official Zope releases.  Distributions that do not
#clearly separate the patches from the original work must be clearly
#labeled as unofficial distributions.  Modifications which do not
#carry the name Zope may be packaged in any form, as long as they
#conform to all of the clauses above.
# 
# 
# Disclaimer
# 
#   THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY
#   EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
#   PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL CREATIONS OR ITS
#   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
#   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
#   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#   SUCH DAMAGE.
# 
# 
# This software consists of contributions made by Digital Creations and
# many individuals on behalf of Digital Creations.  Specific
# attributions are listed in the accompanying credits file.
# 
##
__doc__='''Application support


$Id: Application.py,v 

Re: [Zope-dev] Management Interface in ZODB

2001-07-09 Thread Andreas Jung


From: Tim R Ansell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Montag, 9. Juli 2001 09:03
Subject: [Zope-dev] Management Interface in ZODB


 
 What do people think of this patch? Is there a better way to do this? Is
 it possible to get a patch similar to this integrated into the Zope core
 because it's an extremely useful.

If you like to provide patches to the Zope core please use the collector
to submit the patches.

Andreas

P.S. Please don't post larger patches to the mailing list. Instead
put the patches on your member page on www.zope.org and write a small
announcement with the URL of the patches.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )