Re: [Zope-dev] Iteration counter

2001-12-18 Thread Danny William Adair

On Wednesday 19 December 2001 10:11, Jon Erickson wrote:
 I need a to create a simple counter variable that will store the number of
 iterations by a dtml-in structure.  I have yet to find a way how to do
 this in zope.  Here is an example (in perl) of what I need to do:

The number of iterations are already available as:
sequence-index (starting at 0) and
sequence-number (starting at 1)

hth,
Danny


 @bar = (sara,jane,kate);

 foreach $foo (@bar) {
   print $foo\n;
   $counter = $counter + 1;
 }

 I will need to use the $counter variable later on in the script.  Does
 anyone know how I can do this in zope?

 Thanks,

 Jon Erickson


 ___
 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 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] Iteration counter

2001-12-18 Thread Danny William Adair

  I will need to use the $counter variable later on in the script.

Oh sorry, forgot that one...

Inside your loop, you can do:
dtml-if sequence-end
dtml-call REQUEST.set('counter',_['sequence-number'])
/dtml-if

But then again, this would only give the _total_ number of iterations that 
have been made. If you only need this number :-), then please forget 
everything that I wrote, and just use
sequence-length
or
_.len(WhatYouAreIteratingThrough)

Since you can't break out of a dtml-in, the number of iterations that will be 
made will always be equal to the number of items (length) in your sequence.

Danny

P.S.: All this should be on [EMAIL PROTECTED], rather than zope-dev

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

2001-12-06 Thread Danny William Adair

On Friday 07 December 2001 12:57, Clark O'Brien wrote:
 I don't think ZC feels this way.

 Note the comment by Hadar Pedhazur, Chairman of Zope
 Corporation:
 comment
 at:http://www.zope.com/News/PressReleases/DC2ZC

 This name change is intended to ensure that Zope and
 the company that develops Zope are more closely
 associated with one another in the marketplace.

Clarifying a brand.
Starting as Digital Creations gives you the flexibility to explore more 
fields than Zope. Once you start putting all your (and other people's) money 
on that one horse, you make sure everyone knows who's the jockey.

That's how it's done.

hth,
Danny

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

2001-12-06 Thread Danny William Adair

S,

We're eating...

Danny

On Friday 07 December 2001 13:43, Clark O'Brien wrote:
 No I am not implying anything other then there
 is competition in the Zope marketplace and ZC has
 positioned itself to be the one that ends up with the
 most beans.

 This is what makes the free market work and I would do
 the same thing if I was in their shoes.

 However, I am not in their shoes, and therefore don't
 want to brand their company
 and don't want to add my
 beans to their pile of beans.
 Thats all I was saying.
 Clark

___
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] Another open letter. :-)

2001-12-02 Thread Danny William Adair

Hello Lennart,

On Monday 03 December 2001 05:06, Lennart Regebro wrote:
 After the discussion here I'm slowly starting to form a picture in my mind
 of how to solve the problems.

 First some basic facts of life:
 - Zope corp needs to do what Zope corp thinks it can make money on.

 - We (that is the Zope community) need to get some features into the base
 of Zope because:
 a. It's not effective that we all solve the same problems
 independantly. b. Some features are hard to do as products.

 - It is imperative that there is a single point of control for Zope, ie no
 branching.


 This means Zope corp needs to control what goes into Zope, but the
 community needs to tell them what should go there, and the community has to
 help to put it in.
 To achieve this, we need better community support systems. That is, we need
 a proper community site, with discussion forums, a merged
 collector/proposal application with proper threaded discussions and applied
 workflow for proposal states.
 The projects that get started also need their protected areas on the site
 with discussion forums and their own CVS trees.

 In all, this would support a better inflow of comments from the community,
 it would make it easier for community members to see the responses to their
 input, and it would be easier to start projects with non ZC people involved
 in programming.

