Re: [Zope-dev] Interfaces: Specify, then implement!

2000-11-30 Thread Chris Withers

Dieter Maurer wrote:
 
 If you do change the implementation, then the specification
 can probably be changed at the same time.

IMHO, this is the wrong way round.

If the interface doesn't cover what it needs to, update the interface
and then make sure all the implementations are updated afterwards.

cheers,

Chris

___
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] OracleStorage, and possibly others

2000-11-30 Thread Jim Fulton

Lalo Martins wrote:
 
 Well, two betas of OracleStorage in one day, then a month and a
 half of silence. What's the status?

From our perspective, it's what it was then.  We built it for
a customer who later decided they didn't want it. I'm
glad to hear you found it useful.

 What about the other Storage projects? BerkeleyStorage has been
 dead for an year, and I heard pretty nasty words about
 InterbaseStorage. What about someone who wanted to try to port
 OracleStorage to Postgres or some other RDBMS?

We're working on a new suite of Berkeley storages that we are
writing to the the latest Berkeley database APIs. As Chris
pointed out, these are based on a new Berkeley DB extension that 
Andrew Kuchling started and that Robin Dunn is finishing.

There are a number of interesting new features that will eventually
result from these storages:

  - A new pack/garbage collection approach.  The current storages
perform a mark-and-sweep garbage collection when packing. It turns
out that this really isn't very scalable.  I'm going two 
switch to using the same garbage-collection strategy that Python uses, 
which is reference counting supplimented by an incremental cyclic garbage
detection algorithm. I have a simple storage (no undo or versions) that
needs no packing of your data structures are free of cycles.

I'm hopeful that we can make packing automatic and incremental.

  - Undo-log generation will be much faster, at least for common
cases. Generation of undo logs (for selecting transactions to undo)
is becoming a significant performance problem with FileStorage.

  - ZEO verification, performed when a client with a persistent
cache starts up, will be much faster.

  - Policies to control whether multiple revisions are stored
or whether revisions are removed by packing on a object-by-object
or transaction-by-transaction basis.

For example, you could have a poll/votting product that didn't allow
undo of and didn't require storing multiple records for votes. This
would be cleaner than mounting a separate database with a simple
storage.

You could keep significant historical revisions for important objects, such
as Wiki pages, templates, scripts, etc., with a policy to decide
which revisions are significant.

  - The ability to set policies to implement quotas.

I expect that we'll work out a lot of these ideas for Berkeley storages and
then implement them in OrcaleStorage. Others should then be able to map the
implementation onto other storages.

I'll note, in passing, that it's much nicer working these ideas out
with the BerkelyDB API than dealing with PLSQL or Python SQL.

We are also working on ZEO storage replication. This may have a big
impact on the storage API, or lead to specialized APIs for replicated
storages.
 
 Please help stamp out Data.fs! :-)

I don't think Data.fs will go away.  I do expect it to be relagated to
initial evaluation and development projects. Use of Berkely DB in
transactional mode requires a significant andminstration commitment.
Log files need to be purged. Backup and recovery processes need to be in 
place. A similar cost is associated with using Oracle and many other databases,
I expect. People aren't going to want to deal with these issues when 
initially trying and learning Zope (or ZODB).

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
Technical Director   (888) 344-4332http://www.python.org  
Digital Creationshttp://www.digicool.com   http://www.zope.org

___
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 )




[Zope-dev] Re: [Geeks] Re: Interface Meta Data proposal

2000-11-30 Thread Jim Fulton

Guido van Rossum wrote:
 
  Is security really a part of an object's interface?  I thought this was more
  of an implementation thing.
 
 Good point.  Certainly in Unix I can have two things implementing the
 same interface (e.g. two named pipes) with different security
 settings (i.e. modes).
 
 However some security stuff can be part of the interface too: e.g. the
 fact that a Foo object has Read, Write and Execute permissions is
 usefully specified as part of its interface.  Whether a particular Foo
 instance has a given permission for a certain user is up to the
 instance.

I think we're talking about a different level of security setting
here.  In unix, you have certain fixed permissions (e.g. read, write,
execute).  The OS maps these permissions onto certain low-level operations
for the few objects it knows about.  This is about mapping permissions
onto objects, rather than deciding what users or groups have 
what permissions on an object.

In Zope, the programmer defines abstract permissions and decides how to map
the abstract permissions to object operations. It is this mapping that
makes sense for interfaces.  

Like Unix, Zope has a separate mechanism for deciding what users/roles
have what permissions on objects. This should not be part of the 
object interface.  These settings are done by users/administrators.

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
Technical Director   (888) 344-4332http://www.python.org  
Digital Creationshttp://www.digicool.com   http://www.zope.org

___
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] OracleStorage, and possibly others

2000-11-30 Thread Phillip J. Eby

At 08:10 AM 11/30/00 -0500, Jim Fulton wrote:

I don't think Data.fs will go away.  I do expect it to be relagated to
initial evaluation and development projects. Use of Berkely DB in

transactional mode requires a significant andminstration commitment.
Log files need to be purged. Backup and recovery processes need to be in 
place.

FWIW, Ty and I talked about using a daemonic thread in BerkeleyStorage to
run periodic checkpoints and purge logfiles.  AFAIK, backups of BerkeleyDB
require only that you make a copy of all the associated files.  Recovery's
a bit trickier, of course.  (We never got around to implementing it because
our tests showed that BerkeleyDB didn't solve the performance issue we were
trying to solve.  So we quit working on it at that point.)


___
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] OracleStorage, and possibly others

2000-11-30 Thread Jim Fulton

"Phillip J. Eby" wrote:
 
 At 08:10 AM 11/30/00 -0500, Jim Fulton wrote:
 
 I don't think Data.fs will go away.  I do expect it to be relagated to
 initial evaluation and development projects. Use of Berkely DB in
 
 transactional mode requires a significant andminstration commitment.
 Log files need to be purged. Backup and recovery processes need to be in
 place.
 
 FWIW, Ty and I talked about using a daemonic thread in BerkeleyStorage to
 run periodic checkpoints and purge logfiles.  AFAIK, backups of BerkeleyDB
 require only that you make a copy of all the associated files.  Recovery's
 a bit trickier, of course.  (We never got around to implementing it because
 our tests showed that BerkeleyDB didn't solve the performance issue we were
 trying to solve.  So we quit working on it at that point.)

I don't think the storage should get involved with this. There are alot
of knobs and possible policies that can be used. This is all well documented
and supported by Sleepycat Software. IMO, when someone uses a Berkeley DB storage
they are using Berkeley DB and should learn how to administer it. I don't
think it's a good idea to try to hide this from people.

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
Technical Director   (888) 344-4332http://www.python.org  
Digital Creationshttp://www.digicool.com   http://www.zope.org

___
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] OracleStorage, and possibly others

2000-11-30 Thread Lalo Martins

On Thu, Nov 30, 2000 at 08:10:15AM -0500, Jim Fulton wrote:
 Lalo Martins wrote:
  
  Please help stamp out Data.fs! :-)
 
 I don't think Data.fs will go away.  I do expect it to be relagated to
 initial evaluation and development projects. Use of Berkely DB in
 transactional mode requires a significant andminstration commitment.
 Log files need to be purged. Backup and recovery processes need to be in 
 place. A similar cost is associated with using Oracle and many other databases,
 I expect. People aren't going to want to deal with these issues when 
 initially trying and learning Zope (or ZODB).

Sometime it will, I hope. Or at least, be relegated to non-Zope
ZODBs where the data volume is very small. But FileStorage will
not be replaced by any of the current alternatives, I agree.

[]s,
   |alo
   +
