RE: [Zope] 2.3 and Products

2001-01-26 Thread Max Møller Rasmussen

From: Chris McDonough [mailto:[EMAIL PROTECTED]]

>This is not true.  The behavior is the same as before... the plans to make
>restart optional were waylaid by complications.  ;-(

Another thing with products. Whenever I do a referesh with the refresh tab,
another instance of the product shows up in my "add" dropdown selector. So
If I have a "maxms goodstuf" product that i am editing I get a select box
like:

Dtml Document
Dtml Method
Folder
maxms goodstuf
maxms goodstuf
maxms goodstuf
maxms goodstuf
maxms goodstuf
maxms goodstuf
maxms goodstuf
Catalog

After a little while.

Is there a solution to this?

Regards Max M

___
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] Getting an object from it's id

2001-01-23 Thread Max Møller Rasmussen

From: Geoff Armstrong [mailto:[EMAIL PROTECTED]]

>In DTML there doesn't seem to be a way of saying, "I have this string with
>the name of an object, now fetch me the object."

Shure there is:



As far as I remember.

regards Max M

A snippet I use somewhere:






___
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] Form data type coercion syntax and javascript

2001-01-17 Thread Max Møller Rasmussen

From: Mayers, Philip J [mailto:[EMAIL PROTECTED]]

>Not a problem per-se, just a query - how are people dealing with things
like
>this:

snipped lots of stuff...

>Anything more elegant?

I don't know if it is something like this you mean:

self.document.form['test:list'].value = 'stuff to fill in';

or perhaps?

self.document.form['test:list'] = new Option("Red"+i,"color_red");

regards Max M

___
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 Versus Enhydra Comparison article

2001-01-17 Thread Max Møller Rasmussen

From: Chris Withers [mailto:[EMAIL PROTECTED]]

>> problem. Zope is more closed in that regard. Well anyways when you know
>> enough about Zope to make a hack, you probably also know how to do it the
>> right way.

>Sadly, that's true, but changing I think...

Oh don't misunderstand me. I am just about getting over the "Zope wall" and
it has been well worth the climb. 

Everything is so much faster than in any other system I program in. OK a
hitcounter I could probably do faster in php or asp, but that's not really
the problems I try to solve.

For real world web application I have yeat to see anything beat Zope/Python.

You just got to accept to do it the "Zope way" or you will be in a world of
pain. :-)

People like me who has used asp, php etc. for years has better forget what
we know when starting on Zope, and then take it 1 step at a time.

Sometimes in the process I have been so tired of Zope and tried to think out
a smarter way to do things and then after having a heureka moment when I get
a brilliant idea, I have nearly allways thought a little bit harder about it
and discovered that Zope usually does it that way allready.

So learn to live with the quirks and Just Do It.

Regards Max

   (Zope on)

___
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 Versus Enhydra Comparison article

2001-01-17 Thread Max Møller Rasmussen

From: Ron Bickers [mailto:[EMAIL PROTECTED]]

>> Using Zope we knew that we would reach situations which may be
>> unresolvable in the short term, and could not make significant business
>> decisions with so many unknown factors and lack of any way to circumvent
>> problems.

>What in the world does that mean?!?  Maybe it should read "We don't know
how
>to use Zope or code in Python."

No it probably means that in enhydra they can solve any problem with brute
force, just like you can in asp and php.

Ie. if you have trouble understanding the security mechanism in Zope you are
lost until you understand it.

If you have trouble with the Enhydra security mechanism, you can allways
write your own.

Sometimes you can get stuck in Zope for days, without knowing how to
proceed, or without knowing how to find out, because you simply got to do it
the Zope way. In a commercial setting that is very dangerous when you work
on a deadline.

In a simpler system you have to do more yourself, but you won't be painted
into a corner as easily, as you can allways do a "hack". to solve your
problem. Zope is more closed in that regard. Well anyways when you know
enough about Zope to make a hack, you probably also know how to do it the
right way.

But it's only a matter of documentation AFAIK.

Regards Max M

___
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] My Add list is so full...

2001-01-16 Thread Max Møller Rasmussen

From: Francois-regis Chalaoux

>Since long time ago I have this reflexion.  Now I have installed so many
>thing in Zope the add list combobox is huge :

>There are too many meta-type item in add list. Is is possible to
>organize sublist of meta-type into  products sublist ?

aha ...

Max M's law $1:

"Anything that is a list in a userinterface will eventually need to evolve
into a tree."

Well that doesn't help much, but at least your problem has a name now.

Other than that there is nothing to do about it.

Regards Max M ;-)

___
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] ZClasses meet PythonScripts, sample request

2001-01-16 Thread Max Møller Rasmussen

From: Timothy Wilson [mailto:[EMAIL PROTECTED]]

>> You have id as a form variable.  You will be disappointed by its
>> behavior.

>Care to elaborate on the problems with using id as a form variable.

You can be easily bitten by acquisition on this.

If you call a dtml-method that wants to use your "id" variable from the form
and you do:  it will return the id of the zClass that the
method is in. If you use the form from a dtml-document you will get the id
of that. Under no circumstances will you get the variable from the form.

To get the id from the form you will have to use this idiom:



or





Regards Max M

___
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] Design Q: Product vs. External Methods

2001-01-15 Thread Max Møller Rasmussen

From: Oleg Broytmann [mailto:[EMAIL PROTECTED]]

>   I can assure it is. I run zope.net.ru in debug mode, and did debugging
>of an External Method that draw the left column. After I modified the
>source file Zope reread it, sure.

I have never had problems with that either. It autorefreshes nicely.

regards Max M

___
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 do I authenticate through pcgi and win2000 ????

2001-01-15 Thread Max Møller Rasmussen

I have installed zope on port 8080 on a win 2K machine.

It runs nicely, but due to firewalls and other reasons it has to run on port
80. So I have added zope.pcgi etc. to the IIS. And it runs nicely.