Definitely. And definitely there needs to be more technical infrastructure 
on zope.org to support this way of working. As another result, less people 
would find it necessary to move their projects to sourceforge. Just imagine 
sourceforge functionality plus wikis, plus fishbowls, plus collector. I like 
the fishbowl's standardization of a common workflow, and I would love to see 
more integration of all the other parts. I believe this could speed up and 
stabilize Zope development drastically. Sometimes I even find _navigating_ 
through _what's_there_ hard, and I'm afraid to spend time writing something 
that someone else may have already written, and which might just be hidden 
somewhere in the haystacks...



 Here are some things that I feel should be introduced into Zope:
 - Workflow support. (Because everybody needs it)
 - Versioning. (Because it's hard to do as a product)
 - Internationalization. (Because it's hard to do as a product)
 - Better user management. (Because everybody needs it)

- Documentation
(Because everybody needs it - at some point of his/her Zope life)


 Also, Zope would benefit from the inclusion of several products that
 improve the products included in Zope. Many people have found some objects
 lacking in functionality, and added that functionality and put it up on
 Zope.org. Many of these improved products could easily replace the products
 that come with Zope today, thereby giving a better wow factor to Zope
 without much effort.

I think I am not the only one that's afraid of straw fires when it comes to 
Zope's wow factor. The decision, which patch/product/add-on should make it 
to the core and which shouldn't, is not easy. This decision has always been 
made by ZC, and for the time being I found this fair enough, though it seemed 
to me that they have been clobbered over the head with patches so much that 
it became just too much work to review every single one in detail (there are 
_still_, for months now, so many patches to the tree tag, that enhance its 
functionality exactly the way that - imho - the tree tag was meant to work, 
and they still haven't made it to the core). It looks as if out of 
desperation(convenience?) the burden of proof is being put on the patcher.

What I would really love would be a regular poll for developers so that ZC 
can find out what the community would like to see move into the core. And 
not too abstract (I don't want to vote for Internationalization, I want to 
vote for either ZBabel or Localizer, we're not in parliament here). Pick 
20 patches/products, and let the community decide over the priorities. Let ZC 
be the final judge, but let the jury pass their decision (advice) first.

You will always have the problem of this or that patch to apply to a very 
specific problem of yours. That's why you wrote it. Okay, this patch is 
essential for your site to work properly, but 99% of the other developers 
don't need it. If this is the case: tough luck. Pray that they run into the 
same problems some day. But for the time being, I don't see this causal 
coherence when it comes to should and if yes then when will this be taken to 
the core. So who do I blame? Some people were very quick with their decision 
here... (see last threads on this list)


 I also feel there are things that could be removed. And now I'm gonna say
 bad things about parts of zope some people probably love, and they will
 hate me for this, but I'll have to live with that. This is my view only. I
 have on occasion been known to be completely wrong. :-)

 - Don't do any  more work on ZClasses, and eventually drop it. To 

Correction - was: Re: [Zope-dev] Another open letter. :-)

2001-12-02 Thread Danny William Adair

On Monday 03 December 2001 10:09, Danny William Adair wrote:
 Introduced to us as the Portal Toolkit, later labeled as probably
 evolving into a commercial product (couldn't find it in the archives when
 I tried a minute ago, but I know I wasn't dreaming when I read it), then
 renamed to Content Management Framework and the out-of-the-box solution

Sorry, maybe I _was_ dreaming.
Commercial _support_ (contracts) was planned for a PTK 1.0 release.
(search [EMAIL PROTECTED] for commercial and PTK)

Sorry bout that,
Danny

___
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] Open letters, hijacking and the like

2001-12-02 Thread Danny William Adair

Hello Clark,

I see your point here, and I understand your problem.
But I do not share your opinion, especially when it comes to its conclusion. 
(branching)

Zope Corp. is not living in a dream world:

 On the one hand ZC is this munificent benefactor of
 Zope.

 On the other hand ZC is this poor cash strapped little
 company that can't afford to take any interest in Zope
 unless they have an immediate incentive.

 YOU CAN'T HAVE IT BOTH WAYS DUDE. I AM SORRY BUT THIS
 IS JUST NOT POSSIBLE.

I have zope.org, and I have zope.com
It's the same company, isn't it?
It's the same people on the same payroll, isn't it?

If I go to zope.com, I know I will definitely spend money, probably a lot of 
money. If I go to zope.org, I know I'm not going to spend a single dime. 
Guess where you'll find me? Now guess where'll find others. This separation 
makes sense, and imho it should have been done earlier! Now that it's late, 
Zope Corp has to work on its image, which would have been easier a year ago. 
(I think the new CEO's first approach towards the developers community was 
pretty unfruitful. Should I put a smiley here? N... He has learned 
quickly, I even forgot his name (whoops, who said that?))

I don't think ZC is a poor cash strapped little company, though it is still 
quite small. But in fact, this is totally irrelevant: No investor (see last 
line of this mail) will throw money out the window, whether it's a lot or a 
little. He wants it back x20, better in 2 or 3 three years than in 5 or 6. 
And I don't see why Zope Corp should pay high-end full-time developers to 
keep the fraggles entertained (yeah I'm one of the fraggles, sometimes). I 
do appreciate that they snip off some of their weekly time, and support the 
community(which has helped Zope Corp a lot in the past imho). I can not and 
will not pay them for this and only this, and I don't see how you get the 
idea that ZC can.


 If ZC is the benefactor of zope, why can't they
 develop a plan that is independent of day to day money
 making?

Open-Sourcing was a nice move, since (among a lot of other things) it opens 
up business opportunities for other people. Still, it costs a lot of money to 
maintain an Open-Source project of this size.

Zope is the BASIS of ZC's consulting and services work, so how could you 
possibly make this independent from each other?

You can listen to Paul Everitts thoughts on this if you take a look at the 
interview he had with O'Reilly Network (quite a while ago). Or maybe just 
wait a moment...


 If ZC is this little company that does not have the
 resources to provide true leadership, then why does
 Zope need them?

I see true leadership, but I also see _mutual_ benefits. I also believe that 
Zope would have never come that far if DC/ZC hadn't backed it. What it seems 
to me that you are trying to do here is take something away you never been 
responsible of in the first place. If there was no ZC/DC, there wouldn't have 
been a Zope, and this is the truth that you deny.

I respect ZC for the responsibility they are taking more than I envy anyone 
of copyrights. The ZPL has all you can ask for.

Set up a website and promote it as the alternative development site for 
Zope and upcoming versions of Zope. Good luck! With after hour developers 
alone you will wallow in it for years. How many people would feel attracted, 
which people, and why? What would developers get on this site? What would be 
the added value of the site? Copies of documents that people have written 
that had been paid by a company (ZC)?

And who will oversee the development cycle as a whole? Me? You? When? After 
work? So if you take the whole day for this, who's gonna pay for your costs 
of living? Oh, an investor. What should he invest in? Why? How do you plan to 
get his money back (x20)? Ohh. You want to do this WHILE you're at 
the other job :-)

ZC is a company dude, and a company has a business plan. That plan either 
fits yours or it doesn't. Of course they're not playing with marbles.

ZOPE.ORG IS NOT ZC'S HOBBY
(but it looks like it's yours)

Customer to development company:
- So what's the technical platform for this project?
- Zope
- Zope, uhu... Whose Software is that? Will this thing exist as long as our 
project exists? Where will we get support?
- Ah well... The Software belongs to zope.org, actually no one specific. 
It's open source, developed and maintained by people who find it a nice 
piece of software, and work on it after finishing their real job during the 
day. Support? Well there are a couple of email addresses on that site, I 
think they answer pretty quickly... Uh-huh..

Duuhhh...


I support ZC's approach. Most def.

btw, Check the corporate guide for business decisions (or something like 
that) on zope.org to see some of the benefits we as developers have from a 
corporate approach.

 ...
 
  Zope would not have  trouble finding corporate
 sponsors even from fortune 500 companies like IBM or
 HP.

You know 

[Zope-dev] Open letters, hijacking and the like

2001-12-01 Thread Danny William Adair

Hi!

Wow, this is the first time I have more zope-dev mails in my inbox than from 
the main list (and I'm very happy that all this stays on one list).

What I have seen from ZC up til now seems like they disclose practically 
everything but their client base, ok and maybe plans for a commercial Zope 
product (I count two now that have been dropped, this does not include Zope 
itself). Efforts have been made to separate the geeks from the 
tie-fighters (.org/.com), but I can't see any negative side-effects for the 
development of Zope itself. Maybe not yet, but, and this goes out to Mr 
O'Brien: It needs two to tango. Fair enough. ZC knows that, and especially 
Paul Everitt has pointed out more than once the dedication that ZC has 
towards the community.

I want to thank Zope Corporation for everything that's been done up til now. 
This is the kind of track I will stay on. I see this working.

Whatever parts of Zope don't work as expected, I don't know in how far I 
could ever put blame about that on ZC. These guys are more open to new ideas, 
efforts from the community and mutual benefits than anyone else I have met 
(in my short life, ok granted). Akm's worries and complaints are legitimate 
(and he has already corrected his language), and I see people reacting 
_immediately_. What more can you expect? In my opinion it was just a 
contretemps that priorities in the User API were set differently than 
expected from someone who dedicates a hell of a lot of time to that field of 
development. My personal opinion is that ZC should give akm a CVS account and 
let him put some elaborate changes to the user api for 2.5, apparently he 
knows exactly what he's doing.

Dude: Do it better and _then_ complain. ZC's not yo mama, feeding you 
software with a spoon. It looks like you're spilling it all, anyway.

Take a look at the ZPL, take a look at the Public CVS, the Wikis, the 
fishbowls, the open-sourced literature, and then think again. Closure of 
code / internals is not an arguable point when it comes to Zope, that's just 
being paranoid.

You are welcome to take from the community, you are welcome to contribute to 
the community, you are welcome to make money with Zope. It's all there. 
Closure of code is not what will separate the wheat from the chaff, 
business-wise.

Couldn't-resisting-ly yours,
Danny


___
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] Security Question

2001-11-28 Thread Danny William Adair

On Saturday 24 November 2001 01:40, Andre Schubert wrote:
 root/
   index_html
   foo/
 acl_users/
 bar/
   Image

 I have a image which could only be view by users with a role named
 foobar, these users are in acl_users.
 If i access the image through the web a must authenticate myself for the
 first time, after that everything works well.
 But if i want to access the Image via dtml-var Image from the
 index_html in the root-folder a got no access.
 After searching at Zope.org i tested with dtml-var
 restrictedTraverse('foo/bar/Image') but this doesnt works.
 How do i authenticate myself in foo if i access the folder via dtml.

In your Image object, give the Access Contents Information to the role 
Anonymous (or whoever usually views index_html), but keep View forbidden 
for Anonymous (allowed only for foobar role owners).

This way, the var tag (which could have been called by Anonymous) will be 
able to see the object, and Zope will authenticate automatically, if this 
is necessary in order to view it.

For security reasons, your Image object will not even be found, if the 
caller's role does not have the Access Contents Information permission. I 
find this a good idea and reason.

There is no difference whether you climb to Image using restrictedTraverse, 
the with tag, or directly. All these will have identical results.

If you want to avoid the separate permission settings (because you have a lot 
of Image objects you want to behave like that), either give index_html a 
proxy role that has the Access Contents Information permission on Image 
(or the whole bar folder), or use unrestrictedTraverse in index_html.

hth,
Danny

___
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] Security Question

2001-11-28 Thread Danny William Adair

 This doesn't work, because the user it not known in root where the
 index_html is,
 the user is known in the folder view.


Sorry.
I think I read your first email a little too fast.

This behavior is normal, and meant to strengthen Zope security.
You are not calling the Image object, index_html is. The user folder will not 
authenticate above. You are calling index_html which is above. 
That's why calling the Image object directly works fine.

If the other way would be possible, you could switch the authenticating 
user_folders and thus sneak into something you weren't allowed to access:

dtml-with folder_where_current_user_is_in_acl_users_and_has_foobar_role
dtml-with folder_next_to_it_where_user_can_access_contents_information
dtml-var some_Image_only_foobar_role_owners_can_view
/dtml-with
/dtml-with

This means showing the bouncer your public library card, instead of (at 
least) your driver's license. Of course it says that you're 21...

By the way, this has nothing to do with the URL. Calling /foo/bar/index_html, 
(hoping for acquisition leaving you with the client object bar), will bring 
the same result. dtml-var Image will _find_ the Image object, but 
index_html (which is still above) will need to show proper permissions.

So you cannot do it this way. Not even unrestrictedTraverse would help you. 
Not even a proxy role, since you would have the same problem with the method 
that holds the proxy role. Where would you put it?

If I understand you right, you want the user to authenticate when trying to 
access index_html, because that's where the protected image will be shown. 
(Or was the question not of practical relevance?)

You either have to move index_html down to where acl_users lies, or the other 
way around.

If you want one universal view image page, which only asks for 
authentication if needed for the image it is supposed to show (and doesn't 
for public images), then call foo/bar/Image/show with show being a method 
on the same level as your current index_html. Another way would be 
redirection.

The third and by far the easiest solution is to use

img src=/foo/bar/Image

in index_html, because then the Image object will be requested directly and 
authenticates itself (on the right level).

I was rebuilding your sample structure, and found something quite annoying, 
that might have to go into the Collecor:

Access contents information looks like it is not sufficient to access image 
objects or their properties.

dtml-var foo.bar.Image.width will need the View permission, which is 
not how this thing works with other object types. As soon as you _access_ an 
image object Zope behaves as if you were trying to render it, but you're not 
(yet).

You might have found a Zope bug here...

Hope this helps,
Danny

___
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] compilezpy (compileall)

2001-11-21 Thread Danny William Adair

On Wednesday 21 November 2001 18:41, Richard Jones wrote:
 On Wednesday 21 November 2001 16:34, Danny William Adair wrote:
  As from what I know (leaving aside for a moment that I basically know
  nothing), Zope should be _started_ as root, but then be _running_ as
  nobody. This does make sense to me, in a couple of ways. :-)
 
  Do you know when or where this switch to nobody is performed?

 in z2[s].py   (lines 831 onwards in z2s.py)