--
  Hack and Roll ( http://www.hackandroll.org )
The biggest site for whatever-it-is-that-we-are.


http://zope.gf.com.br/lalo   mailto:[EMAIL PROTECTED]
 pgp key: http://zope.gf.com.br/lalo/pessoal/pgp

Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar

___
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 )




[Zope-dev] ZUnit - feedback convocation

2000-11-30 Thread Lalo Martins

Hi all

I'trying to write a document on ZUnit and Unit Testing in
general, following Michel's and Amos' documentation process. I
wrote an outline, and now I'm stuck :-) anyone with a few free
moments is welcome to take a look and send me some words. Also,
anyone very interested in the subject is welcome to volunteer
for editorial help (read the Process to know what this means).

Thank you.

(BTW, if you can't understand what an "outline" is, read the
process too. Oh what the heck. If you haven't read it, then
read it, it's very cool reading anyway.)

[]s,
   |alo
   +
--
  Hack and Roll ( http://www.hackandroll.org )
The biggest site for whatever-it-is-that-we-are.


http://zope.gf.com.br/lalo   mailto:[EMAIL PROTECTED]
 pgp key: http://zope.gf.com.br/lalo/pessoal/pgp

Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar


Unit testing Zope Products with ZUnit

  by Lalo Martins

  Unit Testing

What is Unit Testing

Where does it come from

How should it be done

Refactor mercilessly!

  Writing Tests
  
Importing ZUnit

The TestCase class

Interfacing with the Zope environment

Fixtures

  The persistence problem - leaving traces behind

Grouping tests in TestSuites

Wrapping it all up in a creator function
  
  Running the tests
  
The TestRunner object

TestResults objects

Leaving objects behind for debugging



[Zope-dev] Return variables from a DTML Method

2000-11-30 Thread bentzion

I want to change some ZClass properties by getting return results 
from a DTML Method. Something like this: dtml-call 
"myzclass.propertysheets.get('Basic').manage_changeProperties(dtmlM
eth(this(),_))". How do I get the dtmlMeth to return a Mapping? 
(or should I be doing this a different way?)

Thanks.



___
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] ZUnit - feedback convocation

2000-11-30 Thread Michel Pelletier

Lalo Martins wrote:
 
 Hi all
 
 I'trying to write a document on ZUnit and Unit Testing in
 general, following Michel's and Amos' documentation process. I
 wrote an outline, and now I'm stuck :-) anyone with a few free
 moments is welcome to take a look and send me some words. Also,
 anyone very interested in the subject is welcome to volunteer
 for editorial help (read the Process to know what this means).

Where would we find this outline?
 
 Thank you.
 
 (BTW, if you can't understand what an "outline" is, read the
 process too. Oh what the heck. If you haven't read it, then
 read it, it's very cool reading anyway.)

Thanks!

-Michel

___
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 )




[Zope-dev] ZPatterns: using PythonMethods from Skinscript

2000-11-30 Thread Ulrich Eck



hi out there,

this is my first posting on this list. Right now I 
think 
this is the right place to ask details about 
ZPatterns.

I think a ZPatterns-Mailinglist should be set up, 
where
people like me, working hard to get the "Zen of 
ZPatterns"
can discuss questions related to USING 
ZPatterns.

Here my first little problem:

I've a db_sequence specialist who serves the 
Framework with
db_id's for new Records like:

 newid = 
db_sequence.getItem('sequence_name').nextid

The Attribute nextid is provided by a 
Skinscript-Method:

WITH getNextId(seq_name=self.id) 
COMPUTE 
seq_name=seq_name,nextid=_.int(nextid)



"getNextId()" is a PythonMethod and uses 
ZSQL-Methods to
compute the NextId while Locking the Table: 


PARAMETER: self, seq_name


self.sql_Lock()nid = 1for cur_id in 
self.sql_NextIdGet(seq_name=seq_name):nid = cur_id.nextid + 
1self.sql_NextIdUpdate(seq_name=seq_name,nextid=nid)break

else:self.sql_NextIdCreate(seq_name=seq_name,nextid=1)

self.sql_Unlock()

return {'seq_name':seq_name, 'nextid':nid} # HERE'S 
MY PROBLEM I THINK 



I tried to return nearly everything expect a certain instance of a 
"special getNextId-Return-Object" e.g. return nid / return (seq_name,nid) 
...

I tried serveral ways to reach my return values in the SSMethod:
... COMPUTE nextid=nextid or nextid=self.nextid or nextid=RESULT ...

Finally i tried to follow what happens during a get-call of an Attribute in 
the source .. 
no success ..

except when i use some Dummy ZSQL-Method which does the following and 
works (but this is not the way to do it ..)"select value as nextid, 
value as seq_name"


can someone give some advice or enlighten me about the Namespace I'm in, at 
SSMethods Attribute providers 
atexecution-time ?!?






My Second "little" Problem:

i'm not the first one who had problems to manage data with rdbms and 
zpatterns. i can get Attributes through SSMethods
easily and now tried to setup ADD/CHANGE/DELETED Rules to manage 
data.


Here my SSMethod for 
this(getEventById/insertEvent/updateEventareZSQL-Methods):

WITH QUERY getEventById(id=self.id) COMPUTE 
sid=_.int(id),name,time_start
WHEN OBJECT ADDED CALL insertEvent(id=self.sid)WHEN OBJECT 
ADDED,CHANGED STORE sid,name,time_start 
USING 
updateEvent(id=self.sid,name=self.name,time_start=self.time_start)


I access the Item through loadAttribute: 
"sid"
I set up a ZClass derived from Dataskin which acts 
as Storage-Class.

I call

dtml-let 
ni="newItem(key=db.getItem('data_event').nextid)" 
nips="ni.propertysheets.get('Basic')"dtml-var 
"nips.manage_changeProperties(REQUEST=REQUEST)"/dtml-let
and get back an empty object without any attributes 
(propertysheet-problem??)
the record in the database is created (but only 
because I reduced the ZSQL-Insert Method to id-parm only)
this again seems to be a Problem of the namespace 
I'm in while the _objectAdded() ... method.



- Do I need a PropertySheet when I only want to access/change/create/delete Items/Attributes from a RDBMS ??
 If yes: Which one 
(CommonInterfaceProp/DataSkinProp)
 If no: how do i Access/Change my Properties 
??

- and another Question related to 
this:
 Which object fires the Trigger-Event 
(ADDED/CHANGED/DELETED) ..
 is it the PropertySheet itself 
???


lots of questions still there but these are 
thepoints i really tried to get working .. but i did'nt..

hope that there is an answer ..

thanks in advance

Ulrich Eck
net-labs










[Zope-dev] Using LoginManager with SQL and SkinScript

2000-11-30 Thread Dan L. Pierson

I've put up a writeup of a different way to use LoginManager with SQL
that I think is a bit more in keeping with the current ZPatterns at:

http://www.zope.org/Members/dlpierson/sqlLogin

Any comments?  (I would have set this up as a formal HowTo, but
couldn't find a way to upload the contents.)

Dan Pierson



___
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 )




[Zope-dev] Custom Unauthorized errors...

2000-11-30 Thread John Eikenberry


With all the work going on related to Zope's authentication system has
there been any progress on allowing custom unauthorized errors? I'd refer
to the bug id in the collector, but it seems to be down at the moment.