But when I try to use a manage page I cannot log in without being a member
of the win2K domain, and that is not feasible in this case. I have tried all
setting, I think.

Is there any way to do it?

Should I make my own authentication page so users can log on through a form?
If so how is this done?

Regards Max M

___
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] MySQLDA and images beeing corrupted

2001-01-12 Thread Max Møller Rasmussen

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]

>Any ideas?
>I feel like I am *so* close to making this work!

It sounds like you have some sort of escape problem, with special characters
being handled as text.

Don't you have to treat the image as text when inserting them into mySQL and
then escape special characters? I betcha there is a special function for
that. Try it.

regards Max M

___
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] Design/DTML question

2001-01-10 Thread Max Møller Rasmussen

From: Timothy Wilson [mailto:[EMAIL PROTECTED]]

>Right now, I've got the dates stored in a TinyTable. I can iterate through
>that list and generate the links, but I can't figure out how to display the
>table in two columns.












 








regards Max M

___
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] get property of type 'list'

2001-01-10 Thread Max Møller Rasmussen

From: Andrei Belitski [mailto:[EMAIL PROTECTED]]

>I add a list property to a DTML document of type 'tokens' (e.g. '[1, 2,
>3]') wenn i try to retrieve it with _.getitem i get '[1,' '2,' '3]'
>instead of '1' '2' '3'

>How can I get Zope to interpret my property like a list not a string or
>whatever else?

Actually it IS treating it as a list:

 Should return '1'

This should list each item:






Regards Max M

___
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] Multiple select boxes saves selected id's even though the Objectsare deleted. are deleted.

2001-01-09 Thread Max Møller Rasmussen

I have a zClass with a multiple selection. The selected items are selected
from a list of id's from a folder. 

They are then saved in the zClass as a list of strings.

But when one of the selected items on the folder is deleted the id is still
in the zClass.

Naturally it should be deleted from the "selected" list automatically, but I
don't think that is feasible. I would have to traverse a lot of different
subfolders to see if an object was selected there.

Is there a standard idiom for doing this?

(Don's say zPatterns please as this won't help here.)

Regards Max M

--
Another way of explaining the same problem is here:

Folder1
   item1
   item2
   item3
   item4

selectBox = ['item1', 'item2', 'item3', 'item4']

selected = ['item1','item2']

After delete of item1 from Folder1

Folder1
   item2
   item3
   item4

selectBox = ['item2', 'item3', 'item4']

selected = ['item1','item2']

The problem is that 'item1' still is in selected.

___
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] [Newbie] Can Zope ...

2001-01-09 Thread Max Møller Rasmussen

From: Smith Ray [mailto:[EMAIL PROTECTED]]

>The cost thrown up in the air was in the order of $AUS20,000 for a 
>3 year rental, per site (At the moment that is about $US35,000)
>When you start talking dozens of sites you quickly start looking
>for alternatives!

Zope can easily do most all of the things you mention in zClasses. The most
difficult items you are requesting though is calendaring and discussion.
Currently there are no real good products available so I guess you will have
to roll your own in a Python Product, and that can be a bit difficult to
learn.

The rest sounds like a 2-4 weeks job. maybe 4-6 weeks if depending on how
newbie you are :-)

For me the biggest bonus about Zope vs. closed system is not the $ savings
but the gained flexibility and freedom. It might take a little longer to set
up your own system in zope, but You will know it by heart afterwards and can
easily change the sites.

Regards Max M

___
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] Job listings?

2000-12-22 Thread Max Møller Rasmussen

From: Jiva DeVoe [mailto:[EMAIL PROTECTED]]

>Is it inappropriate to post a job listing looking for Zope
>knowledgable coders on this list?  I don't see anything in the list
>charter about it, but I don't want to be rude.  Let me know!  Thanks!

It happens from time to time, and I have seen no protests against it.

I guess that as long as it doesn't fill the list nobody minds.

Regards Max M

___
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] Dreamweaver, webdav and Zope

2000-12-15 Thread Max Møller Rasmussen

I have just upgraded to DreamWeaver 4.0. Lo and behold, it has webDav
support.

I can open the site in DreamWeaver and it looks just great. It would be a
really, I mean REALLY, nice management interface for Zope.

Two problems though:

1) I cannot open my dtml methods in Dreamweaver as they have no
extensions. Appart from giving them extensions has anybody had succes with
this in Dreamweaver? I can solve it by dragging them onto an empty page, but
that ain't to neat. It also only gives the code view.

2) The files that DreamWeaver gets over is rendered html files. So it is
not actually dtml, but the html resulting from the dtml method. Anybody has
a clue to why this is?

Regards

Max M

___
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] ZPatterns

2000-12-08 Thread Max Møller Rasmussen

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]

>Hmm, maybe it's the time for a translate-zPatterns-to-english effort?

I'll give it a try:

Normally you talk about multi tier applications, when talking about
something like zPatterns.

Say you want to make a website where users can write articles and comments,
like Slashdot. Then in asp, or to a lesser degree Zope you will write your
application in some sort of template language. VBScript or dtml.

New programmers will mix together persistence, presentation and logic all
over the place. That is a bad idea.

When you get a little better at programming you make classes that handles
database connections, classes that handles the business logic and classes
that handles the layout. 

So in this case you will make a user table in your SQL database, an article
table and a comment table. Then you will make some logic to controll it, and
some code to view it.

This is a three tier system. zPatterns adds a few more tiers and sugar on
top.

Normally in Zope you would make an folderish article Python product or
zClass that can contain comments. And also you would make a Python product
or zClass for users. Saving their names, email, webadresses, list of
articles or whatever.

All fine and dandy. But say instead of using the ZODB for storing user data
that you want to use the database that the company allready have with
employees??? You would have to rewrite your Python product or zClass from
scratch.