Cool!
This sounds like a really cool answer - just the kind I love - but...
I have never seen a z2s.py, and z2.py has less than 800 lines.
Please tell me where I'm being thick here...

thx,
Danny

___
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] SearchIndex deprecation warning

2001-11-21 Thread Danny William Adair

On Wednesday 21 November 2001 22:48, Steve Alexander wrote:
 Danny William Adair wrote:
 Apparently one or more of my installed (third-party) products is causing
 this.

 I don't think so.

 Try this: delete all filesystem products from the Zope control panel,
 and restart Zope. I think you'll find that the products will return, and
 you won't get these messages at startup.

 You're getting these errors because of persistent Catalog objects stored
 by the Zope help system, which were created before Zope 2.4.

That did the trick. Thank you very much!
Andreas, sorry that I didn't mention the upgrade.

Thanks you two,
Danny

___
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] SearchIndex deprecation warning

2001-11-20 Thread Danny William Adair

Hi!

I would like to get rid of this:


.../lib/python/SearchIndex/__init__.py:91: Deprecation Warning: ... blah ... 
Please use instead the re-factored modules in Products/PluginIndexes


Apparently one or more of my installed (third-party) products is causing this.

I don't know of any explicit use of the SearchIndex module, so I guess it is 
some ZCatalog function being called that's relying on it (reindex?).