I'm planning on using LoginManager which fixes this to a certain extent
last I heard... that is it will let you use a customized unauthorized error
when you know who the user is (ie. they've logged in), but not for
anonymous users.

Just out of curiousity (I'm looking at the source now to figure this out,
but I thought it couldn't hurt to ask), why is this? The anonymous user has
a user object, and so would seem to be a real user as far as the system
goes.

I'm tired of hacking custom unauthorized errors into zope all the time, so
I'd really like to get this fixed at some point. Any thoughts as to
directions to go, or dead ends to be avoided. I'll be looking into this as
I find time so any help would be appreciated.

-- 

John Eikenberry
[[EMAIL PROTECTED] - http://zhar.net]
__
"A society that will trade a little liberty for a little order
 will deserve neither and lose both."
  --B. Franklin

___
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] ZPatterns: using PythonMethods from Skinscript

2000-11-30 Thread Phillip J. Eby
At 04:39 PM 11/30/00 +0100, Ulrich Eck wrote: 

I've a db_sequence specialist who serves the Framework with
db_id's for new Records like:


May I suggest calling your Specialist "Sequences" or "Counters" since it appears that it returns objects which produce sequential integer  values?



>>> newid = db_sequence.getItem('sequence_name>').nextid
  
The Attribute nextid is provided by a Skinscript-Method:

WITH getNextId(seq_name=self.id) 
COMPUTE seq_name=seq_name,nextid=_.int(nextid)



I would not suggest using nextid as an attribute.  This should really be a method, e.g. getNextId().  The method should then return the result of calling Counters.getNextId(seq_name=self.id).

However, if you insist on using the above approach, your SkinScript should read:

WITH 
getNextId(seq_name=self.id)
COMPUTE 
nextid=RESULT['nextid'], seq_name=RESULT['seq_name']

Notice that since your Python method returns a dictionary, RESULT is a dictionary, not an object, so you have to retrieve the elements you want in your expressions that way.  Of course, you could just have getNextId() return an integer result, and use:

WITH getNextId(seq_name=self.id) COMPUTE nextid=RESULT
WITH SELF COMPUTE seq_name=id

to achieve the same effects.


  

My Second "little" Problem:


i'm not the first one who had problems to manage data with rdbms and zpatterns. i can get Attributes through SSMethods
easily and now tried to setup ADD/CHANGE/DELETED Rules to manage data.




Here my SSMethod for this(getEventById/insertEvent/updateEvent are ZSQL-Methods):


WITH QUERY getEventById(id=self.id) COMPUTE sid=_.int(id),name,time_start
WHEN OBJECT ADDED CALL insertEvent(id=self.sid)
WHEN OBJECT ADDED,CHANGED STORE sid,name,time_start 
USING  updateEvent(id=self.sid,name=self.name,time_start=self.time_start)
  


I access the Item through loadAttribute: "sid"
I set up a ZClass derived from Dataskin which acts as Storage-Class.
  
I call  
  
dtml-let ni="newItem(key=db.getItem('data_event').nextid)" nips="ni.propertysheets.get('Basic')">
dtml-var "nips.manage_changeProperties(REQUEST=REQUEST)">
/dtml-let>
and get back an empty object without any attributes (propertysheet-problem??)
the record in the database is created (but only because I reduced the ZSQL-Insert Method to id-parm only)
this again seems to be a Problem of the namespace I'm in while the _objectAdded() ... method.


Here's what you're missing.  There is no "sid" attribute when you add an object.  You need to add this to your SkinScript (assuming I'm guessing correctly what sid is supposed to be):

INITIALIZE OBJECT WITH sid=_.int(self.id)

Otherwise, your two ADDED triggers will execute with no value for the sid attribute.



- Do I need a PropertySheet when I only want to access/change/create/delete Items/Attributes from a RDBMS ??
If yes: Which one (CommonInterfaceProp/DataSkinProp)
If no: how do i Access/Change my Properties ??


Yes.  DataSkin Property sheets would be the ones you need to use.



- and another Question related to this:
Which object fires the Trigger-Event (ADDED/CHANGED/DELETED)  ..
is it the PropertySheet itself ???


When you change the attributes of the object, the action is logged for the trigger to fire at transaction commit time.  The Property Sheet is just a way to change the attributes.


___ 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] Return variables from a DTML Method

2000-11-30 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  I want to change some ZClass properties by getting return results 
  from a DTML Method. Something like this: dtml-call 
  "myzclass.propertysheets.get('Basic').manage_changeProperties(dtmlM
  eth(this(),_))". How do I get the dtmlMeth to return a Mapping? 
  (or should I be doing this a different way?)

dtml-return "{ 'a' : 1, 'b': 2, }"


There will be people that say, you should not do such things
in DTML.


Dieter

___
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] Return variables from a DTML Method

2000-11-30 Thread Tres Seaver

[EMAIL PROTECTED] asked:
 
 I want to change some ZClass properties by getting return results
 from a DTML Method. Something like this: dtml-call
 "myzclass.propertysheets.get('Basic').manage_changeProperties(dtmlM
 eth(this(),_))". How do I get the dtmlMeth to return a Mapping?
 (or should I be doing this a different way?)

You *could* return a dictionary from a DTML method:

DTML Method 'return_dict'::

  dtml-return expr={ 'foo' : 0, 'bar' : 1 }

DTML Method 'show_dict'::

  dtml-var standard_html_header
  h2dtml-var title_or_id dtml-var document_title/h2

  dtml-let dict=return_dict

  p Foo: dtml-var "dict['foo']"

  p Bar: dtml-var "dict['bar']"

  /dtml-let

  dtml-var standard_html_footer

but I can't imaging wanting to.  Try to rearrange your
stuff so that the code generating the mapping can call
'manage_changeProperties()' its own self, or else move
it to PythonScripts/PythonMethods/ExternalMethods/a Product;
you'll be glad you did.

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

___
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] jcNTUserFolder on 2.2.x

2000-11-30 Thread Michael Bernstein

Toby Dickenson wrote:
 
 On Mon, 20 Nov 2000 14:20:41 -0800, "Andy McKay"
 [EMAIL PROTECTED] wrote:
 
 Is there an updated version or product similar to jcNTUserFolder (allowing
 NT authenitcation in Zope) that works in Zope 2.2.x? Or am I going to have
 to upgrade jcNTUserFolder?

 API changes in 2.2 (and future developments, like PTK) make custom
 user folders less attractive than they used to be. If you intend
 committing some time to this then I recommend something based on
 http://www.zope.org/Members/tsarna/LoginManager
 
 The simplest change would be to transplant the authentication code out
 of (jc)NTUserFolder and into LoginManager methods. However that would
 still only run on NT.

Important:

After you get authentication working the way you want it,
you'll have to fix your LoginManager to integrate with the
existing local roles machinery. Here's a link to help you
out:
http://lists.zope.org/pipermail/zope-ptk/2000-September/001739.html

HTH,

Michael Bernstein.

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




[Zope] import/export

2000-11-30 Thread jacintha menezes

Hi,
Just to try , by using import/export i ported the product to another
windows 98 machine.I am able to open the whole folder in the ported machine.
The problem is i am not able to add a new record there using the existing
script.If write new script to add record to the same table it works . so why
it this happens like this  ?. Do we need to import any other files?.When i
add a record using existing scripts it asks for username  password.
when i type it , it doesn't take.

 Thanks,
   jacintha


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




[Zope] authentication II

2000-11-30 Thread Olaf Zanger

hi everybody,

after a long 10h struggle with installing and running zope i found some
interesting things. 

may anybody be able to explain these to me?

i run a suse7.0 system with a suse zope installation on 8080.
i changed the access file to a new account name.

with this account name i can do everything in zope, add users, add
files, copy, paste ...

if i add a new user i can not login for adding files ... 

aren't they made for that?
do i understand anything wrong? are they probably only for content
access?

in previous (non-suse) installations i was allowed to add users to the
acl_user with my superuser account but couldn't login to add files with
these new accounts.

greetings

olaf

-- 
soli-con Engineering Zanger
Dipl.-Ing. (FH) Olaf Zanger Nusch
Lorrainestrasse 23
3013 Bern / Switzerland
Fon: +41-31-332 9782
Mob: +41-76-572 9782
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
http://www.soli-con.com