To avoid this zPatterns use an anbstraction of a table called a "Rack". If
you define this Rack how it is implemented at the backend doesn't matter. It
can be an SQL database, or saved in the ZODB. The important thing is that
you allways acces the Rack the same way so any other part of your
application don't have to change when you change storage backend.

Often you want to look at data in different ways. You have your database,
your logic, and different ways to look at the data. This is called the
"Model View Controller" principle in standard Geek talk.

You use it to avoid duplication of data. The "DRY" principle (Don't Repeat
Yourself). When I see an article I also want see all comments made to this
article. Furthermore when I see a user, I also want to see the comments that
this user has made and all the articles that he has written.

Naturally you don't just copy the list of comment's to the article or the
user. This would cause redundancy and bad problems when you change values in
the original data. You make a new combined view of your model instead, where
you join articles and comments on one page. So data from two different racks
can be viewed in one place. In zPattern lingo this is called a "Specialist".
But a "view" by any other name still smells as sweet.

To use these two nice abstractions in Zope it has to work a little more Zope
like. Often when making a zClass you use a folderish object. the zPattern
folder is called a "PlugIn". It can have properties just like a normal
zClass. 

In zPatterns the interface or "property sheet" used for handling the values
in a single item in a rack. (What would be a single row in an SQL table) is
called an "AttributeProvider".

When you combine the content of one or more racks into a new Specialist (or
view, remmeber?) you use a "SheetProvider" to edit the data. This is what
would be a normal management interface in a typical web application.

Anyhoo, this is how I unerstand it.

But I must add that I have never used zPatterns, This is all from how I
understand the documentation, the Wiki etc combined with my limited
knowledge of computer science.

Hope this helps.

Regards Max M

___
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] Indirect addressing

2000-12-07 Thread Max Møller Rasmussen

From: Ragnar Beer [mailto:[EMAIL PROTECTED]]

>+ myfolder
>   index_html
>   my_external_method
>   dtml_method_1
>   dtml_method_2
>   ...

>In index_html I want to include either dtml_method_1 or 
>dtml_method_2, ... (one method for every week of year). 
>my_external_method tells me which dtml_method to include.
>This would logically be handled with "my_external_method>>" in index_html but this doesn't work.

Something like this ought to work:



This is a no-no, as you cannot have nested dtml:

my_external_method>>

Regards Max M

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

2000-12-06 Thread Max Møller Rasmussen

From: Mark A. Pappas [mailto:[EMAIL PROTECTED]]

>after the -D. In the start.bat. I tried all kinds of things and never was
>able to get zope up on port 80 as a web server (www.whatever.com_ or
>XXX.XXX.XXX.XXX). What am I missing?

Your approach sound about right.

Perhaps you are running another webserver at port 80? Have you got Apache or
IIS running on your machine allready, chances are that they are using port
80 allready creating a conflict.

Regards Max M

___
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] "Simple" site - hard to make ?

2000-12-05 Thread Max Møller Rasmussen

From: Michael Jenner [mailto:[EMAIL PROTECTED]]

>Is this easy to do in Zope or ??

VERY easy if you know how. But it also depends on you abilities

Regards Max M

___
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] The not-very-Super user

2000-12-04 Thread Max Møller Rasmussen

From: Brian Lloyd [mailto:[EMAIL PROTECTED]]

>Yes - the whole lame login-as-superuser-create-a-manager-and-relogin 
>process will be gone in 2.3. At install time you'll create a first 
>manager and just use that. A "superuser" will not even exist, unless 
>and until you need it and explicitly create it.

Any timeframe on that 2.3 beast?

regards

Max M

___
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] How to use newline_to_br?

2000-12-04 Thread Max Møller Rasmussen

From: Roland C. Reumerman [mailto:[EMAIL PROTECTED]]

>- in the response method there is a 

You are allmost there:



Should do it for you

Regards Max M

___
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] how to display contents of a folder?

2000-11-24 Thread Max Møller Rasmussen





-Original Message-
From: Andrei Belitski [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 24, 2000 3:16 PM
To: [EMAIL PROTECTED]
Subject: [Zope] how to display contents of a folder?


Hi
I would like to display contnent of a zope folder on my HTML-page
preferrebly only the DTML Documents of a particular folder, how can I do
it?
Thank you very much in advance
Andrei

___
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] Search and replace

2000-11-20 Thread Max Møller Rasmussen

From: seb bacon [mailto:[EMAIL PROTECTED]]

>I was about to add my voice to this thread, and say:

>  what's wrong with emacs s/r (or whatever your favourite ftp-aware
>  editor is)?

>Then I had to do something like Max's example, across 12 different
>docs, and changed my mind...

>There's probably a sage snippet of knowledge to be gleaned from this,
>but I'm not sure what it might be ;)

Something like this perhaps?

http://www.zope.org/Members/pje/Wikis/ZPatterns/InformationHiding


;-) 

max

___
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] Search and replace

2000-11-20 Thread Max Møller Rasmussen

From: Martin Winkler [mailto:[EMAIL PROTECTED]]

>Another thought: If Zope would offer s/r, then a bunch of programmers
>would stick in their bad behaviour _not_ implementing 's, because
>"it's easy and effortless to replace everything from 'Copyright 2000' to
>'Copyright 2001'". But think of it: Maybe this string is correct somewhere 
>and SHOULD stay the same. So s/r is at least inefficient, because you'd 
>have to check every file whether Zope should replace or not.


try and do this correctly:


The customer is: 


Search: "customer"
Replace: "buyer"

U ... can of worms

Max M

___
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] chapter 5 Zope book - problems with the examples

2000-11-16 Thread Max Møller Rasmussen

You have an aquisition/namespace problem.

If  is used in a document like an index_html
dtml-document, It tries to find the objecValues in that document. But a
document is not a folder.  So the list will be empty.