Does anyone know which calls cause this to happen, so I can replace them with 
the proper ones?

Thanks very much in advance,
Danny


___
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] SearchIndex deprecation warning

2001-11-20 Thread Danny William Adair

On Wednesday 21 November 2001 14:49, Andreas Jung wrote:
 Zope 2.4 does not use the old SearchIndex package. So this warning
 is printed when 3rd party applications still use this package.

 Andreas

Sorry.
Please allow me to repost my second sentence:

 Apparently one or more of my installed (third-party) products is causing
 this.

So I am aware that it is some third-party product(s) that's causing this. 
What I would like to find out is: Which ZCatalog function calls invoke the 
SearchIndex module? If I knew that I could hunt them down and replace them 
with their corresponding successors. Yes, I would do this in the third-party 
products! (and inform the creators so they have less work when patching up)

Thank you very much in advance,
Danny

___
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] compilezpy (compileall)

2001-11-20 Thread Danny William Adair

On Wednesday 21 November 2001 17:27, Richard Jones wrote:
 On Wednesday 21 November 2001 15:12, Danny William Adair wrote:
  I wondered if this (see subject) was totally necessary during the
  installation. My Zope installation seems to run fine when I delete all
  the *.pyc and just start it. Obviously it runs slower the first time, but
  that's all I can see.

 If the server is run as nobody, that user probably won't have permission to
 write the compiled bytecodes to disk.

