Re: [Zope-dev] Product Data Storage

2000-06-30 Thread Steve Alexander

Andy Dawkins wrote:
 
 So my question is this:
 What are peoples opinions on storing shared product data?  Where should it
 be placed?  Should this ability be added to Zope as a standard?
 

So, this would be the zope equivalent of the unix "/etc/" directory?

Perhaps you could have "etc (Product Settings)" as a subfolder of
control panel.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

___
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] Product Data Storage

2000-06-30 Thread Josh Zeidner



You should look into using ZCatalog for this purpose.

-josh zeidner



I have an interesting issue which I don't think has been raised.  But
instead of solving the issue myself I thought I would share it with you
guys/gals and see what you think.

I am currently working on a Zope MailIn product, which allows you to send
emails directly in to Zope.
Version 0.1 can be found at:
http://www.zope.org/Members/NIP/ZMailIn

In version 0.2 I plan to have a ZMailIn python product which will handle 
the
Zope side of things and behave a bit like a client.  For example you could
add a ZMailIn product instance in to Zope and configure it to receive all
emails for [EMAIL PROTECTED] and provide a method to execute upon mail
arrival.

This is great and you could have n ZMailIn product instances throughout 
your
Zope site and in any position.

When email arrives I need to find all the ZMailIn instances within the ZODB
and hand the email to the correct one.

I have decided AGAINST searching the ZODB for instances of ZMailIn because
that is just too scary, hideously inefficient and I don't want to go there.
Instead I thought of keeping an up-to-date list of where all the current
instances where held.  My original idea was to get the ZMailIn product to
write a file in to the /lib/python/Products/ZMailIn directory, which
shouldn't cause any problems that I can see.

However, It had occurred to me that with the current growth of Zope it was
going to become more popular that separate Zope instances of the same
product may need to share some data.

So my question is this:
What are peoples opinions on storing shared product data?  Where should it
be placed?  Should this ability be added to Zope as a standard?

Thanks in advance.
-Andy Dawkins
(New Information Paradigms Ltd)


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



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 )




RE: [Zope-dev] Product Data Storage

2000-06-30 Thread Andy Dawkins

You should look into using ZCatalog for this purpose.

OK - that is a solution that could solve my particular issue, but where
would you put it?  Would you put it in the Product folder, or in some common
place in the ZODB.
How would you create it originally? In the products __init__.py or by some
kind of DTML method.

Also would the ZCatalog be appropriate for storing general information to be
shared between instances, Maybe some global configuration options.

I am looking for a generalised method of storing Class Level Variables.
Maybe properties within the Product folder.

But above all I am looking for a method of doing this that the Zope
community agrees as being efficient and recognises as being _the_ solution
to the problem.  I want to avoid a 'hack' solution if possible.

-Andy Dawkins
(New Information Paradigms Ltd)


___
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] Product Data Storage

2000-06-30 Thread Dan L. Pierson

Andy Dawkins writes:
  I have decided AGAINST searching the ZODB for instances of ZMailIn because
  that is just too scary, hideously inefficient and I don't want to go there.
  Instead I thought of keeping an up-to-date list of where all the current
  instances where held.  My original idea was to get the ZMailIn product to
  write a file in to the /lib/python/Products/ZMailIn directory, which
  shouldn't cause any problems that I can see.

... snip ...

  So my question is this:
  What are peoples opinions on storing shared product data?  Where should it
  be placed?  Should this ability be added to Zope as a standard?

Shared data should go in zope/var, or a subdirectory of that.
Zope/lib should be considered read-only by running products unless
explicitly changed by the user.  As you have correctly pointed out,
lots of machines share Zope installations for multiple servers.

A standard interface for Python code to get a private subdirectory of
var might well be useful.


___
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] Product Data Storage

2000-06-30 Thread Andy Dawkins

Dan wrote:
Shared data should go in zope/var, or a subdirectory of that.
Zope/lib should be considered read-only by running products unless
explicitly changed by the user.  As you have correctly pointed out,
lots of machines share Zope installations for multiple servers.

A standard interface for Python code to get a private subdirectory of
var might well be useful.

Now we're talking, that sounds reasonable.  Thanks for pointing out the
zope/var vs Zope/lib, point taken.  I'm about to code this bit now so for
version 0.2 I'll put a text file in the zope/var directory.

The private subdirectory idea sounds great, but I think some people may
prefer a ZODB solution due to backup's, accessibility and, dare I say it,
ZEO.

Arrgghh, ZEO I didn't think about it until just then. Are there any ZEO
issue's I need to be aware of?

OK - These are great suggestions and I am taking them all in, honest.

Cheers
-Andy


___
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] Product Data Storage

2000-06-30 Thread Chris Withers

Loren Stafford wrote:
 In that case we decided to put the Schedule in the root folder. There is no
 more global data than the catalog itself, but if there were it could be
 stored in the catalog folder, since catalogs are folderish.

Hmm, this is messy. Could the Catalog not be stored in your case in:
/Control Panel/Products/ZScheduler
and in Andy's case in:
/Control Panel/Products/ZMailIn
?

I like your point about ZCatalog's being folderish though ;-)

 ZScheduler's __init__.py method creates this global data structure if and
 only if it doesn't already exist. Because ZScheduler creates it, it can
 assign the appropriate permissions and methods to manage the global
 structure any way it wants.

This sounds like what you want to do, Andy...

cheers,

Chris

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




RE: [Zope-dev] Product Data Storage

2000-06-30 Thread Loren Stafford

I haven't thought much about this; I just followed mj's original design.
Maybe there was some reason for this decision. Any comment Martijn?

-- Loren


 Loren Stafford wrote:
  In that case we decided to put the Schedule in the root folder.
 There is no
  more global data than the catalog itself, but if there were it could be
  stored in the catalog folder, since catalogs are folderish.

 Hmm, this is messy. Could the Catalog not be stored in your case in:
 /Control Panel/Products/ZScheduler
 and in Andy's case in:
 /Control Panel/Products/ZMailIn
 ?


___
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] FWIW, ZCVSMixin now at 0.1.1... and rising. ;-)

2000-06-30 Thread Shane Hathaway

Steve Spicklemire wrote:
 I don't know if anyone out there is actually trying to
 *use* my ZCVSMixin/ZCVS Folder stuff, but if you are you certainly
 want to get the latest release, ZCVSMixin-0.1.1.tgz from
 the zope.org site:
 
 http://www.zope.org/Members/sspickle/ZCVSMixin

Hi, Steve.  This work looks very interesting.  I decided to try it out
and noticed it was not possible to manage a product folder with
ZCVSMixin, so I started hacking up your product.  (Images that resemble
a horror movie come to mind.) :-)

I've attached my changes in a private e-mail so as to not flood the
list.  Basically I made it possible to override the behavior of
ZCVSMixin so that it can manage a folder other than itself.  Then I
created a new class derived from ZCVSMixin which is a "CVS" Folder. 
That way, it's possible to manage any objects in the ZODB, regardless
of whether CVS had been considered in the structure.

 I put some screenshots up there so you can
 see what it looks like at:
 
 http://www.zope.org/Members/sspickle

It looks good, but the interface could be a lot cleaner.  I envision a
table with three distinct column groups: the ZODB version, the FS
version, and the repository (with details).

When the ZODB and FS are in sync, a small black equal sign will appear
between them (preferrably a graphic to make it more visible.)  When the
FS and repository are in sync, there will be a small equal sign between
them also.  When something is not in sync, a green arrow pointing in
the direction the file needs to go will replace the equal sign.

The buttons below would be placed in such a way to make their function
obvious.  In fact, the submit buttons could be images containing the
arrow icon.  Thus the interface would be simple and obvious.

 I've also found it useful for managing Python products and other
 software through the web! I have had a couple of minor 'breakthrough's
 that *seem* cool, but I might just be fooling myself. If an object is
 not folderish I guess that it's 'simple' so I export it as XML with
 the following code:

 (snip)

This looks good, Steve.

 If objects are 'folderish' or 'complex' (and the user is permitted to
 dictate this when objects are added to CVS), they are exported as
 'zexp' files and cvs adds them as 'binary'. I was having trouble with
 certain kinds of object's xml representation.  I decided that this was
 really an xml implementation problem, since I couldn't reliably export
 these as xml through the normal Zope export mechanism either. Anyway..
 let me know what you think if you are using this stuff!

I think we need to look into performing complete CVS checkouts which
create entire folder hierarchies.

 Finally I'm aware that there are also security issues with the way
 this works now. I need to look at all the things a user might need to
 do and eliminate some of the 'type in' arguments that are in the
 product now. These arguments wind up on 'os.system' calls, and could
 be abused by a ill-meaning user (with access to the CVS Admin page!)
 Any thoughts there?

Imagine this possibility: Zope would start what I'll tentatively call
an "execution proxy" server at startup.  When a user want to access CVS
through Zope, they would be required to start a background "execution
client" which makes a connection to Zope's execution proxy server. 
When the user accesses a CVS function in Zope, Zope would look at the
list of connected execution clients and ask the appropriate execution
client to access the file system and execute cvs commands based on that
user's system privileges.

Advantages:

- Unless a given user is running the execution client, the possibility
of intruders gaining access to that user's files is not increased.

- Nothing has to run with root privileges.  

- The execution proxy could run on a privileged port, making it
impossible for intruders to trick users into using a counterfeit
execution proxy (unless, of course, the intruder already has root
privileges.)

- No need for administrators to fiddle with filesystem permissions.

Disadvantages:

- If Zope is compromised while execution clients are connected, the
intruder may be able to execute commands through the execution
clients.  To reduce the impact, we can reduce the commands allowed to
be executed.  Note, however, that this problem is very likely inherent
in CVS access through the web.  Even the current implementation suffers
from this problem.

- Users will have to manually start their execution clients, which will
stop automatically when they log out.  This is actually designed to be
an advantage in terms of security.  On the other hand, it would be
possible to write an execution client that runs as root and
automatically spawns child clients for each user.  That could be
dangerous, though.

It should be relatively easy to write all this IMHO.

Shane

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross 

Re: [Zope-dev] EMarket and 2.2.0b3

2000-06-30 Thread R. David Murray

On Thu, 29 Jun 2000, Steve Spicklemire wrote:
 I'm sure a lot of this is because EMarket was a 1.x product that has
 seen relatively little change, in basic structure, since. I'm working

It doesn't look that way, actually.

 on some patched to allow (1) ZClasses to act as MarketItems and
 Shoppers and (2) ZPatterns integration so that most objects can
 be optionally stored in RDBM or ZODB. .. I'll go ahead and 
 checkin my ZClass stuff. I'm not running 2.2x much, since I'm

This would be really great, thanks.

 really busy on other development... but I can at least
 see if the product installs! ;-)

I figured out a way to fix the problem I was seeing, but I don't really
understand why it caused the problem, though it does not seem unreasonable
that it did (which is why I thought to experiment in this area of the
code).

MarketItem.py has the following code snippet near the beginning of
the class definition:

for item in OFS.Folder.Folder.manage_options:
if item['label'] == 'Contents':
manage_options.append(copy(item))  # be sure to muck with a *copy*
manage_options[-1]['action'] = 'manage_contents'
else:
manage_options.append(item)

Changing the last line to

manage_options.append(copy(item))

makes the management interface behave normally with the product installed.

It does not seem unreasonable to me to not make copies of things not
being changed: why clutter up memory with copies?  But clearly there are
unexpected interactions later because of this, interactions that
produce obvious strange behavior in 2.2.0 but seem to work fine in 2.1.x.
I don't know if this has any security implications someone from DC should
look at, but it's probably worth a note in the product author's security
guide.