So is your index_html a document or method? Try changing it to a method, as
a method doesn't have it's own namespace and will look in the nearest
aquired namespace. Hopefully a folder.

Or use a more direct approach bu telling what folder you want to see
objectValues from.


  


Regards
Max M

-Original Message-
From: Lee Reilly CS1997 [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 16, 2000 2:41 PM
To: [EMAIL PROTECTED]
Subject: [Zope] chapter 5 Zope book - problems with the examples


Hi,

I'm going through the examples in Chapter 5 of the Zope book and am
having some problems. For those of you familiar with it, it is the 'Zope
Zoo' example.

Can anyone help me out?

1 - I create a DTML method called navigation as follows:



  



2 - On viewing this method it works fine - a hyperlink to all
sub-folders appears in the browser.

3 - I add '' into my standard_html_header so it
reads:



ZAPHOD - zopetastic!




If your name is Lee then click here to
login. 



4 - On viewing index.html (containing header & footer) everything except
the navigation method appears. Viewing the source of index.html reveals
that the  tags are created... just no  elements.

5 - The HTML is fine... all tags closed & in te right place.

Can anyone see a problem?

Thanks in advance for any replies. My appologies also for such a long
post.

- Best regards,
Lee Reilly

___
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] ZClasses on top of my Python classes?

2000-11-15 Thread Max Møller Rasmussen

From: Randall Kern [mailto:[EMAIL PROTECTED]]

>I've seen several doc tidbits suggesting one create ZClasses derived from
their 
>Python classes, sticking all the biz logic in the python classes, and the 
>presentation in the ZClasses...

>Could someone provide some insight into why this is better than simply
writing 
>separate python classes for logic and presentation?  (Although I have to
admit 
>hitting the "Restart Server" button every time I make a typo is getting
old)

Well one thing is that it clearly separates logic from presentation, and if
you know zClasses it is easier to get started with while stille being nice
to program in Python.

You can reuse the same Python logic and give it several different interfaces
in several zClasses.

Regards Max M

___
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] Test - Is both the maillist and www.zope.org down?

2000-11-13 Thread Max Møller Rasmussen

???

___
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] Can't delete products

2000-11-08 Thread Max Møller Rasmussen

From: Stephan Goeldi [mailto:[EMAIL PROTECTED]]

>I deleted some products in Control_Panel several times. Some are gone (ok),

>some stay and seem to be undeletable. I'm sure someone shows me the way to 
>delete it from the command line (it's Zope 2.2.2 on RedHat Linux).

You should also delete the products from your product directory.

Maybe that is the problem?

regards 
Max M


___
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] asked a million times again...

2000-11-08 Thread Max Møller Rasmussen

> Okay, I got the  to work right assuming that that
> files are arranged properly according to aquistion, but then when I
> try to get the file from another folder like
> 
> 
> 
> It displays the code of that page rather thatn recognizing that it is
> content. What should I do?

Perhaps  will do? It executes the method
"filname()" and returns the result.

Regards Max M

___
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] Dump .zexp export to readable source?

2000-11-08 Thread Max Møller Rasmussen

From: Robin Becker [mailto:[EMAIL PROTECTED]]

>>zClasses are not written in Python so there is no code to see. Except fot
>>the dtml code and you can see that when you have imported a zClass
product.

...
>I disagree strongly. Many of the useful coding tools need line oriented
>Ascii text; where is diff or grep for my ZClass code. The XML export
>form would do except that the differences caused by ordering/numbering
>mean that diff reports many irrelevant differences. Zope loses by not
>having a decent external storage mechanism for its programming.

Whoa there ... I didn't say anything you could disagree with. I just stated
facts. But I do agree that writing software in Zope is a problem for me too.
I would also like a flat text storage system, but I also see why it is
difficult considdering the design choices made in Zope.

I believe that my problems stems from the fact that code, content and
presentation is to strongly interwoven.

zClasses are nice and simple but difficult to edit, as it has to be done in
the browser. Or at least pasted into it. You also get yourself painted into
a corner pretty quickly.

Subclassing a Pyhton class as a base for a zClass is kind of nice. But
currently I am having problems using that method as it seems that "helper
classes" cannot be adressed from dtml methods in the zClass. (Se my acessing
parameters in a "helper class" posting).

Products are difficult to make, and all the tutorials are rather bad.
Business logic and presentation is mixed together. (Business logic should
not use any code or libraries from Zope at all.)

A nice way to work would be to make a Python class that is completely
independent of Zope. Test and debug it.

Then make a thin Zope wrapper that adds just enough functionality to make it
work in Zope, and so that it can be accessed nicely via dtml.

I am trying this approach currently, but it gets ugly real fast. It will
probably be nicer when I understand it fully. I Will post a How-to then.

Regards Max M

___
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] Dump .zexp export to readable source?

2000-11-08 Thread Max Møller Rasmussen

From: Alex Khan [mailto:[EMAIL PROTECTED]]

>I can probably learn more from reading other people's code than by reading
>the fragmented documentation.
>I can do this easily with products but not zexp's. Thanks in advance...
 
zClasses are not written in Python so there is no code to see. Except fot
the dtml code and you can see that when you have imported a zClass product.

Regards Max M

___
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] Asked a million times already... Im sure

2000-11-06 Thread Max Møller Rasmussen

From: Chris Trowbridge [mailto:[EMAIL PROTECTED]]

>I know that many people have probobly already asked this, but how would I
do the >equivilant of a server side include?
>It seems obvious enough from examples that it is merely...

> 

>but I always end up with either blank content or '[]'

If you want to include it from a file on the computer and not an object in
Zope then you should probably use the FileSystem product to make it visible
to your file.

If the file you want to include is in Zope allready the you should make
shure that the incl_file is in your out_files' aquisition path. ie. directly
beside you document or in a stright line between your document and the root.
Or you should adress it directly.