Hawhoops. Yeah, that's reason enough... of course... how could I... 
sure...

Thank you for your help.

Hmm.
As from what I know (leaving aside for a moment that I basically know 
nothing), Zope should be _started_ as root, but then be _running_ as nobody. 
This does make sense to me, in a couple of ways. :-)

Do you know when or where this switch to nobody is performed?

thx,
Danny

___
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] manage_pasteObjects and REQUEST

2001-09-18 Thread Danny William Adair

Hi!

Does anyone know when manage_PasteObjects will stop requiring REQUEST to be passed? I 
want to mimick the Cut/Copy/Paste Support of the management interface in a UI of my 
own.

my method objectsCut holds:
dtml-call manage_cutObjects(REQUEST['ids'], REQUEST)

while my objectsPaste method holds:
dtml-call manage_pasteObjects(_.None, REQUEST)

Pasting objects will sometimes (!?!) redirect me to the management interface, which I 
want to hide.
I found these last lines in manage_pasteObjects (CopySupport.py):

def manage_pasteObjects(self, cb_copy_data=None, REQUEST=None):
Paste previously copied objects into the current object.
   If calling manage_pasteObjects from python code, pass
   the result of a previous call to manage_cutObjects or
   manage_copyObjects as the first argument.
...
...
...
if REQUEST is not None:
REQUEST['RESPONSE'].setCookie('__cp', 'deleted',
path='%s' % cookie_path(REQUEST),
expires='Wed, 31-Dec-97 23:59:59 GMT')
REQUEST['__cp'] = None
return self.manage_main(self, REQUEST, update_menu=1,
cb_dataValid=0)