begin:vcard 
n:Zanger;Olaf Marc
tel;cell:+41-76-572 9782
tel;work:+41-31-332 9782
x-mozilla-html:FALSE
url:www.soli-con.com
org:soli-con Engineering Zanger
adr:;;Lorrainestrasse 23;Bern;BE;3013;Switzerland
version:2.1
email;internet:[EMAIL PROTECTED]
title:Dipl.-Ing.
note;quoted-printable:IT-Consulting=0D=0AEmbedded Systems=0D=0AEnergy Systems=0D=0AOpen Source Solutions=0D=0A
x-mozilla-cpt:;-32176
fn:Olaf Zanger
end:vcard



Re: [Zope] VHost logs.

2000-11-30 Thread Rob Miller

Jason C. Leach wrote:

 hi,
 
 With Apache in front of zope, do you disable Medusa?

No.  Apache merely acts as a proxy server.  Apache gets a request, 
passes the request on to Zope, Medusa/Zserver serves up the results back 
to Apache, which then hands them out to the original requester.

 And do you need to
 set both Apache and Zope to have the vhosts (do I need to set up a vhost
 twice?).

In a manner of speaking, yes.  That is, Apache needs to have correctly 
configured VirtualHost directives to handle the requests from the 
outside world appropriately, and Zope needs to have the SiteAccess 
product installed with correctly configured SiteRoots and access rules. 
  It takes a little bit of time to figure out, but it works like a charm 
and is really quite simple, once you wrap your head around it.  There's 
a great HOW-TO on this at http://www.zope.org/Members/anser/apache_zserver.

Another benefit of this setup is that it can allow for both regular HTTP 
and SSL connections to all of your sites, so you can remotely access the 
manage screens without sending your passwords in the clear.  A HOW-TO 
for this lives at http://www.zope.org/Members/unfo/apache_zserver_ssl. 
I still haven't figured out a clean way to make it impossible to access 
sensitive areas UNLESS you're using SSL, however.  Anyone out there 
doing this?

-rob

 
 On Wed, 29 Nov 2000, Rob Miller wrote:
 
 
 Jason C. Leach wrote:
 
 
 hi,
 
 Has anyone implemented there own logging for Virtual Sites?
 
 I was thinking in the site rules an External Method could be called,
 passed the Request obj, and from that generate logs for virtual sites.
 
 If anyone has done that, or knows of a better way I'd be interested in
 hearing it.
 
 I'm not exactly sure what your goal is... but if you're just trying to 
 generate separate log files for each of your virtual sites, I'm accomplishing 
 that by having my virtual sites proxied behind Apache (using SiteAccess and 
 the ProxyPass directive) and specifying the log files for each VirtualHost in 
 my httpd.conf file.  You can control the contents of the logs using the 
 LogFormat directive; I use the same format for all of my virtual hosts, but I 
 think you can specify a different log format for each host if you desire.
 
 If you're trying to accomplish something else which requires you to handle the 
 logging on the Zope side of things, then it seems to me that your idea would 
 work, although I'd want to find out how my server performance would be affected...
 
 Hope this is useful for you,
 
 rob
 
 



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




Re: [Zope] Zope+PostgreSQL

2000-11-30 Thread Stephane Bortzmeyer

On Tuesday 28 November 2000, at 19 h 2, the keyboard of Robert Senger 
[EMAIL PROTECTED] wrote:

 The ZPoPyDA module refuses to work properly. 

Give at least your operating system and the traceback you get (I had good help 
from the list because I gave the details).

ZPyGreSQL works fine for me, on Debian (easily, thanks to the package) and on 
Tru64 (more difficult, but now I know the trick).




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




[Zope] How to remove Items from ZPatterns:Rack in the right way ?

2000-11-30 Thread iap_y2fun.com

Hi, I have a question about ZPatterns:Rack.
I got 10 items in a Rack and I want to remove those objects.
By reading Rack.py , I know that manage_pack can do this for me if
getItem(key) return None for those objects.
Well, how to return None?
One way I found is that: under "Storage" manage_tab, there is a option:

{Objects are:  loaded by accessing attribute  [x]}

assign x to be a "non-existing method", ie, any string except those
attributes' names.

Then, by clicking "remove orphaned slot" which triggers manage_pack.
I can see the counter of "Persistent slot in use" was reduced.
The question is that: why it reduced gradually? It doesn't reduce to 0 by
just one click.
I have to click it several times in order to remove all of them.
How does it happens? What's the right way to remove an item from a Rack?

Thanks a lot.

Iap,Singuan




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




Re: [Zope] ZCatalog: Query Syntax

2000-11-30 Thread Chris Withers

Chris McDonough wrote:
 
 The place to start might be to actually help write some documentation.
 There is a docs process description at
 http://dev.zope.org/Wikis/DevSite/Projects/DocumentationProcess/Documentatio
 nGuide .  This should at least give you an idea of how to proceed.

Doug,

If you make a start with this, I'll see if I can help (although the
problem is that while I use the catalog, I don't actually seem to know a
lot about how it works, because so little of it is documented). I'd love
to have a decent, working Catalog, but I'm under more than a little time
pressure with other things right now :-S

Chris

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




RE: [Zope] import/export

2000-11-30 Thread Cornelis J. de Brabander

Guessing that you mean a Gadfly table: you need to copy the table you need
from the ../var/Gadfly/.. directory to your other machine.
hth, cb

Cornelis J. de Brabander
==
Department of Education, Leiden University
P.O.Box 9555, NL-2300 RB Leiden
+31 71 527 3422/3401
[EMAIL PROTECTED]
==

 -Original Message-
 Just to try , by using import/export i ported the product to another
 windows 98 machine.I am able to open the whole folder in the
 ported machine.
 The problem is i am not able to add a new record there using the existing
 script.If write new script to add record to the same table it
 works . so why
 it this happens like this  ?. Do we need to import any other files?.When i
 add a record using existing scripts it asks for username  password.
 when i type it , it doesn't take.

  Thanks,
jacintha


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





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




Re: [Zope] VHost logs.

2000-11-30 Thread seb bacon

 In a manner of speaking, yes.  That is, Apache needs to have correctly 
 configured VirtualHost directives to handle the requests from the 
 outside world appropriately, and Zope needs to have the SiteAccess 
 product installed with correctly configured SiteRoots and access rules. 
   It takes a little bit of time to figure out, but it works like a charm 
 and is really quite simple, once you wrap your head around it.  There's 
 a great HOW-TO on this at http://www.zope.org/Members/anser/apache_zserver.

I would also point you to 

  http://www.apache.org/docs/vhosts/mass.html

for more info on the apache side, particularly this bit:

 The main disadvantage is that you cannot have a different log 
 file for each virtual host; however if you have very many virtual 
 hosts then doing this is dubious anyway because it eats file
 descriptors. It is better to log to a pipe or a fifo and arrange 
 for the process at the other end to distribute the logs to the 
 customers (it can also accumulate statistics, etc.).

 Another benefit of this setup is that it can allow for both regular HTTP 
 and SSL connections to all of your sites, so you can remotely access the 
 manage screens without sending your passwords in the clear.  A HOW-TO 
 for this lives at http://www.zope.org/Members/unfo/apache_zserver_ssl. 
 I still haven't figured out a clean way to make it impossible to access 
 sensitive areas UNLESS you're using SSL, however.  Anyone out there 
 doing this?

mod_rewrite is your friend.  You just make a Rule that redirects
anyone accessing your site on port 80 to port 443, something like
this:

VirtualHost 123.123.123.123
  ServerName www.foobar.com
  RewriteEngine on
  RewriteRule ^/(.*)https://www.foobar.com/
/VirtualHost

seb

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




Re: [Zope] authentication II

2000-11-30 Thread Hannu Krosing

Olaf Zanger wrote:
 
 hi everybody,
 
 after a long 10h struggle with installing and running zope i found some
 interesting things.
 
 may anybody be able to explain these to me?
 
 i run a suse7.0 system with a suse zope installation on 8080.
 i changed the access file to a new account name.
 
 with this account name i can do everything in zope, add users, add
 files, copy, paste ...
 
 if i add a new user i can not login for adding files ...
 
 aren't they made for that?

You can use them for anything ;)

What each can do is determined by their roles.

 do i understand anything wrong? are they probably only for content
 access?

What roles did you give to these new users ?

--
Hannu

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




Re: [Zope] User mangement

2000-11-30 Thread seb bacon

* Sven B. [EMAIL PROTECTED] [001130 10:34]:
 Zope has a function "get_valid_userids()".
 Now my question;
 How is it possible to get something like (username;role;path)?

sven,

refer to the ZQR:
  
  http://zdp.zope.org/projects/zqr/ZopeQR

and look for the section describing the AUTHENTICATED_USER object.

seb

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




[Zope] Why GUF or Loginmanager??

2000-11-30 Thread brocken22

Hallo,
I'got a fundamental question:
Why should you switch from the built-in authentication mechanism to a
product like GUF or Login-manager??
Except of the different login interface, I dosn't see any advantage??
Please correct me.
What I'm looking for is a product that redirects the authenticated-user to
the part of the website where he has got his "home-folder" and also nice
wolud be a search-function which gives an administrator a list of all the
users with all the roles in the system.

-- 
Sent through GMX FreeMail - http://www.gmx.net


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




[Zope] User mangement

2000-11-30 Thread Sven B.

Zope has a function "get_valid_userids()".
Now my question;
How is it possible to get something like (username;role;path)?

refer to the ZQR:
 http://zdp.zope.org/projects/zqr/ZopeQR
and look for the section describing the AUTHENTICATED_USER object.


Thanks seb,
but i need to get (username;role;path) for all users (i.e. 500) of a
zope site.
AUTHENTICATED_USER seems to be only for  the current user.

sven


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




[Zope] MySQL

2000-11-30 Thread K H Subrahmanyan

hi,
   I want to add MySQL to my ZOPE.

Please help me in installing it.

Please give the links, necessary information.

thanks
bye
subrahmayan.



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




Re: [Zope] MySQL

2000-11-30 Thread Chris Withers

K H Subrahmanyan wrote:
 
 hi,
I want to add MySQL to my ZOPE.
 
 Please help me in installing it.
 
 Please give the links, necessary information.

How about actually doing some work for yourself for a change rather than
expecting everyone else to do it for you?

Chris

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




[Zope] mysql zope

2000-11-30 Thread Alexander DePauli

Hi Zopistas!

we are looking for a method to do a better integration of mysql
3.23.27 with zope 2.2.2. (we are using the Z MySQL database adapter Z
MySQL DA 1.1.3.)

We have to store data in a mysql database - we can´t use ZODB 
because we need the data accessible by other programs via ODBC.

We habe implemented several ZClasses like "customer", "product" and
"orders". 
We store their instances (eg. each product, customer and so on) to the
mysql-database.  

Our problem: we can´t use the standard ZOPE management interface to
manage the
objects, because the methods of this interface store content to the ZODB
-
and not to the mysql-database. 

Is there a way to extend the standard ZOPE management interface with
additional mysql statements?
For example: we select an object in a zope folder, press the ZOPE
Delete-Button, then this
object is deleted on the mysql-database, not on the ZODB?

For each zclass (customer, products, orders) we need these extra methods
(Delete, Update, Insert ...), so our thought is that we would prefer to
use the ZOPE management interface to do this instead of programming
"extra methods" which obviously can't be used within the standard ZOPE
management interface.

Hope there is somebody out there with an similarly problem solved.

best regards

Ruediger
~
http://www.herrenausstatter.de - Der Online-Herrenausstatter
Kostenlose Serviceline: 0800 -999 66 33
Versandkostenfreie Lieferung - 30 Tage Rückgaberecht
~
Verwaltungsadresse:
DePauli.com Aktiengesellschaft
Stahlgruberring 3 - 81829 München
Telefon: 089 / 530 75 170 - Telefax 089 / 514 50 666

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




Re: [Zope] Why not normal acl_users?

2000-11-30 Thread Chris Withers

[EMAIL PROTECTED] wrote:
 
 Why should you switch from the built-in authentication mechanism to a
 product like GUF or Login-manager??

When you want to do something that the built in user folder can't, like
authenticate against usernames and passwords stored in an SQL table, or
and LDAP server, or if you want cookie-based authentication...

 What I'm looking for is a product that redirects the authenticated-user to
 the part of the website where he has got his "home-folder" 

why not just use and index_html DTML Method as follows:

dtml-call "RESPONSE.redirect('/Members/'+AUTHENTICATED_USER)"

...for example?

 and also nice
 wolud be a search-function which gives an administrator a list of all the
 users with all the roles in the system.

That's not going to be pretty, as that's an _awful_ lot of data ;-)

HTH,

Chris

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




Re: [Zope] Rookie Question - Syntax

2000-11-30 Thread Stephane Bortzmeyer

On Wednesday 29 November 2000, at 8 h 20, the keyboard of Eric Walstad 
[EMAIL PROTECTED] wrote:

 I like to let javascript handle the validation, it lightens the load a
 little on the server.  

You still need server-side validation, otherwise, a rogue user can set up a 
form which will allow invalid entries (or he can simply disable Javascript).




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




Re: [Zope] Fast Access.

2000-11-30 Thread Stephane Bortzmeyer

On Tuesday 28 November 2000, at 19 h 19, the keyboard of "Jason C. Leach" 
[EMAIL PROTECTED] wrote:
 
 Is there a faster way to access Zope? I find I wate too long for page
 refreshing and updates.

Several are documented. I like the Squid accelerator.

http://www.zope.org/Members/htrd/howto/squid
http://www.zope.org/Members/htrd/howto/caching



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




[Zope] Why Not Zope? 'Cos I like to bitch! ;-)

2000-11-30 Thread Chris Withers

Karim Yaici wrote:
 
 Hi guys,
 I found this article written by someone from Quixote concerning Zope,
 describing its weaknesses and possible future development
 http://www.amk.ca/python/writing/why-not-zope.html

This guy is quite far up his own arse :-)

It's probably more useful to work around the problems he describes
rather than bitching about them and telling people not to use Zope:

The 'no grep' is probably the most serious of his points. You can easily
get around it though, by using a ZCatalog. Admittedly, a decent search
and replace interface (which I'm plugging for on zope-dev ;-) would be
really nice (Zope 3? ;-)

No CVS is also a problem, but with the improvements in the History tab
and the like, this less of an issue. Besides, it's again easy to work
around by keeping CVS-ish stuff on the filesystem either by putting them
in python products or HTMLFiles. There's even ZCVSMixing should you
really be pedantic.

The test suite stuff is true for any web application, as has been
discussed on the XP lists (so I'm told ;-) That said, there's ZUnit and
PyUnit now, so I'm not sure that his opinion on this is valid at all.

His comments about DTML are all valid, but it's a choice he'd made to
write logic in DTML and he's a fool for doing so. IMNSHO, all 'logic'
should be kept in python and you should never need to use the "" in a
DTML tag. If you do, you're doing too much in DTML. Put it in a product
or one of Evan's new-fangled python methods (although these aren't
CVS'able, so I'd advise against it, unless is 'python scripting') If
used this way, DTML actually provides quite a nice scripting layer for
people who only understand/care about HTML, and there's the promise of
XHTML for the future.

He sees DTML's 'dynamic scoping' as a hinderance, it's actually one of
its strengths. Yes, it can be confusing, but maybe you should just write
code which doesn't make assumptions about variables, or handles the
cases when they're not there. The same is true of acquisition and the
namespaces concepts, maybe with better documentation, people like him
wouldn't have such problems.

Zope's built in FTP server is one of it's huge stengths, IMO. He hasn't
realised this and so bitches about it. You can always turn it off you
know! Likewise the HTTP server, run Zope as a CGI if you must! :P

Oh yeah, TTW editing does _not_ mean code has to live in the ODB as I've
already mentioned.

Of course, in being behind Quixote, this guy has an alternative motive
for slagging off Zope, but I do wish he wouldn't. In (almost) his own
words, he just wants a filesystem of python scripts to build his
website. Fine, but that doesn't solve a lot of people's problems and has
a lot of limitations, hence Zope came into being. Yes, it's a complex
beast but, if handled correctly, it'll save you loads of development
time and leaves you with a graceful, quick application that is
seperately configurable and scriptable, and has a _lot_ of code re-use.
I'm pretty sure this is true for the vast majority of web applications
but, of course, there are exceptions, although I'm not sure MEMS
Exchange is one of them ;-)

The one problem with Zope that he _should_ have mentioned is this: You
have to try pretty hard to write nasty code in Python, which si why it's
so great. Conversely, it's quite easy to build 'nasty' applications in
Zope that are messy and hard to maintain. Such is life, that's a
possibility I'm willing to live with for the power that Zope gives me.

cheers,

Chris

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




RE: [Zope] VHost logs.

2000-11-30 Thread Seb Bacon

 VirtualHost 123.123.123.123
   ServerName www.foobar.com
   RewriteEngine on
   RewriteRule ^/(.*)  https://www.foobar.com/
 /VirtualHost

of course i actually meant:

  VirtualHost 123.123.123.123
ServerName www.foobar.com
RewriteEngine on
RewriteRule ^/(.*)  https://www.foobar.com/$1
  /VirtualHost



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




[Zope] Presentation Object Model

2000-11-30 Thread Chris Withers

Paul Everitt wrote:
snip Skinnable and localisable
 
 Brian veto'd it, declaring it too ambitious.  He's basically waiting for
 Zope to better figure out how to keep presentation separate from the object
 model.

Been pretty quiet on the lists WRT HiperDOM, which I got the impression
was going to be about this. Are there any DC initiatives into this?

Lalo, any word from the trenches? ;-)

cheers,

Chris

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




Re: [Zope] Instance within Instance

2000-11-30 Thread Tim Cook

Daryl Stultz wrote:
 
 Tim Cook wrote:
 
  Daryl,
 
  Import the DarylProduct.zexp into your Products folder.
  The DarylExample.zexp can go anywhere in you Zope tree.
 
 As luck would have it, the file did not import into Products (File
 /usr/local/Zope/lib/python/OFS/CopySupport.py, line 406, in
 _verifyObjectPaste)
 
 It DID import into the root folder (I did this purely by accident!) I

Well, that shouldn't have happened. At least in previous versions
of Zope you could not import a Product into anything but the
Products folder.

 was then able to recreate the called-for classes and IT WORKED!! I
 haven't figured out HOW yet but I will. Thanks a lot for the help, and

Maybe this worked out better since you had to actually recreate
them g.
You're welcome.

 let me know if you need any fancy Python methods...

I will. s 

-- Tim Cook, President --
Free Practice Management,Inc. | http://FreePM.com
Office: (901) 884-4126
Censorship: The reaction of the ignorant to freedom.

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




[Zope] login dialog text

2000-11-30 Thread Ragnar Beer

Hi Zopistas!

When users connect to a restricted area a dialog box pops up that 
looks more or less like this:


Enter user name for Zope at myhost:
 User: _
Password: _


Where and how can I change the content of the first line so that it 
would e.g. read "Enter user name for funky stuff at myhost"?

Ragnar

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




Re: [Zope] Why GUF or Loginmanager??

2000-11-30 Thread Oliver Bleutgen

 Hallo,
 I'got a fundamental question:
 Why should you switch from the built-in authentication mechanism to a
 product like GUF or Login-manager??

You can choose the storage for your userdata yourself, 
which may be practical for i.e.

- huge user base and/or you also like to store adresses etc. easily.
- adding/changing users through mechanism outside of zope
- verifying users through mechanism outside of zope 
  (ie. apache's various mod_auth_*) for tasks outside of zope 
  (try to stream a .rm-file only to built-in authenticated users)


cheers.
oliver

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




Re: [Zope] Instance within Instance

2000-11-30 Thread Tim Cook

Daryl Stultz wrote:

 It DID import into the root folder (I did this purely by accident!) I
 was then able to recreate the called-for classes and IT WORKED!! I
 haven't figured out HOW yet but I will. Thanks a lot for the help, and

Maybe we COULD say the how is, "because it creates one object(
the folder) in the first call. Then the second object (the
document) in a seperate call. Since HTTP is stateless it requires
a seperate call for each activity."
The folder doesn't exist until after the first response. So you
can't GET it's context in the same call you create it in.

Make more sense?

-- Tim Cook, President --
Free Practice Management,Inc. | http://FreePM.com
Office: (901) 884-4126
Censorship: The reaction of the ignorant to freedom.

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




Re: [Zope] mysql zope

2000-11-30 Thread Steve Spicklemire


Hi  Ruediger,

You might consider ZPatterns. It allows you to develop
applications with ZODB, and then, later, 'easily' switch to
other forms of attribute storage for your objects.

-steve

 "Alexander" == Alexander DePauli [EMAIL PROTECTED] writes:

Alexander Hi Zopistas!

Alexander we are looking for a method to do a better integration
Alexander of mysql 3.23.27 with zope 2.2.2. (we are using the Z
Alexander MySQL database adapter Z MySQL DA 1.1.3.)

Alexander We have to store data in a mysql database - we can´t
Alexander use ZODB because we need the data accessible by other
Alexander programs via ODBC.

Alexander We habe implemented several ZClasses like "customer",
Alexander "product" and "orders".  We store their instances
Alexander (eg. each product, customer and so on) to the
Alexander mysql-database.

Alexander Our problem: we can´t use the standard ZOPE management
Alexander interface to manage the objects, because the methods of
Alexander this interface store content to the ZODB - and not to
Alexander the mysql-database.

Alexander Is there a way to extend the standard ZOPE management
Alexander interface with additional mysql statements?  For
Alexander example: we select an object in a zope folder, press
Alexander the ZOPE Delete-Button, then this object is deleted on
Alexander the mysql-database, not on the ZODB?

Alexander For each zclass (customer, products, orders) we need
Alexander these extra methods (Delete, Update, Insert ...), so
Alexander our thought is that we would prefer to use the ZOPE
Alexander management interface to do this instead of programming
Alexander "extra methods" which obviously can't be used within
Alexander the standard ZOPE management interface.

Alexander Hope there is somebody out there with an similarly
Alexander problem solved.

Alexander best regards

Alexander Ruediger ~
Alexander http://www.herrenausstatter.de - Der
Alexander Online-Herrenausstatter Kostenlose Serviceline: 0800
Alexander -999 66 33 Versandkostenfreie Lieferung - 30 Tage
Alexander Rückgaberecht ~
Alexander Verwaltungsadresse: DePauli.com Aktiengesellschaft
Alexander Stahlgruberring 3 - 81829 München Telefon: 089 / 530 75
Alexander 170 - Telefax 089 / 514 50 666

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


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