/
folder1
incl_file
output_dtml
folder2
folder3

Here output_dtml can se and "include" incl_file

/
folder1
incl_file
folder2
output_dtml
folder3

Here it cannot. Except if you adress it like: 

 (Think of it as ../folder1/incl_file)

Regards Max

___
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] Combining products

2000-11-05 Thread Max Møller Rasmussen

From: Anders Eriksson [mailto:[EMAIL PROTECTED]]

>I would like to have the membership and the other parts from PTK added
>to the Squishdot (or the other way around - which ever is easiest).

I am afraid that there is no easy way of doing that. It would be like
combining any other 2 applications.

Regards Max M

___
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] PHP and Zope

2000-11-03 Thread Max Møller Rasmussen

If you want to you could just use Apache as a front end server serving php
pages, and as a proxy to Zope.

That way you can have the best of both worlds.

But I would recommend using Zope, as you will have far greater possibilities
for re-use of your code.

Regards Max M

-Original Message-
From: Vincent - D. Ertner [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 03, 2000 2:44 AM
To: Zope
Subject: [Zope] PHP and Zope


Hi Zopers,

I learned PHP and now discovered Zope. So I'd like to put a
simple question:

What's the best way to incorporate the advantages of PHP and
Zope? Should I focus on one and forget the other?

Okay, these are two questions and I honestly doubt that anyone
would suggest to drop Zope ;-)))

Anyway: Please gimme some starting hints on my way to the perfect
content managed web site!

Thanx in advance!

Cheers,