I don't want to hack this file.
The only way to get the cookie set seems to be passing the REQUEST object.

...pass the result of a previous call to manage_cutObjects or manage_copyObjects as 
the first argument

This doesn't help me very much. It would help me if I wanted to Copy/Paste or 
Cut/Paste at the same time:

dtml-call REQUEST.set('my_clipboard_data', manage_cutObjects(REQUEST['ids'], 
REQUEST))
dtml-call manage_pasteObjects(my_clipboard_data)

works fine, but if I want to do Copy and Paste at completely different times, I have 
to pass my_clipboard_data along the requests all the time.

Is there a simple solution? Is it something I should put in the Bug Collector? Or did 
I miss something?

Thank you very much for your help,

Danny

___
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] Trying to set roles/permissions programmatically - Now I have a headache!

2001-04-27 Thread Danny William Adair

Hello!

I want to set the roles of a permission and turn acquisition of a permission
(mapping) on and off programmatically. And of course I want to get a
permission by its name. This looks definitely more complex than simply
changing an object's property!

I took a look at the management screens(Role.py -
manage_changePermissions). The aX and pYrZ mapping for the *checkboxes*
(=sole purpose) gave me a lot of confusion, I first thought this was Zope
internal naming :-). Then I took a look at Permission.py (setRoles). But I
haven't dealt with this before, and it all looks a little weird. I managed
to write a couple of functions that give me roles to permissions and
permissions to roles or check if a permission setting has been acquired and
so on, but I'm stuck with *setting* permissions with a function of my own.

a) Could this be correct?

# roles as list: acquisition will be turned on
roles=['Anonymous','Manager']

# roles as tuple: acquisition will be turned off
roles=tuple(roles)

# set as specified
some_permission.setRoles(roles)


b) How can I get a hold of some_permission when I know its name? This does
not work:

def setRolesForPermission(ob, permission, roles, setacquired):
  permission_trans = '_' + replace(permission, ' ', '_') + '_Permission'
  p = getattr(ob, permission_trans) # this does *not* give me the permission
itself!
  if not setacquired:
roles=tuple(roles)
  p.setRoles(roles)

It must have something to do with acquisition :-)
If it is turned on for that permission, getattr() won't find the attribute.
If it's turned off, it returns a tuple. Where's the permission instance
itself?

I see that ac_inherited_permissions(1) gives me a list of permission names,
but I don't know how to access a specific permission directly.

This *did* work:

def permissionAcquired(ob, permission):
# Tell me if acquisition has been turned on
# (There's also some other way, checking if the returned is of type List or
Tuple, I think I saw that somewhere in Role.py)

  permission_trans = '_' + replace(permission, ' ', '_') + '_Permission'
  return (not hasattr(ob.aq_base, permission_trans))


Help!
Thank you so much in advance,

Danny


___
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] Trying to set roles/permissions programmatically - Now I have a headache!

2001-04-27 Thread Danny William Adair

Hello Dieter!