Re: [Zope] DC and the PTK?

2000-11-30 Thread Tres Seaver

Dennis Nichols [EMAIL PROTECTED] wrote:

 At 11/29/00 03:42 PM, ethan mindlace fremen wrote:
 Dennis Nichols wrote:
 
 At 11/28/00 11:34 AM, albert boulanger wrote:
 
 Whether to go with portal products from Plumtree or iPlanet.
 
 If this implies that you are considering using Zope's PTK, then you 
 should  be aware of this: You can *not* get commercial support from 
 Digital  Creations for PTK because PTK is not a released product. If you 
 think you  may need such support before PTK gets to 1.0, then you had 
 best not use the  PTK. But that's no reason to not use the rest of Zope.
 
 
 This needs to be clarified.   We actively do consulting with the PTK.
 If you want to enter into a consulting contract with Digital Creations 
 that involves the PTK, that's not a problem.
 
 If you decide you want to use the PTK yourself, there exists a mailing 
 list and a product tracker. (see http://www.zope.org/Products/PTK ) The 
 PTK is under heavy development and is not a full release yet, so that does 
 need to be taken into account if you wish to use it yourself.
 
 What Ethan says, however true it may be, is contrary to my experience. I 
 worked on developing a site based on PTK for several months and was within 
 a month of going live, but had problems I could not solve, either alone or 
 with the help of the mailing lists. I contacted DC via email, explained 
 what my problems were, and asked how to arrange for consulting time. That 
 was 11 weeks ago, on 10 Sept 2000. The very next day I received an email 
 from Gary Graham ([EMAIL PROTECTED], Director, Sales  Marketing) stating:
 
 "PTK is a 0.01 release and not commercially supported yet. Zope is
 commercially supported yet. Zope.org is the best PTK source at
 present until we are able to release a commercially supportable
 version."

I think we need to distinguish between "support" and "consulting".
DC is primarily a *consulting* company (we build custom software for
our clients), which also sells support contracts for Zope.  Because
the PTK is not (yet) a "released product", we don't (yet) sell support
contracts for it;  we *do* use it in consulting engagements, however.

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

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




[Zope] dtml-tree stuff

2000-11-30 Thread Mike Kelland



I think I may not have asked a specific enough 
question last time round. I'll try it again. I've been looking 
through the How-To's and the documentation and the dtml-tree stuff that I have 
found seems exceedingly cryptic. The closest that I've come to a solution 
is the following code:

dtml-in 
"getAllClientNames(REQUEST)"dtml-tree id=clientID 
branches_expr="getClientsForProjects(get_clientID=clientID)" 
dtml-var 
company_name/dtml-tree/dtml-in

where 

getAllClientNames looks like:

select company_name,clientID from 
client;

and getClientsForProjects looks like:

select company_name, clientID from client where 
deleted = 0 and clientID = dtml-sqlvar get_clientID 
type=int;

This gives me a tree structure which, when I expand 
company1 gives me company1 again and again 

(ie 

Company1
 
Company1
Company1
 
Company1
 
etc as deep as I care to go
Company2
 
Company2
 
etc
Company3
Company4

What I'm trying to do is list my company name as 
the tree branch and have the sub headings of each branch be my projects for that 
company. Can anyone help?

Thanks very much

Mike Kelland
[EMAIL PROTECTED] 



Re: [Zope] login dialog text

2000-11-30 Thread Ragnar Beer

Thanks a lot! Do you know whether it's also possible to set a folder 
based variable within Zope to allow for different messages when 
logging into different folders?

Ragnar

On Thu, 30 Nov 2000, Ragnar Beer wrote:

  Hi Zopistas!

  When users connect to a restricted area a dialog box pops up that
  looks more or less like this:

  
  Enter user name for Zope at myhost:
   User: _
  Password: _
  

  Where and how can I change the content of the first line so that it
  would e.g. read "Enter user name for funky stuff at myhost"?

you can put the following in your start script somewhere before the exec

Z_REALM='my funky stuff'
export Z_REALM

HTH,
Stefan

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




Re: [Zope] New Zope.org

2000-11-30 Thread Michael Bernstein

emf wrote:
 
 Zopatistas!
 
 Zope.org is finally living in its new home.
 
 Right now, you may be getting zope.org through the old apache, so don't
 be surprised if it's a tad slow.  By late tomorrow, just about
 everybody's dns should have updated to the new IP address.
 
 If you want to know, do a nslookup www.zope.org: you should get
 63.102.49.33 as your answer.
 
 When I finally wake up tomorrow, the first thing I'm going to do is
 start working on a write-up of what the new zope setup is all about.

Was this the 'stealth' project?

Michael Bernstein.

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




RE: [Zope] Why Not Zope? 'Cos I like to bitch! ;-)

2000-11-30 Thread Steve Drees

  I found this article written by someone from Quixote concerning Zope,
  describing its weaknesses and possible future development
  http://www.amk.ca/python/writing/why-not-zope.html
 
 No CVS is also a problem, but with the improvements in the History tab
 and the like, this less of an issue. Besides, it's again easy to work
 around by keeping CVS-ish stuff on the filesystem either by putting them
 in python products or HTMLFiles. There's even ZCVSMixing should you
 really be pedantic.


Or put the business logic methods in a LocalFS and use CVS on the files.




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




Re: [Zope] python methods

2000-11-30 Thread The Doctor What

* Tres Seaver ([EMAIL PROTECTED]) [001130 09:06]:
 Chris Withers [EMAIL PROTECTED] wrote:
 'lambda' is actually a keyword, not a function, and hence works
 fine in PM0.1.7.  'map()', 'filter()', et al., were deemed to
 be susceptible to being used in DOS attacks, and hence are not
 permitted in through-the-web code (they would need to be added
 to the '_' namespace, like 'str()', et aliae).

For those of us who are trying to figure out everything at a low
level, where would this be in the source?

Ciao!

-- 
When a trainstation is were a train stops what is a workstation?

The Doctor What: Un-Humble   http://docwhat.gerf.org/
[EMAIL PROTECTED]   KF6VNC

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




RE: [Zope] date in Z Gadfly Database

2000-11-30 Thread Farrell, Troy

Note that Gadfly does not support the DATE datatype.  You can use VARCHAR to
store a string, or switch to a different database, such as PostgreSQL (my
personal preference) or MySQL.  The answer to your question is found here:

http://www.chordate.com/kwParsing/gadfly.html#table

The main Gadfly pages are here:

http://www.chordate.com/gadfly.html

Troy

 -Original Message-
From: Angietel [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 23, 2000 2:16 AM
To: [EMAIL PROTECTED]
Subject: [Zope] date in Z Gadfly Database


When i create a table, one of the fields is consider as date type, but the Z
Gadfly Database does not allow me to do that, it only accepts INTEGER
instead of DATE type.

The following is my SQL for creating a table:-

CREATE TABLE customer
(custid VARCHAR(10),
custname VARCHAR(15),
custactdate DATE,
custadd1 VARCHAR(30),
custadd2 VARCHAR(30))

 
Please let me know if i got an error.Thank You.

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




Re: [Zope] dtml-tree stuff

2000-11-30 Thread Stuart Foster

I have a similar need and have found the How-To's cryptic also. I too get 
company1 over and over.

Original Message dated 11/30/00, 3:12:00 PM
Author: Mike Kelland [EMAIL PROTECTED]
Re: [Zope] dtml-tree stuff:


I think I may not have asked a specific enough question last time round.  
I'll try it again.  I've been looking through the How-To's and the 
documentation and the dtml-tree stuff that I have found seems exceedingly 
cryptic.  The closest that I've come to a solution is the following code:
 
dtml-in "getAllClientNames(REQUEST)"
dtml-tree id=clientID 
branches_expr="getClientsForProjects(get_clientID=clientID)" 
dtml-var company_name
/dtml-tree
/dtml-in
 
where 
 
getAllClientNames looks like:
 
select company_name,clientID from client;
 
and getClientsForProjects looks like:
 
select company_name, clientID from client where deleted = 0 and clientID 
= dtml-sqlvar get_clientID type=int;
 
This gives me a tree structure which, when I expand company1 gives me 
company1 again and again 
 
(ie 
 
Company1
Company1
  Company1
Company1
  etc as deep as I care to go
Company2
Company2
etc
Company3
Company4
 
What I'm trying to do is list my company name as the tree branch and have 
the sub headings of each branch be my projects for that company.  Can 
anyone help?
 
Thanks very much
 
Mike Kelland
[EMAIL PROTECTED] 

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




[Zope] sqlgroup

2000-11-30 Thread Tom Deprez

Hi,

Is there a reason why the attribute 'having' doesn't exists?

I want to use 

dtml-sqlgroup having
  dtml-sqltest ... optional
/dtml-sqlgroup

this way when the sql-test tag contains nothing, also the having clause is
not attached to the query.

Why does 'where' exists and 'having' not? Is there another way to mimic
'having'?

Thanks, Tom.

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




Re: [Zope] VHost logs.

2000-11-30 Thread Rob Miller

seb bacon wrote:

 Rob Miller wrote:



 In a manner of speaking, yes.  That is, Apache needs to have correctly 
 configured VirtualHost directives to handle the requests from the 
 outside world appropriately, and Zope needs to have the SiteAccess 
 product installed with correctly configured SiteRoots and access rules. 
   It takes a little bit of time to figure out, but it works like a charm 
 and is really quite simple, once you wrap your head around it.  There's 
 a great HOW-TO on this at http://www.zope.org/Members/anser/apache_zserver.
 
 
 I would also point you to 
 
   http://www.apache.org/docs/vhosts/mass.html
 
 for more info on the apache side, particularly this bit:
 
  The main disadvantage is that you cannot have a different log 
  file for each virtual host; however if you have very many virtual 
  hosts then doing this is dubious anyway because it eats file
  descriptors. It is better to log to a pipe or a fifo and arrange 
  for the process at the other end to distribute the logs to the 
  customers (it can also accumulate statistics, etc.).

This document refers to handling situations where you have a very large 
number of virtual hosts and don't want a separate VirtualHost directive 
for each one (because they're all very similar).  This is not my case, 
but it could be the original poster's.  You certainly CAN log to 
different log files if you have a VirtualHost directive for each host; 
I'm doing so.

 
 
 Another benefit of this setup is that it can allow for both regular HTTP 
 and SSL connections to all of your sites, so you can remotely access the 
 manage screens without sending your passwords in the clear.  A HOW-TO 
 for this lives at http://www.zope.org/Members/unfo/apache_zserver_ssl. 
 I still haven't figured out a clean way to make it impossible to access 
 sensitive areas UNLESS you're using SSL, however.  Anyone out there 
 doing this?
 
 
 mod_rewrite is your friend.  You just make a Rule that redirects
 anyone accessing your site on port 80 to port 443, something like
 this:
 
 VirtualHost 123.123.123.123
   ServerName www.foobar.com
   RewriteEngine on
   RewriteRule ^/(.*)  https://www.foobar.com/
 /VirtualHost

I don't want to force ALL access to port 443, only certain sections of 
the site which require authentication to access.  I guess the above 
still holds true (your correction in a later message is noted), I just 
need to get more creative with my rewrite rules.  Thanks for the tip.

-rob


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




Re: [Zope] Why Not Zope? 'Cos I like to bitch! ;-)

2000-11-30 Thread Cees de Groot

Andy McKay [EMAIL PROTECTED] said:
The heavy lifting, logic and anything more should be in python. I won't
pretend its particularly easy Zope hurt quite a lot some times, but we got
there..

I think this is the biggest problem of Zope. Contrary to Python, Zope
makes it /hard/ to do things the simple, clean, correct way. The easiest
way to add behavior to Zoplications is to add more DTML tags to your
web pages; the second-easiest way is Python methods but it's not clear
to a lot of people what the calling semantics are; still a bit harder
is to write special ZClasses with Python methods that encapsulate your
behavior (you can only add ZClasses at one point in the tree, and that's
always /not/ the point you are doing all the other work), and the hardest way
is to separate stuff out in products (which means, as far as I understood
it, hitting lots of "Restart" buttons and certainly means that you loose
the multi-versioning capability of ZODB. 

There are lots of similarities between Zope and Smalltalk. Just gimme 
a decent class browser! ;-)

-- 
Cees de Groot   http://www.cdegroot.com [EMAIL PROTECTED]
GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD  1986 F303 937F E098 9E8B

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




[Zope] Finding PARENTS in an external method.

2000-11-30 Thread Max M

I have an external Method. How do I call PARENTS[-1] from it?
in dtml it would be: dtml-in "PARENTS[-1].objectValues('Folder')"

I have tried something like:
self.PARENTS[-1].objectValues('Folder')

I have also checked if PARENTS get passed to the method like:
myMethod(self, PARENTS=None):

To get a list of the root's Folder's, but no luck.

Regards Max M

Max M. W. Rasmussen,Denmark.   New Media Director
private: [EMAIL PROTECTED] work: [EMAIL PROTECTED]
-
Specialization is for insects.  -  Robert A. Heinlein

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




Re: [Zope] Finding PARENTS in an external method.

2000-11-30 Thread Andy McKay

PARENTS is part of REQUEST so:

def test(self, REQUEST):
msg = ''
for parent in REQUEST.PARENTS:
msg = msg + str(parent.absolute_url()) + 'br'
return "%s" % msg

Is a convoluted way of listing parents urls...
--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "michael angelo ruberto" [EMAIL PROTECTED]
To: "Max M" [EMAIL PROTECTED]; "Zope@Zope. Org" [EMAIL PROTECTED]
Sent: Thursday, November 30, 2000 3:19 PM
Subject: RE: [Zope] Finding PARENTS in an external method.


 hi, Max

 i tried this and it works. the output is pretty ugly if you return it to
 Zope though. maybe someone knows how to clean it up.

 def index(self, PARENTS, REQUEST):
 n = PARENTS[0].objectItems(['File','DTML
Document','Folder','ListMate','DTML
 Method'])

 n.sort()
 #n.reverse()
 return n

 this example just sorts the list and sends it back. you can remove the
 sorting code. i named this method index_list and called it as such:

 dtml-var "index_list(PARENTS, REQUEST)"

 Michael Angelo Ruberto
 Webmaster, Webmind Inc.
 www.webmind.com

 ps: if you run this example look at the HTML source for results page. you
 should see something interesting like this:

 ('C_document', DTMLDocument instance at 012E44E0),

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Max M
 Sent: Thursday, November 30, 2000 5:50 PM
 To: Zope@Zope. Org
 Subject: [Zope] Finding PARENTS in an external method.


 I have an external Method. How do I call PARENTS[-1] from it?
 in dtml it would be: dtml-in "PARENTS[-1].objectValues('Folder')"

 I have tried something like:
 self.PARENTS[-1].objectValues('Folder')

 I have also checked if PARENTS get passed to the method like:
 myMethod(self, PARENTS=None):

 To get a list of the root's Folder's, but no luck.

 Regards Max M

 Max M. W. Rasmussen,Denmark.   New Media Director
 private: [EMAIL PROTECTED] work: [EMAIL PROTECTED]
 -
 Specialization is for insects.  -  Robert A. Heinlein

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


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



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