Vince

 '''
 ô¿ô
  -



___
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] My Items will not show themself in manage_main (objectItems)

2000-11-01 Thread Max Møller Rasmussen

From: Ender [mailto:[EMAIL PROTECTED]]

First os all. Thank you for the patience. I know it is boring to "Solve
other peoples problems for them", but I am really trying hard myself,
reading the source 
of Zope and other products. It's just such a steap learning curve because it
is underdocumented. (I have 6+ years of experience in web scripting and 12+
in programming + database overall, so usually i catch on fast.)

>> I was under the impression that when I inherit ObjectManager that my
object
>> would be a complete ObjectManager. But do I have to overwrite some
methods
>> with my own?

>No you don't but generally an objectmanager would wants to add some
>custom logic, like a Folder which is a specialized objectmanager.

I don't want that in this product. It should just be a plain folder, where
anything can be put. Well at least Foders, images and dtml methods.

>ok, i'm not certain that i understand your problem. you original problem
>was getting dtml methods to show up in the manage views. in your product
>your it appears that your methods aren't really dtml methods that are
>contained within the objectmanager but rather class methods of the
>discussion class. to have them show up in the manage_views you need to
>change them to be methods that are added to a discussion object.

In my mxm_diskuss class I have a list containing messages:

self.testComments = [.] (will be renamed to "comments" when it's done.)

These comments are not meant to be seen in the folder view, they should only
be visible when called through dtml methods. like this method to make a list
of all messages:

index_html:


 
By:  



What I find "brilliant" about the idea is that when a customer wants a
discussion group I only have to change 3 standard dtml files to give it a
new functional interface. And I can build a library of look and feels. And
there is no recursion in it so it will behave like a list, and be easily
codeable from dtml.

The last discussion product ever needed :-) It will be ZPL (when it's done.)

>here some code that illustrates how.
># add a folder for view
>self.manage_addFolder('views')
># get a file handle
>fh = open(join(Views_Dir, 'DiscussionIndex.dtml'))
># add a DTML method with contents of the file.
>self.views.manage_addDTMLMethod(id='news_center_index_html', file=fh)

>a method created this way will show up in the manage_view of the object.

My problem is not adding object programatically, but doing it in the
management  interface. When I add them I can press "add & edit" and I can
paste the dtml source, and the method works. But they don't show up on the
list when viewing the folder.

Well I guess that if I dont have to do anything special to add objects to an
objectmanager, then I must have a permission problem when viewing them. I
guess I will look more into that. Currently I am lookin for a permission
that prevents seing the ObjectItems in an objectmanager, but so far without
any luck.

grr... documentation.

Kind regards Max M

___
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 do I change dtml template on the fly in Python product?

2000-10-27 Thread Max Møller Rasmussen

I have asked this question somewhat differently in another thread but here I
go again from another angle, as it might have been my approach that was
wrong to begin with.

I have a Python product that allready does what I want it to, but I want to
be able to create different views of the products content. (Model View
Controller principle). To do this I have created a folder with different
views (Or skins if you would prefer the Gnome/KDE way of saying it.)

views
view1
list.dtml
view.dtml
edit.dtml
view2
list.dtml
view.dtml
edit.dtml

In my class I have made a value that hold the name of the selected view, I
call this:

self.selView

I want to make it possible to use the different sets of dtml files to create
a different look and feel to the data.

I want to write my "index_html" method so that it returns a rendered version
of "list.dtml" corresponding to the selected view, by the name of the folder
holding  the selected view.

something like this (which doesn't work):

def index_html():
return HTMLFile('views/' + self.selView+ 'list')

Is that the best way to do it?

Regards

Max M

___
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] How to render a HTMLFile in a method in a product

2000-10-27 Thread Max Møller Rasmussen

>From: Chris Withers [mailto:[EMAIL PROTECTED]]

I got this answer to my question about how to render a dtml document from a
method.

>testisDocTemp = 1
>def test(self,ignored,md):
>" A simple test method "
>return HTMLFile('skins/' + self.skin, globals())(None,md)

And I have been busy trying to read the source code to understand the
advise:

As far as I understand the story goes a little like this:

HTMLFile returns an object (through inheritance) "String" in file
"DT_String.py" that has "__call__()" implemented, which means that the class
can be called as a function... Hmm ... I had actually not seen this method
used in Python before.

def __call__(self,client=None,mapping={},**kw):

This method accepts an object in which it will look up values to insert in
the dtml file, and a mapping object (dictionary) that also will look up
values to insert.

So i guess that is what (None,md) does.

But I dont understand what "ignored" does in  my method, as it is unused,
unless it is used by md

>def test(self,ignored,md):

Furthermore I dont understand what md is. Some kind of mapping object
naturally, but where does it come from?

Also what is testisDocTemp supposed to do?

If I grep the source a "isDocTemp" shows up but is isn't easy to see what
this does either.

Regards Max M

___
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] How to render a HTMLFile in a method in a product

2000-10-26 Thread Max Møller Rasmussen

From: Chris Withers [mailto:[EMAIL PROTECTED]]

Thanks for the reply

>testisDocTemp = 1

>def test(self,ignored,md):
>" A simple test method "
>return HTMLFile('skins/' + self.skin, globals())(None,md)

Is this documented anywhere? I have a little trouble using code I don't
understand. Pretty Please.

Regards

Max M

___
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 render a HTMLFile in a method in a product

2000-10-26 Thread Max Møller Rasmussen

I would have thought that the two examples below where equivalent but only
the top one works like expected. (It renders the page.)

The second one just shows the source of the vanilla dtml page.

--
test = HTMLFile('vanilla', globals())

--
def test(self):
"A simpe test method"
return  HTMLFile('vanilla', globals())
--

How do I execute the dtml file in a method. I have searched the
documentation, but it is sketchy to say the least.

I cannot use the first approach as I need to define the filename on the fly
in my method.

def test(self):
"A simpe test method"
return  HTMLFile('skins/' + self.skin, globals())

self.skin is only available in my object, so naturally if I try to say:

test = HTMLFile('skins/' + self.skin, globals())

I get an error.

Regards

Max M

___
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] Access to an external site from zope site

2000-10-26 Thread Max Møller Rasmussen

There is no simple way of doing it.

You would have to write a product that accepts an URL as a parameter like:

http:www.yoursite.com/foreign?url=http.//www.othersite.com/somepage.htm

Then your product should take all href's in the new document and rename them
like the above.

Image src's only need to be renamed to absolute paths.

Forms need some special attention too.

Even thinking about cookies, parameter passing and all the other stuff that
can go on between the two sites is enough to make my head spin.

Getting a single page from another site is somewhat easier though, but you
still would need to make all the url's in the remote document absolute,
including "img src's" and "forms action" , so that would take some html
parsing.

Regards
Max M

-Original Message-
From: Etienne ALAURENT [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 26, 2000 3:22 AM
To: [EMAIL PROTECTED]
Subject: [Zope] Access to an external site from zope site


Hello,

I want to read and parse all HTML files from another server as if they came
from my server. I know I can use ZClient to read and parse one HTML file.
But
how can I do for a complete site ?

I'm not in the mailing list, so please send me any comment at
[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 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 should a collection be in a Python product if i want to traverse it with rse it with

2000-10-25 Thread Max Møller Rasmussen

This is a question I guess has something to do with popping an object onto
the namespace, or about me not understanding how stuff works.

When I make a list of objects:

class simple:
def __init__(self, value):
self.value = value

theList = [simple(1), simple(2), simple(3), simple(4)]

I would expect to be able to traverse it like below (The objects namespace
would be popped onto the namespace.):





But it isn't so. What do I need to do to make the objects namespace count in
my traversal? (I'd like to keep the dtml as simple as possible.)

--

If I make a list:

theList = [1, 2, 3, 4]

I can traverse it with:




-

and if it's a list if dicts:

theList = [{'value':1},{'value':2},{'value':3},{'value':4}]

I can traverse it like:








___
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 do you guys/gals test Zope products from Python?

2000-10-24 Thread Max Møller Rasmussen

I am using Zope and Python 1.5.2 on Win2000. I guess that it is a fairly
simple setup.

My Zope site is in a folder called c:\mxmZope, and my vanilla Python is in
C:\Program Files\Python.

usually when I write Python I just use PythonWin to edit and run my scripts.
I then write test in the buttom of my file that shows that everything works.


This works nicely, but when writing Zope products I get really frustrated. I
cannot easily automate my tests.

I put my products into C:\mxmZope\lib\python\Products\name and edit them
from there, but trying to edit just a simple syntax error means a restart of
Zope. That gets tired real fast. Especially when all you have to do to make
mistakes is forgetting a comment under a method etc.

I cannot run the program from my PythonWin or IDLE as they are set to the
standard Python enviroment. Do other set os.path.append('ZopeDir') or
something and the comment that out when running or what?

The error messages I get that way are also rather lacking. Reloading the
file in the browser, reading the source and getting a traceback like the one
below, for a method I know exists. But dissapeared because of some, probably
minor, typing mistake.

-
  ... SNIP
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 162, in publish
  File C:\mxmZope\lib\python\ZPublisher\BaseRequest.py, line 380, in
traverse
  File C:\mxmZope\lib\python\ZPublisher\HTTPResponse.py, line 529, in
notFoundError
NotFound: (see above)
--

I am shure that there must be a better way, but what is it? How do you guys
edit and test your products? Even .asp is far better than the way I am doing
it now.

At least I dont have to restart the server when I make a simple mistake, I
can also easily put in testcode and Response.Writes to se what is happening.

I love Python among other things because of the nice traceback and debugging
features, but I feel that they are somewhat lost when developing Zope.

Shurely it must be me being ignorant here.

Regards Max M

"There must be more than just this." - V-ger

___
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] Updating auto incrementing counter in a propertysheet

2000-10-24 Thread Max Møller Rasmussen

From: Bill Anderson [mailto:[EMAIL PROTECTED]]

>Is it more important that they be in an order, or that they be in a
>specific sequential list?

Actually what is important is that they are integers and in a specific
order. So the datestamp method isn't that feasible for me.

(I'm trying to make a "fake tree" for a diskussion product.)

It is really easy to implement and doesn't use recursion, so traversing the
tree is done with a simple for loop.

It uses a dictionary with tupples as keys to emulate the recursive
structure. Simple example here if anybody cares.


-

class fakeTree:
def __init__(self):
#create tree and insert root element
self.treeKeys = {}
self.treeKeys[0] = (0,)
self.tree = {}
self.tree[(0,)] = ''

def insert(self, id, parent, value):
# create new key
keyList = list(self.treeKeys[parent])
newKeyList = keyList.append(id)
newKeyTuple = tuple(newKeyList)
self.treeKeys[id] = newKeyTuple
# insert in tree with new tuple key
self.tree[newKeyTuple] = value

def print(self):
sortedKeys = treeKeys.keys()
sortedKeys.sort()
spacesInIndent = 3
for key in sortedKeys:
print key
print spacesInIndent * len(key) * ' ' + treeKeys[key]

tree = fakeTree()
tree.insert(1, 0, 'max m')
tree.insert(2, 0, 'gitte')
tree.insert(3, 1, 'magnus')
tree.print()


___
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] Updating auto incrementing counter in a propertysheet

2000-10-23 Thread Max Møller Rasmussen

What am I doing wrong here ... please !!

I am trying to make an autoincrementing counter for use in a diskussion
forum. It's purpose is to autogenereate id's for new messages.

It is important that the id's are in order, so I need to make them this way.

I have a zClass (objectmanger) with a property called "lastID", on a
propertysheet called "hidden".

I have then written a dtml mehtod that should return the id incremented by 1
and then sets the lastID to this new id.

the dtml for the "newID()" dtml method looks like this:
--



--

When I try to get the property directly via the browser i get a result of
"1" The default value for lastID=0 to begin with so this sounds plausible,
but when I refresh the browser nothing happens. So I guess that lastID isn't
updated in the above code.

How do I do that?

Also when I the try to insert "newID()" in my "mxm_comment_add" method in my
zClass, to autogenerate numbers, like this:



I get the following traceback: (And I would expect it to run at least 1 time
with "1" as a new id.)

Traceback (innermost last):
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 222, in
publish_module
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 187, in publish
  File C:\mxmZope\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
(Object: RoleManager)
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 171, in publish
  File C:\mxmZope\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: index_html)
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 112, in call_object
(Object: index_html)
  File C:\mxmZope\lib\python\App\Factory.py, line 178, in index_html
(Object: RoleManager)
  File C:\mxmZope\lib\python\OFS\DTMLMethod.py, line 172, in __call__
(Object: mxm_comment_add)
  File C:\mxmZope\lib\python\DocumentTemplate\DT_String.py, line 528, in
__call__
(Object: mxm_comment_add)
  File C:\mxmZope\lib\python\DocumentTemplate\DT_With.py, line 133, in
render
(Object: mxm_comment.createInObjectManager(newID(), REQUEST))
  File C:\mxmZope\lib\python\DocumentTemplate\DT_Util.py, line 337, in eval
(Object: mxm_comment.createInObjectManager(newID(), REQUEST))
(Info: newID)
  File , line 0, in ?
  File C:\mxmZope\lib\python\OFS\DTMLMethod.py, line 168, in __call__
(Object: newID)
  File C:\mxmZope\lib\python\DocumentTemplate\DT_String.py, line 528, in
__call__
(Object: newID)
  File C:\mxmZope\lib\python\DocumentTemplate\DT_Util.py, line 337, in eval
(Object: REQUEST.set('new_id', lastID+1))
(Info: REQUEST)
  File , line 0, in ?
NameError: (see above)

___
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] NEWBIE: assign next free ID automatically

2000-10-23 Thread Max Møller Rasmussen

This is untested, but an idea:





It is still subject to failure if 2 or more processes are writing an article
in the same time.

Furthermore it has to find and sort all the items in the folder. That could
take a long time if there are lots of them.

Maybe you should somehow insert a dtml-try until you succed in writing the
article.

Another aproach would be to have the folder with your articles have a
property "lastID" and let "nexID" be a method that automatically would
increment lastID end return it.

Maybe it is possible to lock the lastID property??

>From: Patrick Koetter [mailto:[EMAIL PROTECTED]]

>What is it that I want to do?
>I want to evaluate the highest ID (all are 'int') within the folder and
>assign the next highest.
>I'm sure this is easy to 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] Animated GIFs

2000-10-10 Thread Max Møller Rasmussen

From: Lars Heber [mailto:[EMAIL PROTECTED]]

>Sorry, I think you misunderstood me!
>I _don't_ want to stop the gif, but it does after the last frame! --
>Now I tried the same Zope page in NS and IE, this phenomenon appears only
with
>NS...

I did understand you, but I could not replicate your problem in IE. I didn't
try it in NS as I don't have it installed.

So I would say it most be a Netscape specific problem.

- Either it is because NS has some abscure bug if the file doesn't have a
.gif name with a dot, but as far as I remember you had allready tried that.

- Maybe Zope sends the wrong header that somehow makes NS foul up, but when
I send a request like this via telnet:

>telnet localhost 8080
>GET /test/ferierejser_banner_50aar.gif HTTP/1.0

I get this response, which looks fine.

>>HTTP/1.0 200 OK
>>Server: Zope/Zope 2.2.2 (binary release, python 1.5.2, win32-x86)
ZServer/1.1b1
>>Date: Tue, 10 Oct 2000 09:20:38 GMT
>>Connection: close
>>Content-Type: image/gif
>>Content-Length: 15341
>>Last-Modified: Tue, 10 Oct 2000 06:40:53 GMT

>>GIF89a\?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] ANNOUNCE mailForm 1.0 beta

2000-10-05 Thread Max Møller Rasmussen

I have made a zClass product for making mailforms with simple validation
easy.

Se more in the How-To at:

http://www.zope.org/Members/maxm/HowTo/mailForm/index_html

download the zClass at:

http://www.zope.org/Members/maxm/HowTo/mailForm/products/mailForm/view

regards

max 

___
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] Namespace problem with the dtml-sendmail and the smtphost

2000-10-04 Thread Max Møller Rasmussen

I have a dtml method in a zClass that looks like this:


To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Subject: This is a test

A test!!!


"theSMTPHost" is defined as a property in the zClass. But when i use the
method I get a:

Error Type: error
Error Value: host not found

If i write:



It gets send without a hitch.

and if I write  it returns mail.tele.dk as expected.

I then try this, which also fails.


Mailhost: 


To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Subject: This is a test

A test!!!


Is it not possible to set the smtphost to a string in a dtml variabel?

Regards Max M

___
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] Sorting and accessing elements in the

2000-10-03 Thread Max Møller Rasmussen

I am making a mailer zClass where it will only be nessecary to make the form
fields with the values you want to send, then the zClass will give you a
reply on the webpage and send a nicely formatted e-mail.

The problem is that the form elements are unknown but they need to be set up
in predictable order to format the output automatically.

To do this I need the form values in a sorted order. I can then give the
form fields names like this:






Then the mail can be automatically formatted like this:

1) First Name
Max M

2) Last Name
Rasmussen

etc



I have tried to use the sequence-item as a key in REQUEST.form, but it
doesn't work like I want it to.

-








:
  < THIS IS WHAT DOESNT
WORK




-

Regards Max M


___
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] Permission problem with my own zClass.

2000-09-14 Thread Max Møller Rasmussen

I have made a zClass called "newsProduct" that is articles with predefined
properties.

It works nicely when I am logged on as an Administrator. I can add articles.
No problem.

I also have a site with the following structure

root
news

I want some users to be able to add "news" articles in the "news" folder.
This I can do by making a user folder in the "news" folder and setting the
users as administrators, but I do NOT want them to be able to add anything
but articles. So that is a bad idea.

Thus I want to make a new role called "author" that can only add articles.
in the news-folder.

I have made a user in the "news" userfolder, and given this user the
"author" role. In the news folder I have also checked the box "add newss"
under "author" (a single article is also called "news" in the management
interface).

My test_author can logon nicely, seeing the "news" folder as the root. And
under the "To add an item select an item type" select box, 2 products turn
up "Z Gadfly Database Connection"(No idea why!) & "News". But when I select
"news" a login prompt pops up. I cannot login as test_author, so I cannot
create any news in the "news folder."

Does anybody has any ideas about what more I need to set in order to make
the "author" role able to create articles.

Kind Regars Max M, Denmark


This is the content of my newsProduct
Help (NewsProduct)  
newsClass  
newsClass_add (newsClass constructor)  
newsClass_addForm (newsClass constructor input form)  
newsClass_add_permission (newsClass constructor permission)  
newsClass_factory (newsClass factory)  

___
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] This must be a namespace problem

2000-09-08 Thread Max Møller Rasmussen

I have a site structure like this:

root
subfolder

Then i have made a dtml document "index_html" in the "root" folder like
this:



test

   




Also I have a dtml method "content" in the root folder like this:


Root folder
this is the content of the root folder


Then I have made a method "content" in "subfolder"


Sub folder
this is the content of the sub folder


all in all:

root
index_html
content
subFolder
content


When i view "root" folde i see the index_html document just fine, and the
content gets inserted like it should. But when I view the "subFolder" I
would expect it to look for the "index_html" in the root folder and then the
"content" method in the subFolder.

But it uses the "root" folder "content". How can I make it us the "content"
in the current directory, but the index_html from the root folder. Can this
not be done??

Kind regards 
Max M

___
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] [Ann] Another Zope Book

2000-08-18 Thread Max Møller Rasmussen

Fra: Kapil Thangavelu [mailto:[EMAIL PROTECTED]]

>I think most developers are forced to learn
>through trial and error because the docs don't do the components justice
>since they tend to focus on working understanding of zope's framework
>from dtml. and in the end they are forced to turn to the source which
>can be confusing without knowing the parts of the framework from a
>fundamental not a working perspective.

>comments?

2 right you are. We need more info about Zope from a Python programmers POW.
Setting pages up in dtml is not that interresting from my point of view.

We need more detailed documentation on all the seperate modules, and far
more/better on making products.

dtml is not for programming and business logic, only for presentation.

Max M

___
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] Problems publishing simple object directly thru ZServer

2000-08-09 Thread Max Møller Rasmussen

--
I have made a very simple class that I am trying to publish thru ZServer:
--
class hello:

"""A very simple publishable objet in zope"""

def world(self):
"DocStrings are NOT optional"
return "hello world"
--
I have changed the following in z2.py
--

#zh = zhttp_handler(MODULE, '', HTTP_ENV)
#hs.install_handler(zh)

sys.path.insert(0,'C:/root/pythonScripts/hello') # add MyModule to the
Python path
my_handler = zhttp_handler('hello', '')  # create a handler
hs.install_handler(my_handler)   # install it in the http
server#

--
And I get this traceback:
--

Zope Error
Zope has encountered an error while publishing this resource. 

exceptions.TypeError

Sorry, a Zope error occurred.

Traceback (innermost last):
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 222, in
publish_module
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 171, in publish
  File C:\mxmZope\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: world)
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 112, in call_object
(Object: world)
TypeError: unbound method must be called with class instance 1st argument
--

Can anyone see the error of my ways? I can't. I would think that: "unbound
method must be called with class instance 1st argument" would mean I had
forgotten "self" in my method but this is clearly not the case.

Kind Regards Max M

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