As you can see in my email (after the first paragraph), I did look through
management interface and AccessControl/*.py

Before writing to the list and annoying others with my little problems, I
1. try it myself (for a short time)

2.
- search the mailing list archives
- search all available docs: Guides, ZB, HowTos, ZQR
- saerch zope.org (wikis)
- try to see if there is a similar situation already solved (management
interface, other products)

3.
- try on my own again (found something useful), this time longer than on 1.

And I have read chapter3 :-)

Unfortunately, setting permissions programmatically has never been a hot
topic for Zopistas (too easy to talk about?).

What I was looking for was a way to get a hold of some sort of Permission
object instance. After strolling the sources, I finally found out what this
is (apparently) all about, and that I was looking for the wrong thing.
(permissionEdit.dtml - Role.py's manage_changePermission -
Permission.py's Permission.__init__)

--
Here's the result, works alright for me:
(Hey nuno! Hth, you asked for something like this on the list a month ago)
--
def setRolesForPermission(ob, permission, roles, acquire):
  for p in ob.ac_inherited_permissions(1):# A
name, value = p[:2]n
if name==permission:
  p=Permission(name,value,ob) # B
  if acquire: roles=list(roles)
  else: roles=tuple(roles)
  p.setRoles(roles)
  return
  raise 'Invalid Permission', (The permission em%s/em is invalid. %
permission)
--
(ok, assigning a value (maybe lots of times) where it's only needed in one
case is inefficent)

A and B were the hints I missed when I wrote the last mail.
So you really *do* run through all the permissions, get their names and
check against your string parameter until you match. (Is this a must?) Then
you *instantiate* a Permission. (see
Permission.__init__(self,name,data,obj,default=None)) Yes, and setRoles
(and acquisition setting) works like I expected, phew.

Thanks anyway,

Danny

 -Ursprungliche Nachricht-
 Von: Dieter Maurer [mailto:[EMAIL PROTECTED]]
 Gesendet: Samstag, 28. April 2001 06.26
 An: Danny William Adair
 Cc: [EMAIL PROTECTED]
 Betreff: Re: [Zope-dev] Trying to set roles/permissions programmatically
 - Now I have a headache!


 Danny William Adair writes:
   I want to set the roles of a permission and turn acquisition
 of a permission
   (mapping) on and off programmatically. And of course I want to get a
   permission by its name. This looks definitely more complex
 than simply
   changing an object's property!
 My standard response to questions like this:

   You know, you can do this via the Management Interface.

   Its code will tell you, how you can do it: the necessary
   method names and their parameters.
   After you know the names, you look for further documentation:
   the Zope Help, maybe the new Zope Developer Guide,
   the source.

   The source for the updating of permissions is
   AccessControl/dtml/access.dtml.
   The methods are defined in various Python files
   in AccessControl.


 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] url traversal

2001-04-26 Thread Danny William Adair

Hi Brett!

Have you taken a look at the PathHandler Product?
http://www.zope.org/Members/NIP/PathHandler/

This looks like an out-of-the-box solution for you.

hth,
Danny

 -Ursprungliche Nachricht-
 Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag
 von Brett Carter
 Gesendet: Freitag, 27. April 2001 10.10
 An: [EMAIL PROTECTED]
 Betreff: [Zope-dev] url traversal
 
 
 I have the classic problem of wanting my method 'foo' to work like:
 http://localhost/foo/a/b/c
 where a,b,c are parameters passed to foo.  I've found some info in the
 mailing list archives, namely:
 http://lists.zope.org/pipermail/zope-dev/2000-May/005197.html
 
 Has the 'Traversal' interface been implemented?  What are the
 specifics of implementing something like I describe above?
 Thanks,
 -Brett
 
 ___
 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 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] Objects, Roles and Permissions

2001-04-09 Thread Danny William Adair

Hello warriors,

what's the fastest way to find out whether a specific role has a specific
permission on a specific object? What's the fastest way to find out if it's
acquired?

Even more interesting:
How would I find out whether a specific role has a specific permission on a
specific object, _taking_acquired_rights_into_account_??? In other words
(management screen): "View" permission is not checked for the Anonymous
role, but acquired. Therefore the "Anonymous" role maybe _does_ have the
permission to "View" this object, through acquisition. Would I have to climb
up the ladder manually and check every parent until acquisition has been
"turned off", or is there some function - even if it's only available for an
external method - that already does this work?

I looked through the ZMI pages (and the .py's under
"lib/python/AccessControl") but couldn't find anything useful for this
purpose. Iterating through permission_settings takes too long and I don't
know how to access the specific roles/permissions directly (by name), mainly
because mapping constructions like "p199r0" are not very handy...

Thank you very much in advance for your help (dtml, pyhton, or docs I didn't
see),

Danny


___
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] PATH_INFO reliable?

2001-03-18 Thread Danny William Adair

I want to strip off the SERVER_URL of an absolute url (which I have as a
string) without doing string manipulations. Is there some built-in function
to do this? So what I'm looking for is actual the reverse of absolute_url.

The request variable PATH_INFO looks very good, but I don't know whether
this is _always_ created.

Thx in advance,
Danny

P.S.: Maybe I just got something completely wrong here. Help!


___
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] zope on win95

2001-01-06 Thread Danny William Adair

http://www.zope.org/Products/Zope/2.2.4/Zope-2.2.4-win32-x86.exe

2.2.4 is the current stable release.

Concerning the "execution" of DTML "files", "The Zope Book" might be a good
starting point for reading some documentation:
http://www.zope.org/Members/michel/ZB

hth,
Danny

P.S.: Please remember this is the Zope developers mailing list. For
questions concerning the installation of zope, the general zope mailing list
might be a more proper place to post to.


 -Urspr√ľngliche Nachricht-
 Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag
 von nando n
 Gesendet: Freitag, 5. Januar 2001 20:07
 An: [EMAIL PROTECTED]
 Betreff: [Zope-dev] zope on win95


 where can i download (exact url) binary version
 of zope to install it on my win95 system?
 for now i've only been able to download python
 source code version of zope.
 how do i execute dtml files?

 i just want to know that. thanks
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


 ___
 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 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] Access problems

2000-10-03 Thread Danny William Adair

Hi all!

I have a serious and extremely urgent problem concerning my zope
installation(2.2.1 on Unix): Whatever resource I'm trying to access, I get
the following

---
Attribute Error
---

Traceback (innermost last):
  File /home/sites/site3/users/.../2-2-1/lib/python/ZPublisher/Publish.py,
line 222, in publish_module
  File /home/sites/site3/users/.../2-2-1/lib/python/ZPublisher/Publish.py,
line 187, in publish
  File /home/sites/site3/users/.../2-2-1/lib/python/Zope/__init__.py, line
221, in zpublisher_exception_hook
(Object: ApplicationDefaultPermissions)
  File /home/sites/site3/users/.../2-2-1/lib/python/ZPublisher/Publish.py,
line 162, in publish
  File
/home/sites/site3/users/.../2-2-1/lib/python/ZPublisher/BaseRequest.py, line
438, in traverse
  File
/home/sites/site3/users/.../2-2-1/lib/python/ZPublisher/BaseRequest.py, line
514, in old_validation
(Object: broken)
AttributeError: (see above)


Furthermore, I have to authenticate on _every_ occasion, even with objects I
know are totally available to Anonymous.
After (http) authentication I get the above mentioned attribute error.

I'm clueless. What is this about?

Thanking you so much in advance,
Prost,

Danny



P.S.: Of course I can't recall doing anything rude to my installation,
actually I can't recall doing _anything_. (What they all say)


___
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] DynPersist.so from ZPatterns 0-4-2a3

2000-10-03 Thread Danny William Adair

Hi all!

I'm desperately looking for the DynPersist shared library (new for ZPatterns
0-4-2a3) in compiled form.
Can someone help me (send it to me)? I'm running a Zope instance at NIP
(www.nipltd.net), that's 2.2.1 on Unix platform.

tia,
Prost,

Danny


___
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: Thanks a lot, but...

2000-10-03 Thread Danny William Adair

Thank you Itamar,

_but_ I need the Unix .so, not the Windows .dll. Sorry if I didn't put that
clear.

Danny

-Ursprungliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 3. Oktober 2000 15:20
An: [EMAIL PROTECTED]
Betreff: Re: [Zope-dev] DynPersist.so from ZPatterns 0-4-2a3


Danny William Adair wrote:

 I'm desperately looking for the DynPersist shared library (new for
ZPatterns
 0-4-2a3) in compiled form.
 Can someone help me (send it to me)? I'm running a Zope instance at NIP
 (www.nipltd.net), that's 2.2.1 on Unix platform.

Here ya go.  Rename it to DynPersist.dll before use.

--
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C


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