I also have no idea whether or not the similar eTailor problem has a
similar cause and solution.

--RDM


___
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] FWIW, ZCVSMixin now at 0.1.1... and rising. ;-)

2000-06-30 Thread Jim Hebert

Steve and Shane,

We've been positively *dying* to have cvs or cvs-like functionality. It's
one of those things where we left the unix-everything-is-a-file-idiom and
went, "Oh, um, heh, now what?" =)

We have been making do with Version objects instead, which are far more
rcs-like (exclusive locking, no merging) and not really good when we want
to give 2 different people 2 different medium-to-long term projects for
adding things to the site. Imagine, one adds something to / and / gets
version-locked now, so the other person can't even add things to /
anymore.

Anyways, enough of that. Point being, we want our site coders to be able
to do a sandbox (much like Version essentially provides, if possible, ie
transparent rather than explicitly located somewhere else) where they can
develop stuff and the ability to only check certain things in, and the
ability to do merges, etc. If we couldn't do the development transparently
on the production server, and we had to have developers running zope on
their workstations and pull from the cvs repository there, that'd be
alright too though I guess.

How much of this is provided for now or planned on being provided for by
this product? And, what can we do to help? I don't know that we have any
bodies we can sick on this, but I'd love to get together with you guys and
get some of the things that need to be done up on Cosource so that
organizations interested in having this can throw money at it, and so that
people (you guys included) who might have trouble finding the time to work
on it can have a little incentive. =)

jim

-- 
Jim Hebert   http://www.cosource.com/
[EMAIL PROTECTED]  The cooperative market for open source software

"Well actually I was considering opening a market in flying pigs. Mostly
because it would be more practical" -- Alan Cox




___
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] EMarket and 2.2.0b3

2000-06-30 Thread R. David Murray

On Fri, 30 Jun 2000, R. David Murray wrote:
 manage_options.append(copy(item))
 
 makes the management interface behave normally with the product installed.

Darn, I should have done more testing.  I only fixed the prompt
for permissions problem.  manage_workspace still goes to the
import/export screen...back to the testing.

--RDM


___
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] EMarket and 2.2.0b3

2000-06-30 Thread R. David Murray

On Fri, 30 Jun 2000, R. David Murray wrote:
 Darn, I should have done more testing.  I only fixed the prompt
 for permissions problem.  manage_workspace still goes to the
 import/export screen...back to the testing.

Arg, it's worse than I thought.  My original test was broken.
I haven't found the problem at all.  So please ignore all my
recent posts about this and I'll crawl back under my rock and
do some more careful testing.

--RDM


___
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] Messing with the namespaces stack [Was: (no subject)]

2000-06-30 Thread Jim Hebert

On Thu, 29 Jun 2000, Shane Hathaway wrote:

 Actually what you did is pretty clever, Jim.  It even relies on stable
 interfaces.

Uh oh, careful, I'm encouragable and you'll really have a monster on your
hands. ;-)

  The reason for the inner dtml-with is that my pages are DTML Methods, not

OK, I am just going to go ahead and spill the rest of what swirled around
in my head about zope when I threw up this vistasource.com site, in the
hopes that I'll either get another ego stroke (*grin*) or some more
insights as to the reason why things are done the way they are (ie, not
the way I do 'em!). This is probably going to be long, please forgive me
for going from newly subscribed to thinks-he-can-write-a-howto overnight!
=)

I am bucking a trend, I am starting to realize. Big time! The assumption
seems to be that any given page will build itself, it will suck in
standard_html_header and standard_html_footer, and compose itself of
whatever else in between those things. DTML Document is the base unit of a
page.

Partially because I was planning at the time to build an over-simplified
front end for our system, I wanted people to be able to upload simple,
stupid chunks of "content" html and not have to do things like put
dtml-var standard_html_header at the top and ..._footer at the bottom.
Any lame wysiwyg editor that had save-to-ftp could then push up a 'body
file' into the right folder, and I could get writers writing without
learning zope.

I also started to really groove on the idea of Object Oriented precepts
for my pages, and having to explicitly "#include" peices like the common
stuff offended those sensibilities. I wanted "objects" that had both
"data" and "code" as its members, in a nice little bundle.

So, I made the decision that my atomic unit of what constitutes a "page"
on my server is a Folder object. This lets me collect everything
specific to a page, images that are only used there, methods that are
only used there, etc, in a tidy little bundle. So here's my scheme:

I think of /index_html, a DTML Method, as if it were a member function of
an object. It might as well be named "render_this_folder_as_a_page." So,
it looks like (oversimplifying:)

dtml-with images
dtml-with "PARENTS[0]"
dtml-var standard_html_header
tabletrtd
dtml-var menu
/tdtd
dtml-var body
/td/tr/table
dtml-var stnadard_html_footer
/dtml-with
/dtml-with

So, now, in each folder I just put a dtml method called body. When you
visit /about, index_html gets acquired, but since it's a dtml method, the
/about folder remains the first place to look for other stuff, so body
gets located in /about. If I want to override the menu code, I also stick
another object in there called menu, but by default my toplevel menu code
works for all the subfolders. In some perverse sense, sub-pages
conceptually are sub-classes of higher up pages, which inherit some things
(index_html for instance) things and override things (/body, nearly
always, and sometimes other things).

If I repeitively built $header + $menu + some content + footer over and
over again in page after page, I couldn't radically redesign my site (for
instance, pulling in body and sticking an advertisement between every 3rd
paragraph) without touching every page. But in the model that I use, the
one true index_html method is free to suck body in, do crazy
post-processing to it, and then send that out.

And, of course, index_html itself can be overridden for sub-trees of the
site, if need be.

And, I can also come up with different renderers, I suppose. Untested
might be the idea that I could put /alt_renderer as a DTML Method at the
top level, then visit /about/alt_renderer and invoke that method in the
/about context. So by separating content from presentation, I can plug my
content into lots of things simultaneously. Presumably.

The only thing that has bummed me out about this strategy is that I feel
like that every time I use a 3rd party product I end up working up hill:
it usually expects to be able to write out a DTML Method or Document that
says

dtml-var standard_html_header
app-specific-logic-here
dtml-var standard_html_footer 

and have gotten it all. Adding a "Search Interface" is a typical example
of this. When I can, I hack around this and migrate
"app-specific-logic-here" into SomeFolderName/body. But for products which
manufacture pages on an ongoing basis, e.g. FlexFaq/Knowledgebase,
this is less of an option, and points more towards me hacking the package
code itself.

I don't honestly expect that what I invented in the middle of the night 7
days before the VistaSource launch to revolutionize how everyone builds
pages (like I said, I actually suspect that these hacks that I invented
have some major drawback that you guys will help clue me into, though,
hehehe, I haven't been dissauded by the search drawback..), but
perhaps someone will have suggestions on how I can make my style "play
nicer" with all these products, too.

Sorry so long. If this was illustrative to 

[Zope] How to upload 900 files, in one shot ?

2000-06-30 Thread Jonathan Desp

Hi, anyone here can help me with that problem below ? -v


 How I can upload 900 files inside Zope, if I want to be able to manage
 them by the Zope Interface, I cannot browse inside data.fs, and I cannot
 upload my 900 files by FTP ing them. Because the server cannot use the
 8021 port. I cannot upload them with Itamar program - LoadSite, because
 it's not working, windows close the program.
 
 So do you know a way ? If not, it will take me 8 hours to upload all
 those files, inside the data.fs, one by one. It's a nice problems, I
 tryed to find a way since 3 days, now I ask the experts. It would be
 good for Zope, in the next version, to add a program, where we can
 upload many file in one shot/click.
 
 --
 Very truly yours,
 
 
 Jonathan Desp
 Atoma
 Matter will become Software
 http://www.atoma.f2s.com
 

-- 
Very truly yours,


Jonathan Desp
Atoma
Matter will become Software
http://www.atoma.f2s.com


___
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] Error handling and super users....

2000-06-30 Thread Andy

Hi,

A couple of questions...:

a) is there a way of sending an error to a default object other than
standard_error_message? For example I would like errors of type x to be
handled by one object and y by another. Obviously most objects should have
their own error handling that makes sense, but a there are few special cases
when I can see it being useful.

The most obvious method is to put a big dtml if inside the
standard_error_message and send the errors to those objects. But does anyone
know of a more elegant solution (if not I can see a potential product in
there)...

b) anyone know a way of restricting the super_user to a domain? Zope allows
you to restrict users, but I would like to tighten down Zope a little more
by only allowing super_users from within our domain...

Thanks in advance.

Andy McKay


___
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] Re: Question (was on zope-ptk)

2000-06-30 Thread Steve Alexander

Hi Jonathan,

I arbitrarily deem this to be a [EMAIL PROTECTED] rather than a
[EMAIL PROTECTED] question, so I'll move it there :-)


Jonathan Desp, who wants to upload a lot of files into Zope, wrote:
 
 someone said me to use load site, but there is a bug with this program.

What is the bug in loadsite that is stopping you from using it?

You have a couple of options here we haven't explored yet:

  1: Fix the bug in loadsite yourself.
  2: Describe the bug in sufficient detail that someone else
 feels moved to spend time fixing it.

 Anyone know another way to upload 900 files in one shot ?

What kind of files are they? What do you want to do with them once
they're in Zope?

Is uploading these files a recurring need you have, or is it a one-off?

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

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




Re: [Zope] Backing Up Zope (was: Re: [Zope] Data.fs.lock?)

2000-06-30 Thread Toby Dickenson

On Thu, 29 Jun 2000 17:19:32 -0400, Shane Hathaway
[EMAIL PROTECTED] wrote:

Quite simply, Data.fs is appended, not modified, except during a pack
operation.  Think of it like a binary log file.  Therefore there are
only two ways a simple, live backup of Data.fs can fail:

1) You do the copy in the middle of a pack operation.  For most,
packing is a rare operation.  But if this happened, your backup would
be worthless.

I think its better than that. FileStorage packs itself into a
temporary file, which is renamed to data.fs only when the pack is
complete.

2) You get a partly truncated record at the very end.  This is actually
not a big deal, and AFAIK in most cases ZODB is capable of
automatically rolling back a partially committed transaction.


I think the other exception is during an Undo, where Zope will rewrite
one byte in the middle of the file.


Toby Dickenson
[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] ZCatalog Search Q

2000-06-30 Thread Leonard Chan

Hi,

I'm trying to search a catalog and return a list of hits, 
and here is a code fragment:

dtml-in Catalog
 a href="dtml-var "Catalog.getpath(data_record_id_)""
  dtml-var title
 /a
 dtml-var idbr
/dtml-in

This works ok, however, I understand that the catalog search 
does not actually return object references to the actual 
objects catalogued.

I'd like to include some attributes from the actual objects 
(maybe by accessing the actual object via id, etc?) in the 
result list.
 
Can someone let me know how to do that?  I can of course include those attributes in 
the catalogue meta table so they  would be returned with the search results, but I 
don't really 
want to do that unless there is no other way.

Thanks for any info/help.

Rgds
Len



___
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] ZClass in ZClass problem

2000-06-30 Thread Oleg Broytmann

Hello!

   I started to learn ZClasses. I created a product, added a Zclass in it,
and added a Zcalss inside outer ZClass - I want to create ZClass that's
addable only inside outer ZClass.

   Then the problems begin. All management URLs for inner ZClass contain
%20, so URLs look like
"propertysheets/methods/RandomZItem%20/manage_workspace" and
"propertysheets/methods/RandomZItem_add%20/manage_workspace".
   If I click on the link I got the AttributeError (of course). When I
manually remove the offending %20, I can manage the object, but it's
tiresome to remove it every time.

   The problem manifested on both 2.1.4 and 2.2.0b3. What's wrong?

Oleg.(All opinions are mine and not of my employer)
 
Oleg Broytmann  Foundation for Effective Policies  [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
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] LocalFS cache, was Re: ZODB or not ZODB?

2000-06-30 Thread Toby Dickenson

On Thu, 29 Jun 2000 10:44:39 -0700, "Jonothan Farr" [EMAIL PROTECTED]
wrote:

 How do you do to cache those objects, since LocalFS
 referenced objects are not cached by Zope?

They aren't cached. I experimented with adding a cache, but ran into some
problems and gave up. It would probably be worth giving it another shot, though.

LocalFS happily uses the If-Modified-Since header, so an http cache (I
use Squid, http://www.squid-cache.org/) can cache LocalFS content
outside of Zope.

This assumes you are using LocalFS to serve whole files over http,
rather than processing those files inside Zope.

Toby Dickenson
[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 )




Re: [Zope] queries and tiny tables and python methods... oh my!

2000-06-30 Thread Rik Hoekstra



Timothy Wilson wrote:
 
 Hi everyone,
 
 (Please excuse the vague Wizard of Oz reference in the sub., but my brain
 may be imploding. :-)
 
 I'm trying to merge several type of Zope objects, and I'm getting lots of
 little errors. I wonder if someone could suggest where my problem lies.
 
 1. I'm querying our LDAP server to retrieve the records for a given person
 in the directory. No problem there.
 
 2. I'm parsing one of the entries in the LDAP directory to retrieve the
 user's location. Python method code is simple.
 
 3. I'm using a Tiny Table to look up a value for one of the parsed strings.
 Easy.
 
 The problem is hooking them all together. Passing the query to a
 PythonMethod is throwing up the following error:
 
 Error Type: TypeError
 Error Value: argument l: expected read-only character buffer, instance found

The error means you're trying to split up a string, but the argument is
no string, but an instance (a Python Object). In many cases this is
caused by an omission of parenthesis, like so 

called_object instead of called_object()

in which case the object is referenced instead of called and nothing is
returned (of course). I did not find the culprit in your description,
though. 


snip

 
 (Object: parseLocation)
 (Info: ((['SB_B208'],), {}, None))
   File string, line 2, in parseLocation
 TypeError: (see above)
 

I do not quite get what part you want to parse. Is it 'SB_B208'?
accessing this in python is a bit strange due to the returned value. You
get to the 'SB_B208'part in the following way:

whateverreturnstheresult(someargument)[0][0][0], meaning (in this
case):

the first element (of the list) of the first element (of the first
tuple) of the returned tuple


 
 parseLocation is a Python Method which takes 1 argument (a string) and
 returns the first element of the list that's formed by splitting the string.
 That first element is a two-letter code that's looked up in a Tiny Table
 called buildingCodes which returns the full name of the building.
 
 OK, it looks to my relatively inexperienced eyes that the Python Method
 isn't getting an argument of the type is expects.

yep, see above

 
 Here's the code for parseLocation ('l' is the argument):
 
 x = string.split(l, '_')
 return x[0]

I may be reading badly, but can you explain what the l is (or is
supposed to be)? Is it the tuple in the traceback?


 
 (BTW, changing it to x = string.split(`l`, '_') eliminates the error, but
 nothing is rendered.
 
 qry_person is an ZLDAP filter method that takes one argument (uid). The
 original dtml to display this mess looks like:
 
 dtml-call "REQUEST.set('user_id', user_id)"
 dtml-in "qry_person(uid = user_id)"br
   dtml-in "buildingCodes(parseLocation(l))"
 dtml-var buildingbr  # 'building' comes from the Tiny Table
   /dtml-in
 /dtml-in
 
 I'd appreciate it if anyone has any ideas about this. I'm probably making
 the whole thing too complicated, but for reasons of code reuse, this seemed
 like the most efficient approach.


hth

Rik

___
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] FOR loops?

2000-06-30 Thread Andy Gates

This ought to be easy:

dtml-in through a list of entries.  Each entry has a string and a 
number which indicates its level of indentation, so "Root",0; "Main",1;
"Sub",2 and so on.

Presenting these in a SELECT input I want to show the indentation so 
it's easy to see and use.  Obvious answer is to use nbsp; characters 
to pad the values thus:

select
dtml-in sequence
  option value="whatever"
for loop=0 to entry-indent-value
  nbsp;
/for
entry-string-value
  /dtml-in
/select

So where does Zope hide its FOR loop?  Can't find the bugger anywhere!
--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


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




Re: [Zope] ZCatalog Search Q

2000-06-30 Thread Chris Withers

Leonard Chan wrote:
 I'd like to include some attributes from the actual objects
 (maybe by accessing the actual object via id, etc?) in the
 result list.

You can get the actual object with:

Catalog.getobject(data_record_id_) inside your dtml-in loop.

This is supposedly a 'bad' thing to do but there's nothing better right
now...

  I can of course include those attributes in the catalogue meta table so they  would 
be returned with the search results, but I don't really
 want to do that unless there is no other way.

Well, it might be the best way. Why?

...because otherwise you have to load up the whole object to get the
attributes you want. If there's only a few attributes like this, which
are small anyway, and your objects are large, then your wastign a load
of RAM you don't need to be.

HTH,

cheers,

Chris

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




Re: [Zope] FOR loops?

2000-06-30 Thread Andrew Kenneth Milton

+[ Andy Gates ]-
| This ought to be easy:

...

| Presenting these in a SELECT input I want to show the indentation so 
| it's easy to see and use.  Obvious answer is to use nbsp; characters 
| to pad the values thus:

You have to drop to the python level I'm afraid...


| 
| select
| dtml-in sequence
|   option value="whatever"
| for loop=0 to entry-indent-value

dtml-in "_.range(entry_indent_value)"

|   nbsp;

/dtml-in

| /for
| entry-string-value
|   /dtml-in
| /select
| 
| So where does Zope hide its FOR loop?  Can't find the bugger anywhere!

You can find these things... you just have to know what you're looking for...

-- 
Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew Milton
The Internet (Aust) Pty Ltd  |  F:+61 7 3870 4477   | 
ACN: 082 081 472 |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068|[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 )




Re: [Zope] FOR loops?

2000-06-30 Thread Marcel Preda

 select
 dtml-in sequence
   option value="whatever"
 for loop=0 to entry-indent-value
   nbsp;
 /for
 entry-string-value
   /dtml-in
 /select
 

instead of `for' use :
dtml-in "_.range(0,_['entry-indent-value'])"
...
/dtml-in
PM



___
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] urlquote?

2000-06-30 Thread Magnus Heino (Rivermen)


Hi.

Is there a method available somewhere in python to urlquote(?) a string.

Example: lösning - l%f6sning

/Magnus

___
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] FOR loops?

2000-06-30 Thread Phill Hugo

Andy Gates wrote:

 select
 dtml-in sequence
   option value="whatever"
 for loop=0 to entry-indent-value
   nbsp;
 /for
 entry-string-value
   /dtml-in
 /select
 
 So where does Zope hide its FOR loop?  Can't find the bugger anywhere!

You already did. dtml-in is FOR. As in Python's "for v in list". Use
dtml-in "_.range(0, _['entry-indent-value']" /dtml-in

Phill

___
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] Alternative Rendering (was Re: [Zope] Messing with the namespaces stack)

2000-06-30 Thread Chris Withers

Jim Hebert wrote:
 Uh oh, careful, I'm encouragable and you'll really have a monster on your
 hands. ;-)

ego stroke
I like the way you think, lots of good will come of it.. ;-)
/ego stroke

 I am bucking a trend, I am starting to realize. Big time! The assumption
 seems to be that any given page will build itself, it will suck in
 standard_html_header and standard_html_footer, and compose itself of
 whatever else in between those things. DTML Document is the base unit of a
 page.

I think it's a trend worth bucking, as you point out, this trend can be
out of line with the whole acquisition - inheritence objecty thing that
Zope does so well...

 front end for our system, I wanted people to be able to upload simple,
 stupid chunks of "content" html and not have to do things like put
 dtml-var standard_html_header at the top and ..._footer at the bottom.
 Any lame wysiwyg editor that had save-to-ftp could then push up a 'body
 file' into the right folder, and I could get writers writing without
 learning zope.

Totally agree with this :-)))

[snip excellent possible solution]

 And, I can also come up with different renderers, I suppose. Untested
 might be the idea that I could put /alt_renderer as a DTML Method at the
 top level, then visit /about/alt_renderer and invoke that method in the
 /about context. So by separating content from presentation, I can plug my
 content into lots of things simultaneously. Presumably.

This would be really useful for things like WAP and AvantGo...

[snip sucky products]

Well, you either have to re-develop the products or live with them :/

 I don't honestly expect that what I invented in the middle of the night 7
 days before the VistaSource launch to revolutionize how everyone builds
 pages 

With any luck, you may be surprised ;-)

 perhaps someone will have suggestions on how I can make my style "play
 nicer" with all these products, too.

I have a slightly different take on the problem from back when I used to
use mason. Autohandlers solve parts of this...

An autohandler is a bit of code which would get executed during URL
traversal. it's main use is to render a wrapper around a page, for
example:

...do stuff...
process and render the rest of the URL (called mc_auto_next in Mason)
...do mroe stuff...

So your standard_ stuff apears in the autohandler and is _automatically_
wrapped around the eventual object.

How far would this go to doing what you were talking about?

Not far enough might be the answer... I'm really interested in the stuff
you talked about so please email more of it to me directly if you don't
think it's list-related enough

hope to hear from you soon,

Chris

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




[Zope] SV: [Zope] urlquote?

2000-06-30 Thread Magnus Heino (Rivermen)


 in module 'urllib'
 
 quote (string[, safe])
 Replace special characters in string using the "%xx" escape. 

Doesn't work like that here.

 import urllib
 urllib.quote('lösning')
'l\366sning'


Am I doing anything wrong? :-P

/Magnus

___
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] Re: Messing with the namespaces stack

2000-06-30 Thread Hamish Lawson

Jim Hebert wrote:

 But I wanted to be able to just write dtml-var foo_png while 
 working on
 pages, so I wrap the content with 
 dtml-with images
 dtml-with "PARENTS[0]"
 ...
 /dtml-with
 /dtml-with

Jim, that is indeed clever. Am I right, however, in thinking that every
DTML method or DTML document that wants this additional-parent
behaviour will need to use these dtml-with wrappers? I think what I'm
after is the ability to alter the parents of the containing folder
itself, so that any contained method automatically has this modified
acquisition path.

Hamish Lawson



Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

___
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] Re: Question (was on zope-ptk)

2000-06-30 Thread Steve Alexander

Jonathan Desp wrote:
 
   Anyone know another way to upload 900 files in one shot ?
 
  What kind of files are they? What do you want to do with them once
  they're in Zope?
 
 they are all in .html, I want to publish it inside www.atomasoft.com, as
 a website.

You should be able to simply FTP these files into Zope. Have you tried
this?

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

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




Re: [Zope] ZCatalog Search Q

2000-06-30 Thread Chris Withers

Leonard Chan wrote:
  This is supposedly a 'bad' thing to do but there's nothing better right now...
 
 Why is this a 'bad' thing?  'Cause it requires loading the whole object?

Nope, 'cos it doesn't work with anything that plays with traversal, like
SiteAccess. Something better should be coming along in Zope 2.2 but it
probably won't be documented until Zope 3 :(

 Yes. Our situation is like this.  We have a bunch of objects (ZClass) in
 various folders, and we would like to provide a dynamic search facility
 for the users (in addition to traversing folders and sub-folders, which
 is not a problem).
 
 The object has a description field, which is a few lines of text (there
 is a long description field, which varies from zero length to up to 10
 times the size of the desc).
 
 We need to display the description field (but not the long desc) on the
 search results, so to implement this, we can either stick the desc in
 the catalog meta-table, or use getobject as you suggested to retrieve
 the object (and hence the required attributes).
 
 Initially, I'm a bit worried about sticking the desc in the meta-table
 'cause it's relatively big compared to the other attributes.  Maybe it's
 still cheaper than getting the object (which includes the much bigger
 long desc field) every time?  Seen similar situation before?  Any help
 is appreciated.

Well, given that it's going to be easier and cleaner for you to put it
in the metadata table I'd d othat. I can really see any problems with
this.

I'm sure someone else on the list will comment if they know better...

cheers,

Chris

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




RE: [Zope] Kid clicking and Zope thread deadlock

2000-06-30 Thread Brian Lloyd

 "Kid clicking" is a technical term used in multimedia game programs, 
 referring to firing multiple click events quickly. The most 
 scary part is 
 that under intense clicking, a multi-threaded program would go into 
 dead-lock.
 
 I have a Zope application running. When I kid-click on one button, it 
 actually locks Zope up. This error does not happen when I run Zope in 
 single-thread mode. So, for the bug seems to come from Zope thread 
 dead-locking.
 
 snip
 
 My Zope is 2.1.6. More info: it happens both with Netscape 
 and IE. More 
 info: when kid clicking on the webpage, actual requests are 
 sent to the Zope 
 server, I see from the terminal 4 lines about
 
 2000-06-30T00:29:43 PROBLEM(100) ZSybaseDA Changed database 
 context to 
 'master'.
 Changed database context to 'mydatabase'.
 
 and it then goes into deadlock. Not sure whether it's Sybase or Zope 
 problem.

The quick way to determine this: install a fresh Zope without 
SybaseDA installed and see if you can reproduce the kid-clicking 
behavior.

Another thing potentially to look at: there is problem with 
Sybase connections that I have run into before where if you 
have a request that runs a transactional query, then a non-
transactional query, then trys another transactional query 
you get a hang :(  I don't know if this could be the case 
here, but if so you might want to look here for more info:

http://classic.zope.org:8080/Collector/1059/view




Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.com 



___
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] Messing with the namespaces stack [Was: (no subject)]

2000-06-30 Thread Shane Hathaway

Jim Hebert wrote:
 OK, I am just going to go ahead and spill the rest of what swirled around
 in my head about zope when I threw up this vistasource.com site, in the
 hopes that I'll either get another ego stroke (*grin*) or some more
 insights as to the reason why things are done the way they are (ie, not
 the way I do 'em!). This is probably going to be long, please forgive me
 for going from newly subscribed to thinks-he-can-write-a-howto overnight!
 =)

Ha ha! I like your enthusiasm, Jim.

 I am bucking a trend, I am starting to realize. Big time! The assumption
 seems to be that any given page will build itself, it will suck in
 standard_html_header and standard_html_footer, and compose itself of
 whatever else in between those things. DTML Document is the base unit of a
 page.
 
 Partially because I was planning at the time to build an over-simplified
 front end for our system, I wanted people to be able to upload simple,
 stupid chunks of "content" html and not have to do things like put
 dtml-var standard_html_header at the top and ..._footer at the bottom.
 Any lame wysiwyg editor that had save-to-ftp could then push up a 'body
 file' into the right folder, and I could get writers writing without
 learning zope.

It's a great idea but I've had some thoughts on this myself.  I think
the approach I would take is to create a ZClass.  Content authors would
create instances of this ZClass and would not have to use
standard-html-header nor any other DTML if they don't want to.  The
ZClass would perform a simple transformation of the content before
presenting it on the Web, such as adding standard_html_header/footer
and including the title and date.

 I also started to really groove on the idea of Object Oriented precepts
 for my pages, and having to explicitly "#include" peices like the common
 stuff offended those sensibilities. I wanted "objects" that had both
 "data" and "code" as its members, in a nice little bundle.

 So, I made the decision that my atomic unit of what constitutes a "page"
 on my server is a Folder object. This lets me collect everything
 specific to a page, images that are only used there, methods that are
 only used there, etc, in a tidy little bundle. So here's my scheme:
 
 I think of /index_html, a DTML Method, as if it were a member function of
 an object. It might as well be named "render_this_folder_as_a_page." So,
 it looks like (oversimplifying:)
 
 dtml-with images
 dtml-with "PARENTS[0]"
 dtml-var standard_html_header
 tabletrtd
 dtml-var menu
 /tdtd
 dtml-var body
 /td/tr/table
 dtml-var stnadard_html_footer
 /dtml-with
 /dtml-with
 
 So, now, in each folder I just put a dtml method called body. When you
 visit /about, index_html gets acquired, but since it's a dtml method, the
 /about folder remains the first place to look for other stuff, so body
 gets located in /about. If I want to override the menu code, I also stick
 another object in there called menu, but by default my toplevel menu code
 works for all the subfolders. In some perverse sense, sub-pages
 conceptually are sub-classes of higher up pages, which inherit some things
 (index_html for instance) things and override things (/body, nearly
 always, and sometimes other things).

I think you'll have more flexibility if you make ZClasses a major part
of your solution. When the time comes, you'll be able to make
fundamental changes more easily. Have you learned about property sheets
yet?  They are the key to success with ZClasses.

 If I repeitively built $header + $menu + some content + footer over and
 over again in page after page, I couldn't radically redesign my site (for
 instance, pulling in body and sticking an advertisement between every 3rd
 paragraph) without touching every page. But in the model that I use, the
 one true index_html method is free to suck body in, do crazy
 post-processing to it, and then send that out.

 And, of course, index_html itself can be overridden for sub-trees of the
 site, if need be.
 
 And, I can also come up with different renderers, I suppose. Untested
 might be the idea that I could put /alt_renderer as a DTML Method at the
 top level, then visit /about/alt_renderer and invoke that method in the
 /about context. So by separating content from presentation, I can plug my
 content into lots of things simultaneously. Presumably.

Also remember you can play tricks with acquisition.  If you have a
"default" style and a "lowres" style, you can set up your directories
like this:

/home
  /lowres
  /content

"lowres" and "content" are both children of "home".  The default style
elements are in home.  When the user browses to
/home/content/index_html, they get the default style.  When the user
visits /home/lowres/content/index_html, they get the lowres style.

 The only thing that has bummed me out about this strategy is that I feel
 like that every time I use a 3rd party product I end up working up hill:
 it usually expects to be able to write out a DTML Method or Document 

Re: [Zope] SV: [Zope] urlquote?

2000-06-30 Thread Erik Enge

On Fri, 30 Jun 2000, Magnus Heino (Rivermen) wrote:

 Am I doing anything wrong? :-P

Are you using this within Zope?  Then you could do:

dtml-var the_variable url_quote

If I'm not mistaken, Zope also has sql_quote and html_quote.


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

2000-06-30 Thread Jonathan Desp

Hi,

Good, I did it, I mean, I succeeded, I do know how to procceed with
LoadSite, Itamar, you should say in your page to download not only
wxpython, but also winsock etc.. in the wxpython page, they are saying
it, but I didnot see it, 2 other programs, we need to download for see
LoadSite working.

Ok ? thanks guys ! for your support..

Zope Team should incorporate that software into Zope too. As well as
they should put their "Available Object" white box, you know what I mean
? -ABOVE- the files. See, when you have 900 files in one directory,
you need to scroll down each time.. so I suggest to put that box, you
know the box I mean ? Place it at the top of the page.

___
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] 2.2b3 hangs a lot

2000-06-30 Thread Brian Lloyd

 been running 2.2.0b3 for a few days now.  
 config
 redhat6.1
 postgres
 ZPygreSql
 kmnetnews
 
 after some time, zope just hangs.  when i do top, there's no 
 processor usage at
 all on all python processes.  after a few minutes, zopes wake 
 up  and continue
 to serve.  the cycle continues after some time.  the hangup 
 is very sporadic.
 snip

If you look at the server logs when it hangs, do you see any 
pattern as to what was requested when this happens? I haven't 
been hearing of any hanging issues with the 2.2 betas, which 
makes me suspect that something specific to this site may be 
in play here.

The fact that it comes back to life on its own after a while 
makes me think that this is either a very strange system 
issue or tied up with something that has a timeout (for ex.
is it possible that a query is trying to run, timing out 
against the postgres database?) If the PygresSql DA is not 
fully thread-safe then I could imagine this as a possiblity.

Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.com 



___
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 use acquisition when instantiating an object via a REQUEST.set

2000-06-30 Thread Corey Zimmet

I am a relatively new Zope user and I have a simple python Class in a python
product such as:

class Item(Acquisition.Implicit):
  # Just a simple item class

  def __init__(self, id):
self.id=id

If I instantiate the object in DTML with somthing like this:

dtml-call "REQUEST.set('item',Item.Item('someid'))"

How can I make the object acquire the current context?  I do not want the
object to be added to any container other than the REQUEST.

Thanks,
Corey


___
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] queries and tiny tables and python methods... oh my!

2000-06-30 Thread Timothy Wilson

On Fri, 30 Jun 2000, Rik Hoekstra wrote:

  The problem is hooking them all together. Passing the query to a
  PythonMethod is throwing up the following error:
  
  Error Type: TypeError
  Error Value: argument l: expected read-only character buffer, instance found
 
 The error means you're trying to split up a string, but the argument is
 no string, but an instance (a Python Object). In many cases this is
 caused by an omission of parenthesis, like so 
 
 called_object instead of called_object()

OK, that makes sense.

 in which case the object is referenced instead of called and nothing is
 returned (of course). I did not find the culprit in your description,
 though. 

 I do not quite get what part you want to parse. Is it 'SB_B208'?
 accessing this in python is a bit strange due to the returned value. You
 get to the 'SB_B208'part in the following way:
 
 whateverreturnstheresult(someargument)[0][0][0], meaning (in this
 case):

I was trying to walk the fine line between providing too much detail and not
enough. Briefly, 'SB_B208' is an example of the type of string I'm trying to
parse. I do a string.split('l', '_') (where 'l' is the argument to the
string-splitting Python method) and get ['SB', 'B208']. 'SB' is one of the
two-letter codes that gets lookup up in the Tiny Table and 'B208' is an
office number. Together, these two strings represent a person's location in
our LDAP directory.

I don't understand where the weird tuple in the traceback is coming from.

  Here's the code for parseLocation ('l' is the argument):
  
  x = string.split(l, '_')
  return x[0]
 
 I may be reading badly, but can you explain what the l is (or is
 supposed to be)? Is it the tuple in the traceback?

'l' is passed to the Pyton Method. Examples would be: FH_123, SB_A231,
DO_111, etc.

  (BTW, changing it to x = string.split(`l`, '_') eliminates the error, but
  nothing is rendered.
  
  qry_person is an ZLDAP filter method that takes one argument (uid). The
  original dtml to display this mess looks like:
  
  dtml-call "REQUEST.set('user_id', user_id)"
  dtml-in "qry_person(uid = user_id)"br
dtml-in "buildingCodes(parseLocation(l))"
  dtml-var buildingbr  # 'building' comes from the Tiny Table
/dtml-in
  /dtml-in

Anyone see where the problem lies?

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/



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

2000-06-30 Thread Peter Bengtsson


 Zope Team should incorporate that software into Zope too. As well as
 they should put their "Available Object" white box, you know what I mean
 ? -ABOVE- the files. See, when you have 900 files in one directory,
 you need to scroll down each time.. so I suggest to put that box, you
 know the box I mean ? Place it at the top of the page.

Well, GOOD use of Zope is not to have 900 files in one directory, but to use
acquisition and different folders for different objects or projects or
sites.
When I work with the Zope interface I realize that I spend more time on
clicking the objects than the "Available Object" white box.

What you could do is copy the HTML code to the "Available Object" white box
and implement that into the menu (menu.dtml).
Use some extra javascript to ensure that the focus is put in the workspace
frame.

A GOOD thing about Zope being Open Source is that you can tamper the
interface for your needs if you want to.

Me, for example, have created a list of all objects (not only the folders)
below the tree in the menu frame. And I have the title of the object pop up
in the status row of the browser.
The purpose of that was that I sometimes forget what I named the object I
created, when I am about to use it in a method of document in another
folder.

Even simpler would be to change the HTML source of the management interface
yourself and cut'n'paste the "Available Object" white box above the list of
objects.

 ___
 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] MYSQLUF : win32 binary for _mysql.pyd

2000-06-30 Thread Darcy Clark

I am trying to set up MySQL user folder
[http://www.zope.org/Members/vladap/mysqlUserFolder] on my WinNT box.
This product requires the compiled MySQLdb python module. I have
MYSQL.pyd, but I'm unable to compile _mysql.pyd on Windows ? Does anyone
have this binary ?

thanks in advance,
Darcy

---
Ph: (734) 764 3377 
Email: [EMAIL PROTECTED]
URL: http://www-personal.engin.umich.edu/~darcyc/
---

___
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] Available Object List (Was Re: [Zope] GOOD)

2000-06-30 Thread J. Atwood

 they should put their "Available Object" white box, you know what I mean
 ? -ABOVE- the files. See, when you have 900 files in one directory,
 
 Aye!  I second that.

I know it is bad behavior to just say "me too" and send it to the list..
but...

ME TOO!

This is one of those things that would seem like it would take DC about 10
minutes to do and would greatly improve our (Zope Programmers) lives.

What say DC? 2.2b4?

J


___
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] PCGI Error: (102) failure during connect to ZServer

2000-06-30 Thread [EMAIL PROTECTED]

This is with Zope-2.2.0b3-src.tgz

The pcgi wrapper reports ...is unable to connect to the ZServer
background process via Unix socket .../var/pcgi.soc

I am trying to install this on a remote host, this error came up
locally too, though.

I followed glndspud's howto on 3rdparty host setup. With a 2.1.6
release I was able to get zope running. However, with this setup I
was not able to login through manage, the authorization did not work.
So my reasoning, an upgrade should make this error vanish. Not so,
until now. ;-(

Christian

___
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] SQL method: Trying to be too clever?

2000-06-30 Thread Andy Gates

Is it possible to pass a variable into anything other than the values 
of a SQL method?  I'm trying to pass a parameter to a method, such that
the param is used to define which field is affected by the action:

insert into related (rootstory, dtml-sqlvar field)
values (dtml-sqlvar storytitle,
dtml-sqlvar value)

Possible?  This doesn't work, of course...
--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415


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

2000-06-30 Thread Jake LeBeau

I'm running it here on W2K Server - I don't remember having much of a problem setting 
it up.
I do run it as a service, and it seems to work fine.

Jake LeBeau

 Robin Becker [EMAIL PROTECTED] 06/28/00 04:40PM 
The boss says he couldn't install Zope on our Win2000 box. He tried 3
times. Anybody else have a problem with M$'s latest?
-- 
Robin Becker

___
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] Question from ZopeNewbies poster. . .

2000-06-30 Thread addyd

I am forwarding to this list the following question asked on the
ZopeNewbies discussion list today.
I have told the poster about this list. You may wish to post your answer
both here and on the ZopeNewbies discussion list page to make sure the
poster sees your answer.

Author:   Kelvin, Tze Wai Cheong
Posted:   6/30/00; 3:46:51 AM
Msg#: 658 (top msg in thread)


I'm developing a web-site which requires the storage of images in the
database. I have defined this field as LONGBLOB in my database tables. The
problem is I can't insert the image at the insert form, and worse of all I
don't know how to start. according to the mySQL manual from mySQL.com's
documentation, I should be storing the path of the picture file into the
database. I have tried but ZOPE defined a floating-point error regarding
the field.

How should I go around this?
:::
Darren Addy
Internet Specialist and
Interim Web Presence Coordinator
Office of Information Technology Services
University of Nebraska at Kearney


___
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] SQL method: Trying to be too clever?

2000-06-30 Thread Chris Withers

Andy,

An error message / traceback would be useful ;-)

Rik Hoekstra wrote:
 insert into related (rootstory, dtml-sqlvar field)
 
 in that case you just want a dtml-var field (you not passing it as sql
 query values)

Nope, the dtml-sqlvar field is for quoting use in SQL statements,
kindof like dtml-var field sql_quote which I think may be even be
correct syntax...

cheers,

Chris

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




Re: [Zope] SQL method: Trying to be too clever?

2000-06-30 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

  in that case you just want a dtml-var field (you not passing it as sql
  query values)

Perfecto.  That's two today.  My turn to get the beers.

AndyG

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

2000-06-30 Thread Robin Becker

In article [EMAIL PROTECTED], Jake LeBeau
[EMAIL PROTECTED] writes
I'm running it here on W2K Server - I don't remember having much of a problem 
setting it up.
I do run it as a service, and it seems to work fine.

Jake LeBeau

 Robin Becker [EMAIL PROTECTED] 06/28/00 04:40PM 
The boss says he couldn't install Zope on our Win2000 box. He tried 3
times. Anybody else have a problem with M$'s latest?
yes he'd been playing with 1.5.2+ and it didn't co-operate well with
pythonservice.

-- 
Robin Becker

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




RE: [Zope] MySQL Select Statements

2000-06-30 Thread Andy Dustman

I should point out that 0.2.2 has not been fully released yet. There's a
bug I have to iron out of it first. Probably next week. Also, for general
MySQLdb questions, send them to [EMAIL PROTECTED] (mailing list). Or
subscribe, it's low-volume and won't fatten your mailbox.

On Fri, 30 Jun 2000, Michael Blewett wrote:

 It's funny that you say 0.2.2 is broken. Apart from this one glitch, it 
 works fine for me (although from memory I think we had to do a little bit 
 of fiddling at install time to get it to work).

It's a matter of perspective. I prefer to think of it as 0.2.2 breaks
ZMySQLDA. This is because ZMySQLDA uses _mysql, and _mysql prior to 0.2.2
implemented fetch_row(), fetch_rows(), fetch_all_rows(), and the
..._as_dict() variants. This was just too much code duplication to put up
with, and the new interface is fetch([n[,how]]) where n is the maximum
number of rows to fetch (default 1), and how is how to return the result
(0: as tuple, 1: as dictionary, other codes may be added at some point).
To fix ZMySQLDA, change fetch_all_rows() to fetch(maxrows) in the query
routine. One other place (to get the tables) uses fetch_all_rows(). If you
insist on using 0.2.2 at this point, change that as well. 0.2.2 is marked
Alpha for a reason... And when I release it, I'll include a very small
patch to make things right with ZMySQLDA again (I'm treating mordred's as
the official one at this point).
 
 At 00:12 30/06/2000 -0400, Ron Bickers wrote:
 Why do you say you "must" use the AS statement?  Do you get an error
 otherwise?
 
 MySQLdb 0.2.2 is broken when used with ZMySQLDA.  But 0.2.1 works okay for
 me.  Andy Dustman (author of the MySQLdb) said he will fix it and hinted
 that one should use the ZMySQLDA that is on Zope.org (v1.2.0 now I believe).
 Since that one now uses his MySQLdb, he will likely kill off his own DA.

Quite true. Now for the AS statement: If you are joining tables with
identically-named columns in common, you should use AS in your SQL to
rename them. Otherwise it will return two columns with the same name to
Zope, which is bad. You do not, however, need to do this:

   Just need someone to put me straight here. When I use Select
   statements in
   an SQL Method I cannot simply :
  
   Select Column1, Column2 etc
   from TableA.
  
   Instead I must use the AS statement ie
  
   Select Column1 AS Column1, Column2 AS Column2
   from TableA.
  
 - Michael

This is just gratuitious renaming to the original name, which is not
renaming at all. Here's an example of what I'm talking about.

SELECT TableA.Col, TableB.Col from TableA, TableB # bad
SELECT TableA.Col AS ColA, TableB.Col AS ColB from TableA, TableB # good

Note that the first SELECT returned two columns named Col, which will
confuse Zope, and the second returns ColA (TableA.Col) and ColB
(TableB.Col).

Additional compatibility note: One of the 0.2.2 changes has been to
synchronize with MySQL-3.23 evolution (now at 3.23.19-beta, and GPL'd),
and the big feature here is: Transactions! Yes, as of 3.23.15,
transactions are in MySQL, if you use BDB tables. And yes, BDB does mean
Berkeley DB, specificially the Sleepycat DB v3, which supports
transactions (but probably not columns, which I presume MySQL is imposing
on the database).

For ZMySQLDA developers out there; MySQL-3.23 defaults to autocommit.
However, there is a BEGIN SQL statement which starts a transaction and
similarly for COMMIT and ROLLBACK statements. But remember: All this
transactional stuff ONLY works on BDB tables. If you try to BEGIN a
transaction (or turn off autocommit) on another table type, well, I'm not
sure what happens. Maybe you get an error, and maybe you don't. Not sure
what the solution is for this. It may be necessary to have the ZMySQLDA
package include another DA: ZMySQLTDA for transactions. The standard DA
would not be based on TM, and the transactional one could simply subclass
the other one:

# ZMySQLTDA/db.py
from Shared.DC.ZRDB.TM import TM

class DB(ZMySQLDA.DB, TM):

def _begin(self, *ignored): self.db.query("BEGIN")
def _finish(self, *ignored): self.db.query("COMMIT")
def _abort(self, *ignored): self.db.query("ROLLBACK")

Obviously the application designer will have to use the right DA for the
right table type...

-- 
andy dustman   | programmer/analyst |  comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
"Therefore, sweet knights, if you may doubt your strength or courage, 
come no further, for death awaits you all, with nasty, big, pointy teeth!"


___
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] Proxy role bug (or feature)

2000-06-30 Thread Ng Pheng Siong

Hi,

I have encountered a problem with proxy roles with my product GuardedFile.

A GuardedFile is a File that is accessible by proxy only. When a GuardedFile
is created, all acquired permissions are unset and a proxy role is created
in its container with the sole permission 'view'. In all other aspects
a GuardedFile behaves like a File.

Typically, the GuardedFile creator next creates a DTML method and assigns
to it the associated proxy role. Anonymous and other users access the 
GuardedFile via the DTML method.


I've discovered a problem with the product setup: Suppose user 'ngps' exists
in the top-level user folder, and has the default roles 'owner' and
'manager'.

1. ngps creates a folder called 'junk' somewhere within Zope. 

2. ngps switches to the folder 'junk'.

3. ngps creates a GuardedFile 'agf'. A proxy role 'proxy_for_agf' is
automatically created in 'junk'.

4. ngps creates a DTML method 'view_agf' to access 'agf'. When ngps tries 
to assign the role 'proxy_for_agf' to 'view_agf', the following error is 
generated: (Slightly reformatted for readability.)

   You are not authorized to change 'view_agf' because you do not 
   have proxy roles.
   
   Traceback (innermost last):
 File C:\pkg\Zope220b3\lib\python\ZPublisher\Publish.py, line 222, 
in publish_module
 File C:\pkg\Zope220b3\lib\python\ZPublisher\Publish.py, line 187, 
in publish
 File C:\pkg\Zope220b3\lib\python\Zope\__init__.py, line 221, 
in zpublisher_exception_hook
   (Object: view_agf)
 File C:\pkg\Zope220b3\lib\python\ZPublisher\Publish.py, line 171, 
in publish
 File C:\pkg\Zope220b3\lib\python\ZPublisher\mapply.py, line 160, 
in mapply
(Object: manage_proxy)
 File C:\pkg\Zope220b3\lib\python\ZPublisher\Publish.py, line 112, 
in call_object
   (Object: manage_proxy)
 File C:\pkg\Zope220b3\lib\python\OFS\DTMLMethod.py, line 273, 
in manage_proxy
   (Object: view_agf)
 File C:\pkg\Zope220b3\lib\python\OFS\DTMLMethod.py, line 266, 
in _validateProxy
   (Object: view_agf)
   Forbidden: (see above)


The following works around this:

1. ngps creates a user folder in 'junk'.

2. ngps adds a user in 'junk' called 'user2', with roles 'owner',
'manager' and 'proxy_for_agf'.

3. Login as 'user2'; 'user2' is now able to assign the role 'proxy_for_agf'
to the above-mentioned DTML method 'view_agf'.


This proxy role handling seems unwieldy, in that 'ngps' cannot assign
the proxy role but can create another user 'user2' that _can_ assign
said proxy role.

Is this a bug or a feature?


Cheers.
-- 
Ng Pheng Siong [EMAIL PROTECTED] * http://www.post1.com/home/ngps


___
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] Newbie question

2000-06-30 Thread Jerry Jewell

Has anyone gotten Zope running on either LinuxPPC or OSX? If so, can you
share your wisdom on how it was done?

We'll also be looking for experienced Zope web site developers so send
me your resume if interested.

Thanks

Jerry Jewell
WebDudes, Inc.
916 624 0601


___
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] Available Object List (Was Re: [Zope] GOOD)

2000-06-30 Thread Andy McKay

And a "Check all" while they are at it  then again 900 objects in one
folder aint the best way to do things
- Original Message -
From: "J. Atwood" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 30, 2000 7:27 AM
Subject: [Zope] Available Object List (Was Re: [Zope] GOOD)


  they should put their "Available Object" white box, you know what I
mean
  ? -ABOVE- the files. See, when you have 900 files in one directory,
 
  Aye!  I second that.

 I know it is bad behavior to just say "me too" and send it to the list..
 but...

 ME TOO!

 This is one of those things that would seem like it would take DC about 10
 minutes to do and would greatly improve our (Zope Programmers) lives.

 What say DC? 2.2b4?

 J


 ___
 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] Error handling and super users....

2000-06-30 Thread Andy McKay

Hi Tino

 My be dtml-try is what you want?

A dtml try works well in dtml in a file. But take an error such as "object
not found" (analogous to 404) or some other error that does not specifically
call a method. Or does it? This is the question I guess. Yes I use try and
except's quite a bit.

 Look for the options of zpasswd.py.
 You can run it interactively with "python zpasswd access"
 at the last step you are asked for valid domains.

Oops that one was obvious. Sorry!


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

2000-06-30 Thread Andy McKay

No prob here. I had a brief problem for me with zope 2.2 beta 2 I think on
Windows. That is fixed now though... what version and any more detail of the
exact problem?

- Original Message -
From: "Robin Becker" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 30, 2000 8:24 AM
Subject: Re: [Zope] Win2000


 In article [EMAIL PROTECTED], Jake LeBeau
 [EMAIL PROTECTED] writes
 I'm running it here on W2K Server - I don't remember having much of a
problem
 setting it up.
 I do run it as a service, and it seems to work fine.
 
 Jake LeBeau
 
  Robin Becker [EMAIL PROTECTED] 06/28/00 04:40PM 
 The boss says he couldn't install Zope on our Win2000 box. He tried 3
 times. Anybody else have a problem with M$'s latest?
 yes he'd been playing with 1.5.2+ and it didn't co-operate well with
 pythonservice.

 --
 Robin Becker

 ___
 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] importing text files

2000-06-30 Thread joel grimes

I have a file object (a text file) in my project that is displayed in a dtml 
document.  Is there a way to make that object dynamic, i.e. when a user 
changes the file (in notepad, or something) and saves it, those changes are 
reflected next time the dtml document is loaded.

When I started the project I was operating under the assumption that a file 
object was a link to the object, not a static snapshot of it - silly me.

Thanks,

Joel Grimes

Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


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




RE: [Zope] MySQL Select Statements

2000-06-30 Thread Ron Bickers

 -Original Message-
 From: Andy Dustman [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 30, 2000 11:42 AM
 To: Michael Blewett
 Cc: Ron Bickers; [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [Zope] MySQL Select Statements


 It's a matter of perspective. I prefer to think of it as 0.2.2 breaks
 ZMySQLDA. This is because ZMySQLDA uses _mysql, and _mysql prior to 0.2.2
 implemented fetch_row(), fetch_rows(), fetch_all_rows(), and the
 ..._as_dict() variants.

Thanks for clarifying that.  I hope the 1.2.0 DA continues to follow your
(Andy's) changes to the MySQLdb so that we can have a nice, working, stable
db/DA combination.

 what the solution is for this. It may be necessary to have the ZMySQLDA
 package include another DA: ZMySQLTDA for transactions. The standard DA

Please not two DAs just for the difference in transaction support.

 Obviously the application designer will have to use the right DA for the
 right table type...

It should be as simple as the application designer actually knowing what
they're doing by knowing whether or not they're working with a table that
supports transactions or not, and just not using BEGIN/COMMIT/ROLLBACK when
they're not.  Or is it too much to ask that designers know what they're
doing? :-)

___

Ron Bickers
Logic Etc, Inc.
[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 )




Re: [Zope] How to upload 900 files, in one shot ?

2000-06-30 Thread Ng Pheng Siong

On Fri, Jun 30, 2000 at 03:05:49AM -0400, Jonathan Desp wrote:
  How I can upload 900 files inside Zope, if I want to be able to manage
  them by the Zope Interface,

Using so-called "Internet programming". ;-)

If you 'view frame source' when creating a Zope File object, you'll
see that 'form action="manage_addFile" method="post" ...', with
parameters 'id', 'title' and 'file'.

This means you can talk to it via http post. Executable pseudo-code 
0.5 wink follows:

import urllib

user = 'zope_user'
passwd = 'zope_pass'
folder = '/path/to/my/folder'
action = '/manage_addFile'

url = 'http://%s:%s@myzope:8080%s%s' % (user, passwd, folder, action)

for fname in my_900_file_list:
dict = {'id':fname, 'title':fname, 'file':fname}
postdata = urllib.urlencode(dict)
u = urllib.urlopen(url, postdata)


The very act of "u = urllib.urlopen(...)" will create a Zope File object 
with id and title set to the filename. 

You don't have to do anything with "u", just loop around. Indeed,
if you try, say, u.read(), Zope will prompt you for username and password.

You'll probably need to make your filenames legal Zope identifiers, e.g., 
by stripping path separators.

clicking-and-drooling-over-900-entries-is-sure-fun-ly y'rs
-- 
Ng Pheng Siong [EMAIL PROTECTED] * http://www.post1.com/home/ngps


___
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] get 2 properties at the same time

2000-06-30 Thread Marcus Mendes

Hello,

I need get 2 properties of Zclass at the same time.
I´m using in my form :

tdselect name="region"
 dtml-in "Locality.objectValues(['Locality']) "
 option value="dtml-var REGION"dtml-var title
 /dtml-in
 option selected
 /select/td

I need get another property, for example MASTER_REGION, in this moment.

How can I to do it?  (is urgent!)

Thanks in advance,

Marcus Mendes


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

2000-06-30 Thread Jason Spisak

Curtis Maloney writes:

  Is it possible to simulate this sort of environment in an XML client?
 
 Hmm... what sort of XML client did you have in mind?  I may be wrong, but I 
 suspect you may have made a similar mistake to most people who encounter XML. 
  XML is not a whole data format, in much the same way as TCP is not a whole 
 protocol.
 
 HTTP is a protocol that uses TCP, just as XHTML and DocBook are data formats 
 that use XML.  XML allows any XML compliant parser to PARSE the contents, but 
 not neccesarily COMPREHEND it.
 
 So, a custom XML client could be built which would understand whatever I sent 
 it, and display the desktop accordingly.  However, an 'off the shelf' XML 
 'client'... who could say.
 

I meant a custom client.  Like the Jabber situation http://www.jabber.org


All my best,

Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.

___
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] Zope 2.2.0b3: can't call db_connection.query()

2000-06-30 Thread Cary O'Brien


With Zope 2.2.0b3, I can't seem to call the query() method
of a database connection any more.

For example, with a PostgreSQL connection called dbconn, calling

dtml-with dbconn
dtml-var "query('select count(*) from pg_class')"
/dtml-with

Works fine with 2.1.6, but with 2.2.0b3, I get...


Zope Error

Zope has encountered an error while publishing this resource. 

Unauthorized
...

 File /usr2/local/zope/Zope-2.2.0b3-src/lib/python/DocumentTemplate/DT_With.py, line 
146, in render
  (Object: dbconn)
 File /usr2/local/zope/Zope-2.2.0b3-src/lib/python/DocumentTemplate/DT_Util.py, line 
327, in eval
 (Object: query('select count(*) from pg_class'))
 (Info: query)
 File /usr2/local/zope/Zope-2.2.0b3-src/lib/python/OFS/DTMLMethod.py, line 189, in 
validate
 (Object: test1)
 File /usr2/local/zope/Zope-2.2.0b3-src/lib/python/AccessControl/SecurityManager.py, 
line 139, in validate
 File 
/usr2/local/zope/Zope-2.2.0b3-src/lib/python/AccessControl/ZopeSecurityPolicy.py, line 
158, in validate
  Unauthorized: query

Any ideas?

There doesn't seem to be any permission to set.

What I would like to do is add some functions to the PostgreSQL DA
so I can view table names and column names.

-- cary


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




RE: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-06-30 Thread Ron Bickers

 -Original Message-
 From: Andy Dustman [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 30, 2000 1:25 PM
 To: Ron Bickers
 Cc: Michael Blewett; [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [Zope] MySQL Select Statements

 That's the problem: They don't get control over when BEGIN/COMMIT/ROLLBACK
 are used. Zope does that if you are using the Transaction Manager. And the
 only way to control use of the Transaction Manager is by
 selection of DA.

 That's why I think it may be necessary to have two ZMySQLDAs: One which is
 transactional and one which is not. However, they can both be part of the
 same distribution, and the transactional one can simply subclass the
 non-transactional one (mixing in the TM base and adding the required
 methods), so there is not a lot of code duplication.

I see.  So how would this affect use of transaction and non-transaction
supporting tables?  Would two separate database connections be required
where the SQLMethod must use the correct connection depending on transaction
support?

Making assumptions is bad, but suppose MySQL 3.23 does something elegant
with BEGIN/COMMIT/ROLLBACK attempts on non-transaction supporting tables
(like return a "table does not support transactions" or simply ignores that
statement).  Could we then just have one DA for 3.22 and another for 3.23,
where the 3.23 DA handles transactions, but silently ignores them when
dealing with non-transaction tables?

___

Ron Bickers
Logic Etc, Inc.
[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 )




RE: [Zope] Kid clicking and Zope thread deadlock

2000-06-30 Thread Hung Jung Lu

From: Brian Lloyd [EMAIL PROTECTED]
The quick way to determine this: install a fresh Zope without
SybaseDA installed and see if you can reproduce the kid-clicking
behavior.

Another thing potentially to look at: there is problem with
Sybase connections that I have run into before where if you
have a request that runs a transactional query, then a non-
transactional query, then trys another transactional query
you get a hang :(  I don't know if this could be the case
here, but if so you might want to look here for more info:

http://classic.zope.org:8080/Collector/1059/view

Thank you very much! My preliminary test indicates that indeed the deadlock 
is coming from the Sybase database adapter. Zope alone seems to be doing 
fine (what a relief!), even under intense bombardment of http form requests.

I'll have more about Sybase deadlocking later, as I try to isolate the 
problem. I think the problem is not only with transaction-non_transaction 
interaction. The problem happens even after I connect all the Zope threads 
to Sybase, and use transactions for all threads afterwards.

regards,

Hung Jung



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
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] Accesing a new context from a manipulated string

2000-06-30 Thread Michael Bernstein

Here's my problem:

given a method itemURL(), that typically returns a site
relative URL such as '/about/', I need to change to the
appropriate directories context using dtml-with.

In short I need to do the equivalent of dtml-with about.

The closest I've gotten so far is:

dtml-with expr="_.getitem(itemURL(), 0)"

which generates a KeyError: /about/ in the traceback.

Can anyone help me truncate the extra '/'s off of this
string and pass it to the dtml-with?

Michael Bernstein.

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




Re: [Zope] Question from ZopeNewbies poster. . .

2000-06-30 Thread Jerome ALET

On Fri, Jun 30, 2000 at 10:13:37AM -0500, [EMAIL PROTECTED] wrote:
 problem is I can't insert the image at the insert form, and worse of all I
 don't know how to start. 

define your HTML form as:

form action="your_dtml_method" method="POST" 
  enctype="multipart/form-data"
  Filename: input type="file" name="myfile"
/form

then in your_dtml_method REQUEST['file'] should contain your 
file contents IIRC.

good luck

Jerome Alet

___
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] Messing with the namespaces stack [Was: (no subject)]

2000-06-30 Thread Jeff K. Hoffman

On Fri, 30 Jun 2000, Shane Hathaway wrote:

 Also remember you can play tricks with acquisition.  If you have a
 "default" style and a "lowres" style, you can set up your directories
 like this:
 
 /home
   /lowres
   /content
 
 "lowres" and "content" are both children of "home".  The default style
 elements are in home.  When the user browses to
 /home/content/index_html, they get the default style.  When the user
 visits /home/lowres/content/index_html, they get the lowres style.

This is, actually, not quite right.

Given the following hierarchy:

  /home
header
footer
/content
  index_html
/lowres
  header
  footer

and a request of /home/content/index_html, we have the following
acquisition path (assuming index_html is a DTML Method):

  /home/content= (content of home)
  /home/content/index_html = (index_html of (content of home))

Assuming index_html contains:

  dtml-var header
  Content.
  dtml-var footer

when index_html asks for header, the acquisition path is searched
from left to right; the content folder is searched first, followed by the
home folder, where header is found.

Now, with a request of /home/lowres/content/index_html, we have:

  /home/lowres= (lowres of home)
  /home/lowres/content= ((content of home)
 of (lowres of home))
  /home/lowres/content/index_html = (index_html of ((content of home)
of (lowres of home)))

Therefore, when index_html looks for header, the content folder is
searched, then the home folder, then the lowres folder, then the home
folder. Unfortunately, for our example, the header is found in the search
of the home folder, and we never make it to the lowres folder.

If, instead, we structure the request as /home/content/lowres/index_html,
we have:

  /home/content   = (content of home)
  /home/content/lowres= ((lowres of home) 
 of (content of home))
  /home/content/lowres/index_html = (index_html of ((lowres of home)
of (content of home)))

When index_html looks for header, we search lowres, then home, then
content, then home. The header is picked up from lowres, which is what we
want.

Hope this makes sense. Acquisition is not one of the things I have become
good at explaining, yet. The slides from Jim's Acquisition Algebra talk is
about the best source of information on this subject.

 Shane

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


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




Re: [Zope] Why can't I subclass a ZSQLMethod?

2000-06-30 Thread Andy McKay

ZSQLMethod is not registered as a base class. I dont know why, but you could
try changing it in the init.py... But Im sure there is a good reason why it
isnt.
- Original Message -
From: "Cary O'Brien" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 30, 2000 12:59 PM
Subject: [Zope] Why can't I subclass a ZSQLMethod?



 I want to wrap a presentation layer around ZSQLQueries, so that
 they will have methods to generate an input form [1] for the query,
 and generate tabular results if so desired.

 I tried to create a ZClass to do this, but I can't subclass from a
 ZSQLMethod.

 Any other ideas on how to do this (besides a class where you have
 to tell it the ZSQLMethod to use)?

 -- cary

 [1] Using sql.arguments_str to find out the arguments.  Finding THAT was
 a struggle!


 ___
 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] Re: Messing with the namespaces stack

2000-06-30 Thread Jim Hebert

On Fri, 30 Jun 2000, Hamish Lawson wrote:

 Jim, that is indeed clever. Am I right, however, in thinking that every
 DTML method or DTML document that wants this additional-parent
 behaviour will need to use these dtml-with wrappers? I think what I'm
 after is the ability to alter the parents of the containing folder
 itself, so that any contained method automatically has this modified
 acquisition path.

Yes. I sorta expected someone to point that out, which is part of the
reason I posted my other, longish post, which shows among other things
that I only have that double-dtml-with in one place, the toplevel
index_html.

So, it may not be ideal for other design patterns.

jim

-- 
Jim Hebert   http://www.cosource.com/
[EMAIL PROTECTED]  The cooperative market for open source software

"Well actually I was considering opening a market in flying pigs. Mostly
because it would be more practical" -- Alan Cox


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




Re: [Zope] Why can't I subclass a ZSQLMethod?

2000-06-30 Thread Ivan Raikov


Why don't you create a ZClass and make the ZSQLMethod to be one of its
methods? Then the ZClass can provide the user interface to the SQL
query and the result set.

Regards,
Ivan Raikov

"Cary O'Brien" [EMAIL PROTECTED] writes:

 I want to wrap a presentation layer around ZSQLQueries, so that
 they will have methods to generate an input form [1] for the query,
 and generate tabular results if so desired.
 
 I tried to create a ZClass to do this, but I can't subclass from a
 ZSQLMethod.
 
 Any other ideas on how to do this (besides a class where you have
 to tell it the ZSQLMethod to use)?
 
 -- cary
 
 [1] Using sql.arguments_str to find out the arguments.  Finding THAT was
 a struggle!  
 
 

___
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] Messing with the namespaces stack [Was: (no subject)]

2000-06-30 Thread Jim Hebert

On Fri, 30 Jun 2000, Shane Hathaway wrote:

 It's a great idea but I've had some thoughts on this myself.  I think
 the approach I would take is to create a ZClass.  Content authors would

Oooh, I like that idea a lot. Solves lots of problems, most notably the
hackery I currently do with the searching stuff: The search results come
up with urls like http://www.vistasource.com/body, which ain't right, so I
do a bunch of munging to make the urls right.

Also sounds like work, but hey, I suppose it's about time I earn that
salary... =)

 fundamental changes more easily. Have you learned about property sheets
 yet?  They are the key to success with ZClasses.

Nope, where shall I go to read the fine manual on those?

 visits /home/lowres/content/index_html, they get the lowres style.

(I understand this now, modulo the other post from Jeff.)

Yeah, this is the part of acquisition that I _get_, but just shy away
from for some reason. I need to get over that, because this is probably
one of the coolest things about acquisition.

 Zope is like a collection of Legos (TM): you're given a bunch of blocks
 and some instructions on how to build some specific models, but
 encouraged to explore putting them together in new ways.  Have you
 heard of the Lego Machine Gun?  :-)

Yeah, funny you should mention it. I was just looking at the web page for
it like 2 weeks ago.

And I like the analogy. =)

Thanks so much, I hope others on the list are profiting from this exchange
as much as I am!

jim

-- 
Jim Hebert   http://www.cosource.com/
[EMAIL PROTECTED]  The cooperative market for open source software

"Well actually I was considering opening a market in flying pigs. Mostly
because it would be more practical" -- Alan Cox




___
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] Programattically adding roles

2000-06-30 Thread Timothy Grant

I know how to add users programatically, but I am having a difficult thing
finding out how to add roles programatically. I have a list of user defined
roles that I would like to add, but am unsure how to do it within DTML or an
external method.

Please note that I am *not* trying to assign roles to users here, I am just
trying to add roles to the system.

-- 
Stand Fast,
tjg.

Timothy Grant [EMAIL PROTECTED]
Chief Technology Officer  www.exceptionalminds.com
Red Hat Certified Engineer  (503) 246-3630
Avalon Technology Group, Inc.   fax (503) 246-3124
Linux...Because crashing isn't normal


___
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 clicks: how to handle them?

2000-06-30 Thread Hung Jung Lu

Hi,

This must be a well-known problem: you click multiple times on a form 
button, and multiple requests are send to the server. On many websites they 
ask you not to click on the "confirm purchase" button twice, because 
otherwise you'll be charged twice.

Of course, browsers are to blame for this fault. I can't believe Internet 
Explorer and Netscape are both faulty at this (on Windows platform), but 
that's the sad reality. (What the heck where these programmers thinking when 
they made the form requests non-blocking?!!)

Anyway, how can one handle the problem from the server side? Session 
management is an obvious candidate. Every time you receive a request, you 
set a busy flag, and dump all the following requests, until the first 
request is properly finished. But this has two problems:

(1) You'll see on your browser the response to your last request, not to 
your first request.

(2) If you use RESPONSE.redirect(), your session is locked up.

Of course I can go down into the transaction manager level of Zope and do 
things from there.

But I'd like to know how other people handle the multiple click problem. Is 
there any easy way out?!

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
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] Multiple clicks: how to handle them?

2000-06-30 Thread Jim Hebert

One site I have seen uses javascript on the client side: you get a dialog
box that pops up on-click, tells you to only click once. Since the dialog
is modal, if you did click twice it (did whatever your platform does when
you have a modal dialog box up, eg beeps at you).

(yes, of course, it'd be nice to have a solution requiring javascript, but
I bet you that the people dumb enough to double click the submit button
are the people with javascript on... =)

jim

-- 
Jim Hebert   http://www.cosource.com/
[EMAIL PROTECTED]  The cooperative market for open source software

"Well actually I was considering opening a market in flying pigs. Mostly
because it would be more practical" -- Alan Cox



___
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] Multiple clicks: how to handle them?

2000-06-30 Thread Shane Hathaway

Hung Jung Lu wrote:
 This must be a well-known problem: you click multiple times on a form
 button, and multiple requests are send to the server. On many websites they
 ask you not to click on the "confirm purchase" button twice, because
 otherwise you'll be charged twice.

I've heard a suggestion I like a lot: send a hidden field in the form
with a random but discernably unique value.  When handling the form
submission, before performing any other processing check whether that
random value has already been copied to a small, persistent list.  If
the value is not there yet, add it and continue processing.  But if the
value is found, either stop the processing abruptly or somehow attach
to the thread which is doing the processing and return its contents
when it's finished.

Note that you should not use ZODB persistence to store the list because
each thread gets an independent view of the object database.  The
values should stay in the list for a few seconds beyond the end of the
transaction, so you'll have to implement a basic garbage collection
scheme.

Shane

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




Re: [Zope] MySQL Select Statements

2000-06-30 Thread Dieter Maurer

Michael Blewett writes:
  Select Column1, Column2 etc
  from TableA.
  
  Instead I must use the AS statement ie
  
  Select Column1 AS Column1, Column2 AS Column2
  from TableA.
Zope should not be responsible for this strange behaviour.

It simply executes the SQL statement and asks the result
for the result column names. It then wraps each result
row in an object that allows to access a column value
as attribute under the respective column name.

You could try:
dtml-let SQLresult=SQLMethod
  dtml-var "SQLresult.names()"
/dtml-in
to get the list of column names your Z SQL Method
"SQLMethod" returns.

This may give you a hint how your database names result columns.


I recently found out that Oracle returns column names
converted into all uppercase. I needed about 2 hours
to analyse this weird behaviour.



Dieter

___
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] Namespace question

2000-06-30 Thread Dieter Maurer

Rogerio Atem de Carvalho writes:
  folder1
|
folder11
   |
   folder111
  
  I have some objects in folder111 which I want to pass 
  as parameters to a dtml method in folder1 (two levels 
  above). I tried something like:
  
  dtml-with "PARENTS[2]"
   tddtml-var "mtdCreate(_.None, _,   
  qry_item='par1',qry_table='par2', list_name='par3')"
  /td/tr
  /dtml-with
  
  where par1 and par2 are strings and par3 is an object 
  in folder111. mtdCreate is in folder1. it doesn't 
  work...
You do not pass the objects "par1", "par2" and "par3"
but the literal strings 'par1', 'par2' and 'par3'.

At least for "par3", this will not be what you want.
Try: 
  dtml-with "PARENTS[2]"
   tddtml-var "mtdCreate(_.None, _,   
  qry_item='par1',qry_table='par2', list_name=par3)"
  /td/tr
  /dtml-with
I.e., remove the quotes from "par3" (maybe the other "par", too).



Dieter

___
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] ZCatalog Proximity Search (was: RE: [Zope] ZODB or not ZODB?)

2000-06-30 Thread Dieter Maurer

Eric L. Walstad writes:
  // I use ZCatalog to catalog objects in the file system included into
  // the Zope world via LocalFS.
  // Minor patch to LocalFS needed. Everything works with the exception
  // of proximity searches.
  Q1 - What is a "proximity search" and when would one be used?
Proximity searches are searches for terms that are near in the
document. ZCatalog uses "..." as near operator.
It implements a proximity search as an "and" search and assigns
the document a relevance that is inverse proportional
to the distance of the term occurrences.

  Q2 - Where can I find the minor patch you mentioned?  I just searched
  Zope.org and didn't see it.
URL:http://www.handshake.de/~dieter/pyprojects/zope/near.pat

The patch fixes Zope 2.1.6 ZCatalog's "near" operator.
It will work only for Zope 2.1.6.

ZCatalog is a development hotspot. Lots have changed
in the CVS and for Zope 2.2. Maybe, a patch is no
longer needed for Zope 2.2.


URL:http://www.handshake.de/~dieter/pyprojects/zope/localfs.pat

is the small patch for LocalFS. It gives LocalFS the necessary
infrastructure, that Zope's "find" machinery works for it.
This machinery is also used by ZCatalog.



Dieter

___
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] Re: ZODB or not ZODB?

2000-06-30 Thread Dieter Maurer

Rogerio Atem de Carvalho writes:
  Dieter Maurer writes
   the Zope world via LocalFS.
   I use ZCatalog to catalog objects in the file system included into
   the Zope world via LocalFS.
  
  How do you do to cache those objects, since LocalFS 
  referenced objects are not cached by Zope?
ZCatalog only requires the objects being URL addressable;
cachability is not an issue.


Dieter

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

2000-06-30 Thread Dieter Maurer

David Trudgett writes:
  I'm having some trouble setting up a search interface into a ZCatalog. I 
  want to create a text index on the contents of my DTML documents, but I 
  can't seem to get it to work. It search on title just fine. I think my 
  problem is that I don't know how to create the right index, and what to 
  call it (how the body or text of a DTML document is referenced). Can anyone 
  enlighten me about this? I might be going blind, but I haven't come across 
  anything in the documentation so far that answers my question. I'm about to 
  resort to reading the Zope source! (which I think I will need to do sooner 
  or later anyway, to get a better understanding of how it all works).
The DTML content can be indexed under the name
"PrincipiaSearchSource".


Dieter

___
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 cope with International characters / Zclass / property sheets...

2000-06-30 Thread Jrgen Skogstad

Hi there.. 

Have anyone had problems with getting /345 etc. codes in 
their output? I get that when I try to "print" objects 
with texts after searching the items in ZCatalog .. 

.. could anyone give me any clues of how to solve this?

Would be very happy if you could assist somehow!

Kindest,
Jørgen Skogstad


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




Re: [Zope] Why can't I subclass a ZSQLMethod?

2000-06-30 Thread Cary O'Brien


I tried that.  You can't add a ZSQLMethod unless there is a connection
for it to connect to.  There isn't a connection in the products area.

Actually

If I put a dummy gadfly connection in the Product folder, I can
indeed add a zsql method to my ZClass.  However I can't get a
view to it.  I can configure it as a view, but it doesn't show
up in the management tabs.

I guess it may be possible to leave it invisible and use
other methods to set the query, arguments, and database
connection.  More digging through the .py files!

-- cary

 
 Why don't you create a ZClass and make the ZSQLMethod to be one of its
 methods? Then the ZClass can provide the user interface to the SQL
 query and the result set.
 
 Regards,
 Ivan Raikov
 
 "Cary O'Brien" [EMAIL PROTECTED] writes:
 
  I want to wrap a presentation layer around ZSQLQueries, so that
  they will have methods to generate an input form [1] for the query,
  and generate tabular results if so desired.
  
  I tried to create a ZClass to do this, but I can't subclass from a
  ZSQLMethod.
  
  Any other ideas on how to do this (besides a class where you have
  to tell it the ZSQLMethod to use)?
  
  -- cary
  
  [1] Using sql.arguments_str to find out the arguments.  Finding THAT was
  a struggle!  
  
  
 


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




RE: [Zope] Authentication, Anonymous and Public

2000-06-30 Thread Alan Capesius, MCSE

I thought the same. Perhaps the use of NT User causes this? 
Since the browser has the credentials to authenticate to NT and the higher folders are 
not aware of the 
NT User Folder...

Seems the only solutions are to use the NT User Folder at the root level.

Thanks

  --
  From:   Dieter Maurer[SMTP:[EMAIL PROTECTED]]
  Sent:   Friday, June 30, 2000 4:40:26 PM
  To: Capesius, Alan
  Cc: [EMAIL PROTECTED]
  Subject:Re: [Zope] Authentication, Anonymous and Public
  Auto forwarded by a Rule
  
 Capesius, Alan writes:
   I'm running into a problem after implementing jcNTUserFolder in a 
   subfolder of my site. Users can access the root level or particular 
   subfolders anonymously. Once a user accesses the protected 
   NTUserFolder, the credentials are saved in the browser. If the user 
   then returns to the anonymous area, they can no longer access th 
   folder due to the browser credentials.
   
   Does Zope have a mechanism equivalent to the Novell NDS Public access?
   that is to say:
   
   Anonymous = not authenticated.
   Everyone = authenticated users (that are members of the group)
   Public = authenticated and anonymous users.
 
 In Zope, each user has a set of roles.
 Any user has the "Anonymous" role. Log-in users may have
 additional roles.
 
 Thus, what you see, should not happen.
 
 
 Dieter
 


___
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] Oracle 8i problem: OCIEnvInit failed

2000-06-30 Thread Dave Parker

I'm having trouble figuring this out - I've got a zope 2.1.4 server that
I'm trying to get to work with DCOracle 1.3.1 b1, ZOracleDA 2.2.0 b1,
Oracle 8i client and Oracle 8 server on a RH 6.1 Linux machine.

The DCOracle test routine *does* work - it connects and says as much. 

Within Zope I'm getting some frustrating behavior however.

I'm starting Zope with the "start" script in an environment that has
ORACLE_HOME set just as it was for the DCOracle test script.  The
product looks OK in the control panel.  I can make an instance of it,
but if I have "connect immediately" turned on Zope *dies* and I get
"OCIEnvInit failed, oci_8.c:220" in the terminal that I started Zope
on.  If I have "connect immediately" turned off, I can create the
instance.  But whenever I try to connect I get the same problem - Zope
dies with the OCIEnvInit failed error.

Any clues folks?  I'm seriously pressed for time here - anything you
have would be most appreciated!

Thanks,

Dave Parker

begin:vcard 
n:Parker;Dave
tel;home:408 230 0009
x-mozilla-html:FALSE
url:http://addiction.daveparker.org
org:NOCPulse
adr:;;660 Bair Island Rd #38;Redwood City;CA;;USA
version:2.1
email;internet:[EMAIL PROTECTED]
title:Principal Engineer
x-mozilla-cpt:;-10464
fn:Dave Parker
end:vcard



[Zope] 2.2b3 and INSTANCE_HOME problem

2000-06-30 Thread Ron Bickers

Using the instructions at http://www.zope.org/Members/4am/instancehome on
how to run multiple zopes with the same install, I semi-successfully have
two instances of 2.2b3 running.  However, when I run them, I get the
following traceback for XMLDocument (INSTANCE_HOME is /home/zopdev/zope in
this case):

2000-07-01T04:37:22 ERROR(200) Zope Couldn't install XMLDocument
Traceback (innermost last):
  File /usr/local/zope-2.2b3/lib/python/OFS/Application.py, line 467, in
install_products
(Object: ApplicationDefaultPermissions)
(Info: XMLDocument)
  File /home/zopedev/zope/Products/XMLDocument/__init__.py, line 102, in
initialize
  File /usr/local/zope-2.2b3/lib/python/App/ImageFile.py, line 110, in
__init__
IOError: [Errno 2] No such file or directory:
'/usr/local/zope-2.2b3/lib/python/Products/XMLDocument/xml_element.gif'

It's not looking in the right place for the image file in XMLDocument. You
can see that if found the XMLDocument product in INSTANCE_HOME/Products (of
course, or it wouldn't have tried to install it in the first place).

I get other IOErrors when I try to add or manipulate objects where Zope is
looking in the wrong place for dtml files or whatever.  Everything works as
far as I can tell when browsing the site itself.

Is this a bug, or do I need to set some other variable, or what?

___

Ron Bickers
Logic Etc, Inc.
[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] Removing part of a string (in an URL)

2000-06-30 Thread Walter A. Aprile


Hi,
more newbie questions, I am afraid. I have a ZCatalog result form
that boringly forms links this way:

dtml-var "busca.getpath(data_record_id_)"

Due to the way my site is organized, the URL I get has an unwanted
part at the beginning. The part is always the same size, and the same string
in fact. How do I remove it ? For example, the URL is

http://zorba.com.mx:8080/Zorba/busca/Zorba/cacharrito/prueba
^
and I would like to cut it here |
and turn it into 

/Zorba/cacharrito/prueba

The problem is that the URL above is still valid, but if I do another
search then the same /Zorba/busca gets added, and it gets longer and longer,
besides messing up my breadcrumb trail.

I tried using a regular expression method, but I do not really know
Python (not yet !), so it did not work. 

Thank you very much
Walter


-- Vita brevis, ars longa, occasio celeris, experimentum periculosum,
judicium difficile. Attention: Un train peut en cacher un autre
-- Eris aprueba este email ! -- http://redescolar.ilce.edu.mx


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